math_fwd.hpp 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712
  1. // math_fwd.hpp
  2. // TODO revise completely for new distribution classes.
  3. // Copyright Paul A. Bristow 2006.
  4. // Copyright John Maddock 2006.
  5. // Use, modification and distribution are subject to the
  6. // Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt
  8. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. // Omnibus list of forward declarations of math special functions.
  10. // IT = Integer type.
  11. // RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types
  12. // AT = Integer or Real type
  13. #ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP
  14. #define BOOST_MATH_SPECIAL_MATH_FWD_HPP
  15. #ifdef _MSC_VER
  16. #pragma once
  17. #endif
  18. #include <vector>
  19. #include <boost/math/special_functions/detail/round_fwd.hpp>
  20. #include <boost/math/tools/promotion.hpp> // for argument promotion.
  21. #include <boost/math/policies/policy.hpp>
  22. #include <boost/mpl/comparison.hpp>
  23. #include <boost/utility/enable_if.hpp>
  24. #include <boost/config/no_tr1/complex.hpp>
  25. #define BOOST_NO_MACRO_EXPAND /**/
  26. namespace boost
  27. {
  28. namespace math
  29. { // Math functions (in roughly alphabetic order).
  30. // Beta functions.
  31. template <class RT1, class RT2>
  32. typename tools::promote_args<RT1, RT2>::type
  33. beta(RT1 a, RT2 b); // Beta function (2 arguments).
  34. template <class RT1, class RT2, class A>
  35. typename tools::promote_args<RT1, RT2, A>::type
  36. beta(RT1 a, RT2 b, A x); // Beta function (3 arguments).
  37. template <class RT1, class RT2, class RT3, class Policy>
  38. typename tools::promote_args<RT1, RT2, RT3>::type
  39. beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments).
  40. template <class RT1, class RT2, class RT3>
  41. typename tools::promote_args<RT1, RT2, RT3>::type
  42. betac(RT1 a, RT2 b, RT3 x);
  43. template <class RT1, class RT2, class RT3, class Policy>
  44. typename tools::promote_args<RT1, RT2, RT3>::type
  45. betac(RT1 a, RT2 b, RT3 x, const Policy& pol);
  46. template <class RT1, class RT2, class RT3>
  47. typename tools::promote_args<RT1, RT2, RT3>::type
  48. ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function.
  49. template <class RT1, class RT2, class RT3, class Policy>
  50. typename tools::promote_args<RT1, RT2, RT3>::type
  51. ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function.
  52. template <class RT1, class RT2, class RT3>
  53. typename tools::promote_args<RT1, RT2, RT3>::type
  54. ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function.
  55. template <class RT1, class RT2, class RT3, class Policy>
  56. typename tools::promote_args<RT1, RT2, RT3>::type
  57. ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function.
  58. template <class T1, class T2, class T3, class T4>
  59. typename tools::promote_args<T1, T2, T3, T4>::type
  60. ibeta_inv(T1 a, T2 b, T3 p, T4* py);
  61. template <class T1, class T2, class T3, class T4, class Policy>
  62. typename tools::promote_args<T1, T2, T3, T4>::type
  63. ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol);
  64. template <class RT1, class RT2, class RT3>
  65. typename tools::promote_args<RT1, RT2, RT3>::type
  66. ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  67. template <class RT1, class RT2, class RT3, class Policy>
  68. typename tools::promote_args<RT1, RT2, RT3>::type
  69. ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  70. template <class RT1, class RT2, class RT3>
  71. typename tools::promote_args<RT1, RT2, RT3>::type
  72. ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  73. template <class RT1, class RT2, class RT3, class Policy>
  74. typename tools::promote_args<RT1, RT2, RT3>::type
  75. ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  76. template <class RT1, class RT2, class RT3>
  77. typename tools::promote_args<RT1, RT2, RT3>::type
  78. ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  79. template <class RT1, class RT2, class RT3, class Policy>
  80. typename tools::promote_args<RT1, RT2, RT3>::type
  81. ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  82. template <class T1, class T2, class T3, class T4>
  83. typename tools::promote_args<T1, T2, T3, T4>::type
  84. ibetac_inv(T1 a, T2 b, T3 q, T4* py);
  85. template <class T1, class T2, class T3, class T4, class Policy>
  86. typename tools::promote_args<T1, T2, T3, T4>::type
  87. ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol);
  88. template <class RT1, class RT2, class RT3>
  89. typename tools::promote_args<RT1, RT2, RT3>::type
  90. ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  91. template <class RT1, class RT2, class RT3, class Policy>
  92. typename tools::promote_args<RT1, RT2, RT3>::type
  93. ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  94. template <class RT1, class RT2, class RT3>
  95. typename tools::promote_args<RT1, RT2, RT3>::type
  96. ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  97. template <class RT1, class RT2, class RT3, class Policy>
  98. typename tools::promote_args<RT1, RT2, RT3>::type
  99. ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  100. template <class RT1, class RT2, class RT3>
  101. typename tools::promote_args<RT1, RT2, RT3>::type
  102. ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  103. template <class RT1, class RT2, class RT3, class Policy>
  104. typename tools::promote_args<RT1, RT2, RT3>::type
  105. ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  106. template <class RT1, class RT2, class RT3>
  107. typename tools::promote_args<RT1, RT2, RT3>::type
  108. ibeta_derivative(RT1 a, RT2 b, RT3 x); // derivative of incomplete beta
  109. template <class RT1, class RT2, class RT3, class Policy>
  110. typename tools::promote_args<RT1, RT2, RT3>::type
  111. ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol); // derivative of incomplete beta
  112. // Binomial:
  113. template <class T, class Policy>
  114. T binomial_coefficient(unsigned n, unsigned k, const Policy& pol);
  115. template <class T>
  116. T binomial_coefficient(unsigned n, unsigned k);
  117. // erf & erfc error functions.
  118. template <class RT> // Error function.
  119. typename tools::promote_args<RT>::type erf(RT z);
  120. template <class RT, class Policy> // Error function.
  121. typename tools::promote_args<RT>::type erf(RT z, const Policy&);
  122. template <class RT>// Error function complement.
  123. typename tools::promote_args<RT>::type erfc(RT z);
  124. template <class RT, class Policy>// Error function complement.
  125. typename tools::promote_args<RT>::type erfc(RT z, const Policy&);
  126. template <class RT>// Error function inverse.
  127. typename tools::promote_args<RT>::type erf_inv(RT z);
  128. template <class RT, class Policy>// Error function inverse.
  129. typename tools::promote_args<RT>::type erf_inv(RT z, const Policy& pol);
  130. template <class RT>// Error function complement inverse.
  131. typename tools::promote_args<RT>::type erfc_inv(RT z);
  132. template <class RT, class Policy>// Error function complement inverse.
  133. typename tools::promote_args<RT>::type erfc_inv(RT z, const Policy& pol);
  134. // Polynomials:
  135. template <class T1, class T2, class T3>
  136. typename tools::promote_args<T1, T2, T3>::type
  137. legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1);
  138. template <class T>
  139. typename tools::promote_args<T>::type
  140. legendre_p(int l, T x);
  141. template <class T>
  142. typename tools::promote_args<T>::type
  143. legendre_p_prime(int l, T x);
  144. template <class T, class Policy>
  145. inline std::vector<T> legendre_p_zeros(int l, const Policy& pol);
  146. template <class T>
  147. inline std::vector<T> legendre_p_zeros(int l);
  148. #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
  149. template <class T, class Policy>
  150. typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
  151. legendre_p(int l, T x, const Policy& pol);
  152. template <class T, class Policy>
  153. inline typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
  154. legendre_p_prime(int l, T x, const Policy& pol);
  155. #endif
  156. template <class T>
  157. typename tools::promote_args<T>::type
  158. legendre_q(unsigned l, T x);
  159. #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
  160. template <class T, class Policy>
  161. typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
  162. legendre_q(unsigned l, T x, const Policy& pol);
  163. #endif
  164. template <class T1, class T2, class T3>
  165. typename tools::promote_args<T1, T2, T3>::type
  166. legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
  167. template <class T>
  168. typename tools::promote_args<T>::type
  169. legendre_p(int l, int m, T x);
  170. template <class T, class Policy>
  171. typename tools::promote_args<T>::type
  172. legendre_p(int l, int m, T x, const Policy& pol);
  173. template <class T1, class T2, class T3>
  174. typename tools::promote_args<T1, T2, T3>::type
  175. laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1);
  176. template <class T1, class T2, class T3>
  177. typename tools::promote_args<T1, T2, T3>::type
  178. laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1);
  179. template <class T>
  180. typename tools::promote_args<T>::type
  181. laguerre(unsigned n, T x);
  182. template <class T, class Policy>
  183. typename tools::promote_args<T>::type
  184. laguerre(unsigned n, unsigned m, T x, const Policy& pol);
  185. template <class T1, class T2>
  186. struct laguerre_result
  187. {
  188. typedef typename mpl::if_<
  189. policies::is_policy<T2>,
  190. typename tools::promote_args<T1>::type,
  191. typename tools::promote_args<T2>::type
  192. >::type type;
  193. };
  194. template <class T1, class T2>
  195. typename laguerre_result<T1, T2>::type
  196. laguerre(unsigned n, T1 m, T2 x);
  197. template <class T>
  198. typename tools::promote_args<T>::type
  199. hermite(unsigned n, T x);
  200. template <class T, class Policy>
  201. typename tools::promote_args<T>::type
  202. hermite(unsigned n, T x, const Policy& pol);
  203. template <class T1, class T2, class T3>
  204. typename tools::promote_args<T1, T2, T3>::type
  205. hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
  206. template<class T1, class T2, class T3>
  207. typename tools::promote_args<T1, T2, T3>::type chebyshev_next(T1 const & x, T2 const & Tn, T3 const & Tn_1);
  208. template <class Real, class Policy>
  209. typename tools::promote_args<Real>::type
  210. chebyshev_t(unsigned n, Real const & x, const Policy&);
  211. template<class Real>
  212. typename tools::promote_args<Real>::type chebyshev_t(unsigned n, Real const & x);
  213. template <class Real, class Policy>
  214. typename tools::promote_args<Real>::type
  215. chebyshev_u(unsigned n, Real const & x, const Policy&);
  216. template<class Real>
  217. typename tools::promote_args<Real>::type chebyshev_u(unsigned n, Real const & x);
  218. template <class Real, class Policy>
  219. typename tools::promote_args<Real>::type
  220. chebyshev_t_prime(unsigned n, Real const & x, const Policy&);
  221. template<class Real>
  222. typename tools::promote_args<Real>::type chebyshev_t_prime(unsigned n, Real const & x);
  223. template<class Real, class T2>
  224. Real chebyshev_clenshaw_recurrence(const Real* const c, size_t length, const T2& x);
  225. template <class T1, class T2>
  226. std::complex<typename tools::promote_args<T1, T2>::type>
  227. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi);
  228. template <class T1, class T2, class Policy>
  229. std::complex<typename tools::promote_args<T1, T2>::type>
  230. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  231. template <class T1, class T2>
  232. typename tools::promote_args<T1, T2>::type
  233. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi);
  234. template <class T1, class T2, class Policy>
  235. typename tools::promote_args<T1, T2>::type
  236. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  237. template <class T1, class T2>
  238. typename tools::promote_args<T1, T2>::type
  239. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi);
  240. template <class T1, class T2, class Policy>
  241. typename tools::promote_args<T1, T2>::type
  242. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  243. // Elliptic integrals:
  244. template <class T1, class T2, class T3>
  245. typename tools::promote_args<T1, T2, T3>::type
  246. ellint_rf(T1 x, T2 y, T3 z);
  247. template <class T1, class T2, class T3, class Policy>
  248. typename tools::promote_args<T1, T2, T3>::type
  249. ellint_rf(T1 x, T2 y, T3 z, const Policy& pol);
  250. template <class T1, class T2, class T3>
  251. typename tools::promote_args<T1, T2, T3>::type
  252. ellint_rd(T1 x, T2 y, T3 z);
  253. template <class T1, class T2, class T3, class Policy>
  254. typename tools::promote_args<T1, T2, T3>::type
  255. ellint_rd(T1 x, T2 y, T3 z, const Policy& pol);
  256. template <class T1, class T2>
  257. typename tools::promote_args<T1, T2>::type
  258. ellint_rc(T1 x, T2 y);
  259. template <class T1, class T2, class Policy>
  260. typename tools::promote_args<T1, T2>::type
  261. ellint_rc(T1 x, T2 y, const Policy& pol);
  262. template <class T1, class T2, class T3, class T4>
  263. typename tools::promote_args<T1, T2, T3, T4>::type
  264. ellint_rj(T1 x, T2 y, T3 z, T4 p);
  265. template <class T1, class T2, class T3, class T4, class Policy>
  266. typename tools::promote_args<T1, T2, T3, T4>::type
  267. ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol);
  268. template <class T1, class T2, class T3>
  269. typename tools::promote_args<T1, T2, T3>::type
  270. ellint_rg(T1 x, T2 y, T3 z);
  271. template <class T1, class T2, class T3, class Policy>
  272. typename tools::promote_args<T1, T2, T3>::type
  273. ellint_rg(T1 x, T2 y, T3 z, const Policy& pol);
  274. template <typename T>
  275. typename tools::promote_args<T>::type ellint_2(T k);
  276. template <class T1, class T2>
  277. typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi);
  278. template <class T1, class T2, class Policy>
  279. typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi, const Policy& pol);
  280. template <typename T>
  281. typename tools::promote_args<T>::type ellint_1(T k);
  282. template <class T1, class T2>
  283. typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi);
  284. template <class T1, class T2, class Policy>
  285. typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy& pol);
  286. template <typename T>
  287. typename tools::promote_args<T>::type ellint_d(T k);
  288. template <class T1, class T2>
  289. typename tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi);
  290. template <class T1, class T2, class Policy>
  291. typename tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi, const Policy& pol);
  292. template <class T1, class T2>
  293. typename tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi);
  294. template <class T1, class T2, class Policy>
  295. typename tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi, const Policy& pol);
  296. template <class T1, class T2>
  297. typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi);
  298. template <class T1, class T2, class Policy>
  299. typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi, const Policy& pol);
  300. namespace detail{
  301. template <class T, class U, class V>
  302. struct ellint_3_result
  303. {
  304. typedef typename mpl::if_<
  305. policies::is_policy<V>,
  306. typename tools::promote_args<T, U>::type,
  307. typename tools::promote_args<T, U, V>::type
  308. >::type type;
  309. };
  310. } // namespace detail
  311. template <class T1, class T2, class T3>
  312. typename detail::ellint_3_result<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi);
  313. template <class T1, class T2, class T3, class Policy>
  314. typename tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol);
  315. template <class T1, class T2>
  316. typename tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v);
  317. // Factorial functions.
  318. // Note: not for integral types, at present.
  319. template <class RT>
  320. struct max_factorial;
  321. template <class RT>
  322. RT factorial(unsigned int);
  323. template <class RT, class Policy>
  324. RT factorial(unsigned int, const Policy& pol);
  325. template <class RT>
  326. RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT));
  327. template <class RT>
  328. RT double_factorial(unsigned i);
  329. template <class RT, class Policy>
  330. RT double_factorial(unsigned i, const Policy& pol);
  331. template <class RT>
  332. typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n);
  333. template <class RT, class Policy>
  334. typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
  335. template <class RT>
  336. typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
  337. template <class RT, class Policy>
  338. typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
  339. // Gamma functions.
  340. template <class RT>
  341. typename tools::promote_args<RT>::type tgamma(RT z);
  342. template <class RT>
  343. typename tools::promote_args<RT>::type tgamma1pm1(RT z);
  344. template <class RT, class Policy>
  345. typename tools::promote_args<RT>::type tgamma1pm1(RT z, const Policy& pol);
  346. template <class RT1, class RT2>
  347. typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z);
  348. template <class RT1, class RT2, class Policy>
  349. typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z, const Policy& pol);
  350. template <class RT>
  351. typename tools::promote_args<RT>::type lgamma(RT z, int* sign);
  352. template <class RT, class Policy>
  353. typename tools::promote_args<RT>::type lgamma(RT z, int* sign, const Policy& pol);
  354. template <class RT>
  355. typename tools::promote_args<RT>::type lgamma(RT x);
  356. template <class RT, class Policy>
  357. typename tools::promote_args<RT>::type lgamma(RT x, const Policy& pol);
  358. template <class RT1, class RT2>
  359. typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z);
  360. template <class RT1, class RT2, class Policy>
  361. typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z, const Policy&);
  362. template <class RT1, class RT2>
  363. typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z);
  364. template <class RT1, class RT2, class Policy>
  365. typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z, const Policy&);
  366. template <class RT1, class RT2>
  367. typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z);
  368. template <class RT1, class RT2, class Policy>
  369. typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z, const Policy&);
  370. template <class T1, class T2>
  371. typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta);
  372. template <class T1, class T2, class Policy>
  373. typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&);
  374. template <class T1, class T2>
  375. typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b);
  376. template <class T1, class T2, class Policy>
  377. typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b, const Policy&);
  378. template <class T1, class T2>
  379. typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x);
  380. template <class T1, class T2, class Policy>
  381. typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x, const Policy&);
  382. // gamma inverse.
  383. template <class T1, class T2>
  384. typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p);
  385. template <class T1, class T2, class Policy>
  386. typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p, const Policy&);
  387. template <class T1, class T2>
  388. typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p);
  389. template <class T1, class T2, class Policy>
  390. typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p, const Policy&);
  391. template <class T1, class T2>
  392. typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q);
  393. template <class T1, class T2, class Policy>
  394. typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q, const Policy&);
  395. template <class T1, class T2>
  396. typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q);
  397. template <class T1, class T2, class Policy>
  398. typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q, const Policy&);
  399. // digamma:
  400. template <class T>
  401. typename tools::promote_args<T>::type digamma(T x);
  402. template <class T, class Policy>
  403. typename tools::promote_args<T>::type digamma(T x, const Policy&);
  404. // trigamma:
  405. template <class T>
  406. typename tools::promote_args<T>::type trigamma(T x);
  407. template <class T, class Policy>
  408. typename tools::promote_args<T>::type trigamma(T x, const Policy&);
  409. // polygamma:
  410. template <class T>
  411. typename tools::promote_args<T>::type polygamma(int n, T x);
  412. template <class T, class Policy>
  413. typename tools::promote_args<T>::type polygamma(int n, T x, const Policy&);
  414. // Hypotenuse function sqrt(x ^ 2 + y ^ 2).
  415. template <class T1, class T2>
  416. typename tools::promote_args<T1, T2>::type
  417. hypot(T1 x, T2 y);
  418. template <class T1, class T2, class Policy>
  419. typename tools::promote_args<T1, T2>::type
  420. hypot(T1 x, T2 y, const Policy&);
  421. // cbrt - cube root.
  422. template <class RT>
  423. typename tools::promote_args<RT>::type cbrt(RT z);
  424. template <class RT, class Policy>
  425. typename tools::promote_args<RT>::type cbrt(RT z, const Policy&);
  426. // log1p is log(x + 1)
  427. template <class T>
  428. typename tools::promote_args<T>::type log1p(T);
  429. template <class T, class Policy>
  430. typename tools::promote_args<T>::type log1p(T, const Policy&);
  431. // log1pmx is log(x + 1) - x
  432. template <class T>
  433. typename tools::promote_args<T>::type log1pmx(T);
  434. template <class T, class Policy>
  435. typename tools::promote_args<T>::type log1pmx(T, const Policy&);
  436. // Exp (x) minus 1 functions.
  437. template <class T>
  438. typename tools::promote_args<T>::type expm1(T);
  439. template <class T, class Policy>
  440. typename tools::promote_args<T>::type expm1(T, const Policy&);
  441. // Power - 1
  442. template <class T1, class T2>
  443. typename tools::promote_args<T1, T2>::type
  444. powm1(const T1 a, const T2 z);
  445. template <class T1, class T2, class Policy>
  446. typename tools::promote_args<T1, T2>::type
  447. powm1(const T1 a, const T2 z, const Policy&);
  448. // sqrt(1+x) - 1
  449. template <class T>
  450. typename tools::promote_args<T>::type sqrt1pm1(const T& val);
  451. template <class T, class Policy>
  452. typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy&);
  453. // sinus cardinals:
  454. template <class T>
  455. typename tools::promote_args<T>::type sinc_pi(T x);
  456. template <class T, class Policy>
  457. typename tools::promote_args<T>::type sinc_pi(T x, const Policy&);
  458. template <class T>
  459. typename tools::promote_args<T>::type sinhc_pi(T x);
  460. template <class T, class Policy>
  461. typename tools::promote_args<T>::type sinhc_pi(T x, const Policy&);
  462. // inverse hyperbolics:
  463. template<typename T>
  464. typename tools::promote_args<T>::type asinh(T x);
  465. template<typename T, class Policy>
  466. typename tools::promote_args<T>::type asinh(T x, const Policy&);
  467. template<typename T>
  468. typename tools::promote_args<T>::type acosh(T x);
  469. template<typename T, class Policy>
  470. typename tools::promote_args<T>::type acosh(T x, const Policy&);
  471. template<typename T>
  472. typename tools::promote_args<T>::type atanh(T x);
  473. template<typename T, class Policy>
  474. typename tools::promote_args<T>::type atanh(T x, const Policy&);
  475. namespace detail{
  476. typedef mpl::int_<0> bessel_no_int_tag; // No integer optimisation possible.
  477. typedef mpl::int_<1> bessel_maybe_int_tag; // Maybe integer optimisation.
  478. typedef mpl::int_<2> bessel_int_tag; // Definite integer optimistaion.
  479. template <class T1, class T2, class Policy>
  480. struct bessel_traits
  481. {
  482. typedef typename mpl::if_<
  483. is_integral<T1>,
  484. typename tools::promote_args<T2>::type,
  485. typename tools::promote_args<T1, T2>::type
  486. >::type result_type;
  487. typedef typename policies::precision<result_type, Policy>::type precision_type;
  488. typedef typename mpl::if_<
  489. mpl::or_<
  490. mpl::less_equal<precision_type, mpl::int_<0> >,
  491. mpl::greater<precision_type, mpl::int_<64> > >,
  492. bessel_no_int_tag,
  493. typename mpl::if_<
  494. is_integral<T1>,
  495. bessel_int_tag,
  496. bessel_maybe_int_tag
  497. >::type
  498. >::type optimisation_tag;
  499. typedef typename mpl::if_<
  500. mpl::or_<
  501. mpl::less_equal<precision_type, mpl::int_<0> >,
  502. mpl::greater<precision_type, mpl::int_<113> > >,
  503. bessel_no_int_tag,
  504. typename mpl::if_<
  505. is_integral<T1>,
  506. bessel_int_tag,
  507. bessel_maybe_int_tag
  508. >::type
  509. >::type optimisation_tag128;
  510. };
  511. } // detail
  512. // Bessel functions:
  513. template <class T1, class T2, class Policy>
  514. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol);
  515. template <class T1, class T2, class Policy>
  516. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j_prime(T1 v, T2 x, const Policy& pol);
  517. template <class T1, class T2>
  518. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j(T1 v, T2 x);
  519. template <class T1, class T2>
  520. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j_prime(T1 v, T2 x);
  521. template <class T, class Policy>
  522. typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel(unsigned v, T x, const Policy& pol);
  523. template <class T, class Policy>
  524. typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel_prime(unsigned v, T x, const Policy& pol);
  525. template <class T>
  526. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel(unsigned v, T x);
  527. template <class T>
  528. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel_prime(unsigned v, T x);
  529. template <class T1, class T2, class Policy>
  530. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol);
  531. template <class T1, class T2, class Policy>
  532. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i_prime(T1 v, T2 x, const Policy& pol);
  533. template <class T1, class T2>
  534. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i(T1 v, T2 x);
  535. template <class T1, class T2>
  536. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i_prime(T1 v, T2 x);
  537. template <class T1, class T2, class Policy>
  538. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol);
  539. template <class T1, class T2, class Policy>
  540. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k_prime(T1 v, T2 x, const Policy& pol);
  541. template <class T1, class T2>
  542. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k(T1 v, T2 x);
  543. template <class T1, class T2>
  544. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k_prime(T1 v, T2 x);
  545. template <class T1, class T2, class Policy>
  546. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann(T1 v, T2 x, const Policy& pol);
  547. template <class T1, class T2, class Policy>
  548. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann_prime(T1 v, T2 x, const Policy& pol);
  549. template <class T1, class T2>
  550. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann(T1 v, T2 x);
  551. template <class T1, class T2>
  552. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann_prime(T1 v, T2 x);
  553. template <class T, class Policy>
  554. typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann(unsigned v, T x, const Policy& pol);
  555. template <class T, class Policy>
  556. typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann_prime(unsigned v, T x, const Policy& pol);
  557. template <class T>
  558. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
  559. template <class T>
  560. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann_prime(unsigned v, T x);
  561. template <class T, class Policy>
  562. typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
  563. template <class T>
  564. typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
  565. template <class T, class OutputIterator>
  566. OutputIterator cyl_bessel_j_zero(T v,
  567. int start_index,
  568. unsigned number_of_zeros,
  569. OutputIterator out_it);
  570. template <class T, class OutputIterator, class Policy>
  571. OutputIterator cyl_bessel_j_zero(T v,
  572. int start_index,
  573. unsigned number_of_zeros,
  574. OutputIterator out_it,
  575. const Policy&);
  576. template <class T, class Policy>
  577. typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
  578. template <class T>
  579. typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
  580. template <class T, class OutputIterator>
  581. OutputIterator cyl_neumann_zero(T v,
  582. int start_index,
  583. unsigned number_of_zeros,
  584. OutputIterator out_it);
  585. template <class T, class OutputIterator, class Policy>
  586. OutputIterator cyl_neumann_zero(T v,
  587. int start_index,
  588. unsigned number_of_zeros,
  589. OutputIterator out_it,
  590. const Policy&);
  591. template <class T1, class T2>
  592. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
  593. template <class T1, class T2, class Policy>
  594. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
  595. template <class T1, class T2, class Policy>
  596. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
  597. template <class T1, class T2>
  598. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
  599. template <class T1, class T2, class Policy>
  600. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
  601. template <class T1, class T2>
  602. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
  603. template <class T1, class T2, class Policy>
  604. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
  605. template <class T1, class T2>
  606. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
  607. template <class T, class Policy>
  608. typename tools::promote_args<T>::type airy_ai(T x, const Policy&);
  609. template <class T>
  610. typename tools::promote_args<T>::type airy_ai(T x);
  611. template <class T, class Policy>
  612. typename tools::promote_args<T>::type airy_bi(T x, const Policy&);
  613. template <class T>
  614. typename tools::promote_args<T>::type airy_bi(T x);
  615. template <class T, class Policy>
  616. typename tools::promote_args<T>::type airy_ai_prime(T x, const Policy&);
  617. template <class T>
  618. typename tools::promote_args<T>::type airy_ai_prime(T x);
  619. template <class T, class Policy>
  620. typename tools::promote_args<T>::type airy_bi_prime(T x, const Policy&);
  621. template <class T>
  622. typename tools::promote_args<T>::type airy_bi_prime(T x);
  623. template <class T>
  624. T airy_ai_zero(int m);
  625. template <class T, class Policy>
  626. T airy_ai_zero(int m, const Policy&);
  627. template <class OutputIterator>
  628. OutputIterator airy_ai_zero(
  629. int start_index,
  630. unsigned number_of_zeros,
  631. OutputIterator out_it);
  632. template <class OutputIterator, class Policy>
  633. OutputIterator airy_ai_zero(
  634. int start_index,
  635. unsigned number_of_zeros,
  636. OutputIterator out_it,
  637. const Policy&);
  638. template <class T>
  639. T airy_bi_zero(int m);
  640. template <class T, class Policy>
  641. T airy_bi_zero(int m, const Policy&);
  642. template <class OutputIterator>
  643. OutputIterator airy_bi_zero(
  644. int start_index,
  645. unsigned number_of_zeros,
  646. OutputIterator out_it);
  647. template <class OutputIterator, class Policy>
  648. OutputIterator airy_bi_zero(
  649. int start_index,
  650. unsigned number_of_zeros,
  651. OutputIterator out_it,
  652. const Policy&);
  653. template <class T, class Policy>
  654. typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
  655. template <class T>
  656. typename tools::promote_args<T>::type sin_pi(T x);
  657. template <class T, class Policy>
  658. typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
  659. template <class T>
  660. typename tools::promote_args<T>::type cos_pi(T x);
  661. template <class T>
  662. int fpclassify BOOST_NO_MACRO_EXPAND(T t);
  663. template <class T>
  664. bool isfinite BOOST_NO_MACRO_EXPAND(T z);
  665. template <class T>
  666. bool isinf BOOST_NO_MACRO_EXPAND(T t);
  667. template <class T>
  668. bool isnan BOOST_NO_MACRO_EXPAND(T t);
  669. template <class T>
  670. bool isnormal BOOST_NO_MACRO_EXPAND(T t);
  671. template<class T>
  672. int signbit BOOST_NO_MACRO_EXPAND(T x);
  673. template <class T>
  674. int sign BOOST_NO_MACRO_EXPAND(const T& z);
  675. template <class T, class U>
  676. typename tools::promote_args_permissive<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
  677. template <class T>
  678. typename tools::promote_args_permissive<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
  679. // Exponential integrals:
  680. namespace detail{
  681. template <class T, class U>
  682. struct expint_result
  683. {
  684. typedef typename mpl::if_<
  685. policies::is_policy<U>,
  686. typename tools::promote_args<T>::type,
  687. typename tools::promote_args<U>::type
  688. >::type type;
  689. };
  690. } // namespace detail
  691. template <class T, class Policy>
  692. typename tools::promote_args<T>::type expint(unsigned n, T z, const Policy&);
  693. template <class T, class U>
  694. typename detail::expint_result<T, U>::type expint(T const z, U const u);
  695. template <class T>
  696. typename tools::promote_args<T>::type expint(T z);
  697. // Zeta:
  698. template <class T, class Policy>
  699. typename tools::promote_args<T>::type zeta(T s, const Policy&);
  700. // Owen's T function:
  701. template <class T1, class T2, class Policy>
  702. typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
  703. template <class T1, class T2>
  704. typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
  705. // Jacobi Functions:
  706. template <class T, class U, class V, class Policy>
  707. typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
  708. template <class T, class U, class V>
  709. typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
  710. template <class U, class T, class Policy>
  711. typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
  712. template <class U, class T>
  713. typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta);
  714. template <class T, class U, class Policy>
  715. typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta, const Policy& pol);
  716. template <class T, class U>
  717. typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta);
  718. template <class T, class U, class Policy>
  719. typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta, const Policy& pol);
  720. template <class T, class U>
  721. typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta);
  722. template <class T, class U, class Policy>
  723. typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta, const Policy& pol);
  724. template <class T, class U>
  725. typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta);
  726. template <class T, class U, class Policy>
  727. typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta, const Policy& pol);
  728. template <class T, class U>
  729. typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta);
  730. template <class T, class U, class Policy>
  731. typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta, const Policy& pol);
  732. template <class T, class U>
  733. typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta);
  734. template <class T, class U, class Policy>
  735. typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta, const Policy& pol);
  736. template <class T, class U>
  737. typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta);
  738. template <class T, class U, class Policy>
  739. typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta, const Policy& pol);
  740. template <class T, class U>
  741. typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta);
  742. template <class T, class U, class Policy>
  743. typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta, const Policy& pol);
  744. template <class T, class U>
  745. typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta);
  746. template <class T, class U, class Policy>
  747. typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta, const Policy& pol);
  748. template <class T, class U>
  749. typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta);
  750. template <class T, class U, class Policy>
  751. typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta, const Policy& pol);
  752. template <class T, class U>
  753. typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta);
  754. template <class T, class U, class Policy>
  755. typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta, const Policy& pol);
  756. template <class T, class U>
  757. typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta);
  758. template <class T>
  759. typename tools::promote_args<T>::type zeta(T s);
  760. // pow:
  761. template <int N, typename T, class Policy>
  762. typename tools::promote_args<T>::type pow(T base, const Policy& policy);
  763. template <int N, typename T>
  764. typename tools::promote_args<T>::type pow(T base);
  765. // next:
  766. template <class T, class U, class Policy>
  767. typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
  768. template <class T, class U>
  769. typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
  770. template <class T, class Policy>
  771. typename tools::promote_args<T>::type float_next(const T&, const Policy&);
  772. template <class T>
  773. typename tools::promote_args<T>::type float_next(const T&);
  774. template <class T, class Policy>
  775. typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
  776. template <class T>
  777. typename tools::promote_args<T>::type float_prior(const T&);
  778. template <class T, class U, class Policy>
  779. typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
  780. template <class T, class U>
  781. typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
  782. template <class T, class Policy>
  783. typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
  784. template <class T>
  785. typename tools::promote_args<T>::type float_advance(const T& val, int distance);
  786. template <class T, class Policy>
  787. typename tools::promote_args<T>::type ulp(const T& val, const Policy& pol);
  788. template <class T>
  789. typename tools::promote_args<T>::type ulp(const T& val);
  790. template <class T, class U>
  791. typename tools::promote_args<T, U>::type relative_difference(const T&, const U&);
  792. template <class T, class U>
  793. typename tools::promote_args<T, U>::type epsilon_difference(const T&, const U&);
  794. template<class T>
  795. BOOST_MATH_CONSTEXPR_TABLE_FUNCTION T unchecked_bernoulli_b2n(const std::size_t n);
  796. template <class T, class Policy>
  797. T bernoulli_b2n(const int i, const Policy &pol);
  798. template <class T>
  799. T bernoulli_b2n(const int i);
  800. template <class T, class OutputIterator, class Policy>
  801. OutputIterator bernoulli_b2n(const int start_index,
  802. const unsigned number_of_bernoullis_b2n,
  803. OutputIterator out_it,
  804. const Policy& pol);
  805. template <class T, class OutputIterator>
  806. OutputIterator bernoulli_b2n(const int start_index,
  807. const unsigned number_of_bernoullis_b2n,
  808. OutputIterator out_it);
  809. template <class T, class Policy>
  810. T tangent_t2n(const int i, const Policy &pol);
  811. template <class T>
  812. T tangent_t2n(const int i);
  813. template <class T, class OutputIterator, class Policy>
  814. OutputIterator tangent_t2n(const int start_index,
  815. const unsigned number_of_bernoullis_b2n,
  816. OutputIterator out_it,
  817. const Policy& pol);
  818. template <class T, class OutputIterator>
  819. OutputIterator tangent_t2n(const int start_index,
  820. const unsigned number_of_bernoullis_b2n,
  821. OutputIterator out_it);
  822. // Lambert W:
  823. template <class T, class Policy>
  824. typename boost::math::tools::promote_args<T>::type lambert_w0(T z, const Policy& pol);
  825. template <class T>
  826. typename boost::math::tools::promote_args<T>::type lambert_w0(T z);
  827. template <class T, class Policy>
  828. typename boost::math::tools::promote_args<T>::type lambert_wm1(T z, const Policy& pol);
  829. template <class T>
  830. typename boost::math::tools::promote_args<T>::type lambert_wm1(T z);
  831. template <class T, class Policy>
  832. typename boost::math::tools::promote_args<T>::type lambert_w0_prime(T z, const Policy& pol);
  833. template <class T>
  834. typename boost::math::tools::promote_args<T>::type lambert_w0_prime(T z);
  835. template <class T, class Policy>
  836. typename boost::math::tools::promote_args<T>::type lambert_wm1_prime(T z, const Policy& pol);
  837. template <class T>
  838. typename boost::math::tools::promote_args<T>::type lambert_wm1_prime(T z);
  839. // Hypergeometrics:
  840. template <class T1, class T2> typename tools::promote_args<T1, T2>::type hypergeometric_1F0(T1 a, T2 z);
  841. template <class T1, class T2, class Policy> typename tools::promote_args<T1, T2>::type hypergeometric_1F0(T1 a, T2 z, const Policy&);
  842. template <class T1, class T2> typename tools::promote_args<T1, T2>::type hypergeometric_0F1(T1 b, T2 z);
  843. template <class T1, class T2, class Policy> typename tools::promote_args<T1, T2>::type hypergeometric_0F1(T1 b, T2 z, const Policy&);
  844. template <class T1, class T2, class T3> typename tools::promote_args<T1, T2, T3>::type hypergeometric_2F0(T1 a1, T2 a2, T3 z);
  845. template <class T1, class T2, class T3, class Policy> typename tools::promote_args<T1, T2, T3>::type hypergeometric_2F0(T1 a1, T2 a2, T3 z, const Policy&);
  846. template <class T1, class T2, class T3> typename tools::promote_args<T1, T2, T3>::type hypergeometric_1F1(T1 a, T2 b, T3 z);
  847. template <class T1, class T2, class T3, class Policy> typename tools::promote_args<T1, T2, T3>::type hypergeometric_1F1(T1 a, T2 b, T3 z, const Policy&);
  848. } // namespace math
  849. } // namespace boost
  850. #ifdef BOOST_HAS_LONG_LONG
  851. #define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
  852. \
  853. template <class T>\
  854. inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  855. \
  856. template <class T>\
  857. inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
  858. \
  859. template <class T>\
  860. inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
  861. #else
  862. #define BOOST_MATH_DETAIL_LL_FUNC(Policy)
  863. #endif
  864. #if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_HDR_ARRAY)
  865. # define BOOST_MATH_DETAIL_11_FUNC(Policy)\
  866. template <class T, class U, class V>\
  867. inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_1F1(const T& a, const U& b, const V& z)\
  868. { return boost::math::hypergeometric_1F1(a, b, z, Policy()); }\
  869. #else
  870. # define BOOST_MATH_DETAIL_11_FUNC(Policy)
  871. #endif
  872. #define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
  873. \
  874. BOOST_MATH_DETAIL_LL_FUNC(Policy)\
  875. BOOST_MATH_DETAIL_11_FUNC(Policy)\
  876. \
  877. template <class RT1, class RT2>\
  878. inline typename boost::math::tools::promote_args<RT1, RT2>::type \
  879. beta(RT1 a, RT2 b) { return ::boost::math::beta(a, b, Policy()); }\
  880. \
  881. template <class RT1, class RT2, class A>\
  882. inline typename boost::math::tools::promote_args<RT1, RT2, A>::type \
  883. beta(RT1 a, RT2 b, A x){ return ::boost::math::beta(a, b, x, Policy()); }\
  884. \
  885. template <class RT1, class RT2, class RT3>\
  886. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  887. betac(RT1 a, RT2 b, RT3 x) { return ::boost::math::betac(a, b, x, Policy()); }\
  888. \
  889. template <class RT1, class RT2, class RT3>\
  890. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  891. ibeta(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta(a, b, x, Policy()); }\
  892. \
  893. template <class RT1, class RT2, class RT3>\
  894. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  895. ibetac(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibetac(a, b, x, Policy()); }\
  896. \
  897. template <class T1, class T2, class T3, class T4>\
  898. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  899. ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::boost::math::ibeta_inv(a, b, p, py, Policy()); }\
  900. \
  901. template <class RT1, class RT2, class RT3>\
  902. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  903. ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inv(a, b, p, Policy()); }\
  904. \
  905. template <class T1, class T2, class T3, class T4>\
  906. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  907. ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::boost::math::ibetac_inv(a, b, q, py, Policy()); }\
  908. \
  909. template <class RT1, class RT2, class RT3>\
  910. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  911. ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inva(a, b, p, Policy()); }\
  912. \
  913. template <class T1, class T2, class T3>\
  914. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  915. ibetac_inva(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_inva(a, b, q, Policy()); }\
  916. \
  917. template <class RT1, class RT2, class RT3>\
  918. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  919. ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_invb(a, b, p, Policy()); }\
  920. \
  921. template <class T1, class T2, class T3>\
  922. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  923. ibetac_invb(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_invb(a, b, q, Policy()); }\
  924. \
  925. template <class RT1, class RT2, class RT3>\
  926. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  927. ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::boost::math::ibetac_inv(a, b, q, Policy()); }\
  928. \
  929. template <class RT1, class RT2, class RT3>\
  930. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  931. ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta_derivative(a, b, x, Policy()); }\
  932. \
  933. template <class T> T binomial_coefficient(unsigned n, unsigned k){ return ::boost::math::binomial_coefficient<T, Policy>(n, k, Policy()); }\
  934. \
  935. template <class RT>\
  936. inline typename boost::math::tools::promote_args<RT>::type erf(RT z) { return ::boost::math::erf(z, Policy()); }\
  937. \
  938. template <class RT>\
  939. inline typename boost::math::tools::promote_args<RT>::type erfc(RT z){ return ::boost::math::erfc(z, Policy()); }\
  940. \
  941. template <class RT>\
  942. inline typename boost::math::tools::promote_args<RT>::type erf_inv(RT z) { return ::boost::math::erf_inv(z, Policy()); }\
  943. \
  944. template <class RT>\
  945. inline typename boost::math::tools::promote_args<RT>::type erfc_inv(RT z){ return ::boost::math::erfc_inv(z, Policy()); }\
  946. \
  947. using boost::math::legendre_next;\
  948. \
  949. template <class T>\
  950. inline typename boost::math::tools::promote_args<T>::type \
  951. legendre_p(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\
  952. \
  953. template <class T>\
  954. inline typename boost::math::tools::promote_args<T>::type \
  955. legendre_p_prime(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\
  956. \
  957. template <class T>\
  958. inline typename boost::math::tools::promote_args<T>::type \
  959. legendre_q(unsigned l, T x){ return ::boost::math::legendre_q(l, x, Policy()); }\
  960. \
  961. using ::boost::math::legendre_next;\
  962. \
  963. template <class T>\
  964. inline typename boost::math::tools::promote_args<T>::type \
  965. legendre_p(int l, int m, T x){ return ::boost::math::legendre_p(l, m, x, Policy()); }\
  966. \
  967. using ::boost::math::laguerre_next;\
  968. \
  969. template <class T>\
  970. inline typename boost::math::tools::promote_args<T>::type \
  971. laguerre(unsigned n, T x){ return ::boost::math::laguerre(n, x, Policy()); }\
  972. \
  973. template <class T1, class T2>\
  974. inline typename boost::math::laguerre_result<T1, T2>::type \
  975. laguerre(unsigned n, T1 m, T2 x) { return ::boost::math::laguerre(n, m, x, Policy()); }\
  976. \
  977. template <class T>\
  978. inline typename boost::math::tools::promote_args<T>::type \
  979. hermite(unsigned n, T x){ return ::boost::math::hermite(n, x, Policy()); }\
  980. \
  981. using boost::math::hermite_next;\
  982. \
  983. using boost::math::chebyshev_next;\
  984. \
  985. template<class Real>\
  986. Real chebyshev_t(unsigned n, Real const & x){ return ::boost::math::chebyshev_t(n, x, Policy()); }\
  987. \
  988. template<class Real>\
  989. Real chebyshev_u(unsigned n, Real const & x){ return ::boost::math::chebyshev_u(n, x, Policy()); }\
  990. \
  991. template<class Real>\
  992. Real chebyshev_t_prime(unsigned n, Real const & x){ return ::boost::math::chebyshev_t_prime(n, x, Policy()); }\
  993. \
  994. using ::boost::math::chebyshev_clenshaw_recurrence;\
  995. \
  996. template <class T1, class T2>\
  997. inline std::complex<typename boost::math::tools::promote_args<T1, T2>::type> \
  998. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\
  999. \
  1000. template <class T1, class T2>\
  1001. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1002. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::boost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\
  1003. \
  1004. template <class T1, class T2>\
  1005. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1006. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\
  1007. \
  1008. template <class T1, class T2, class Policy>\
  1009. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1010. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\
  1011. \
  1012. template <class T1, class T2, class T3>\
  1013. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  1014. ellint_rf(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rf(x, y, z, Policy()); }\
  1015. \
  1016. template <class T1, class T2, class T3>\
  1017. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  1018. ellint_rd(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rd(x, y, z, Policy()); }\
  1019. \
  1020. template <class T1, class T2>\
  1021. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1022. ellint_rc(T1 x, T2 y){ return ::boost::math::ellint_rc(x, y, Policy()); }\
  1023. \
  1024. template <class T1, class T2, class T3, class T4>\
  1025. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  1026. ellint_rj(T1 x, T2 y, T3 z, T4 p){ return boost::math::ellint_rj(x, y, z, p, Policy()); }\
  1027. \
  1028. template <class T1, class T2, class T3>\
  1029. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  1030. ellint_rg(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rg(x, y, z, Policy()); }\
  1031. \
  1032. template <typename T>\
  1033. inline typename boost::math::tools::promote_args<T>::type ellint_2(T k){ return boost::math::ellint_2(k, Policy()); }\
  1034. \
  1035. template <class T1, class T2>\
  1036. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi){ return boost::math::ellint_2(k, phi, Policy()); }\
  1037. \
  1038. template <typename T>\
  1039. inline typename boost::math::tools::promote_args<T>::type ellint_d(T k){ return boost::math::ellint_d(k, Policy()); }\
  1040. \
  1041. template <class T1, class T2>\
  1042. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi){ return boost::math::ellint_d(k, phi, Policy()); }\
  1043. \
  1044. template <class T1, class T2>\
  1045. inline typename boost::math::tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi){ return boost::math::jacobi_zeta(k, phi, Policy()); }\
  1046. \
  1047. template <class T1, class T2>\
  1048. inline typename boost::math::tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi){ return boost::math::heuman_lambda(k, phi, Policy()); }\
  1049. \
  1050. template <typename T>\
  1051. inline typename boost::math::tools::promote_args<T>::type ellint_1(T k){ return boost::math::ellint_1(k, Policy()); }\
  1052. \
  1053. template <class T1, class T2>\
  1054. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi){ return boost::math::ellint_1(k, phi, Policy()); }\
  1055. \
  1056. template <class T1, class T2, class T3>\
  1057. inline typename boost::math::tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi){ return boost::math::ellint_3(k, v, phi, Policy()); }\
  1058. \
  1059. template <class T1, class T2>\
  1060. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v){ return boost::math::ellint_3(k, v, Policy()); }\
  1061. \
  1062. using boost::math::max_factorial;\
  1063. template <class RT>\
  1064. inline RT factorial(unsigned int i) { return boost::math::factorial<RT>(i, Policy()); }\
  1065. using boost::math::unchecked_factorial;\
  1066. template <class RT>\
  1067. inline RT double_factorial(unsigned i){ return boost::math::double_factorial<RT>(i, Policy()); }\
  1068. template <class RT>\
  1069. inline typename boost::math::tools::promote_args<RT>::type falling_factorial(RT x, unsigned n){ return boost::math::falling_factorial(x, n, Policy()); }\
  1070. template <class RT>\
  1071. inline typename boost::math::tools::promote_args<RT>::type rising_factorial(RT x, unsigned n){ return boost::math::rising_factorial(x, n, Policy()); }\
  1072. \
  1073. template <class RT>\
  1074. inline typename boost::math::tools::promote_args<RT>::type tgamma(RT z){ return boost::math::tgamma(z, Policy()); }\
  1075. \
  1076. template <class RT>\
  1077. inline typename boost::math::tools::promote_args<RT>::type tgamma1pm1(RT z){ return boost::math::tgamma1pm1(z, Policy()); }\
  1078. \
  1079. template <class RT1, class RT2>\
  1080. inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z){ return boost::math::tgamma(a, z, Policy()); }\
  1081. \
  1082. template <class RT>\
  1083. inline typename boost::math::tools::promote_args<RT>::type lgamma(RT z, int* sign){ return boost::math::lgamma(z, sign, Policy()); }\
  1084. \
  1085. template <class RT>\
  1086. inline typename boost::math::tools::promote_args<RT>::type lgamma(RT x){ return boost::math::lgamma(x, Policy()); }\
  1087. \
  1088. template <class RT1, class RT2>\
  1089. inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z){ return boost::math::tgamma_lower(a, z, Policy()); }\
  1090. \
  1091. template <class RT1, class RT2>\
  1092. inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z){ return boost::math::gamma_q(a, z, Policy()); }\
  1093. \
  1094. template <class RT1, class RT2>\
  1095. inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z){ return boost::math::gamma_p(a, z, Policy()); }\
  1096. \
  1097. template <class T1, class T2>\
  1098. inline typename boost::math::tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta){ return boost::math::tgamma_delta_ratio(z, delta, Policy()); }\
  1099. \
  1100. template <class T1, class T2>\
  1101. inline typename boost::math::tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b) { return boost::math::tgamma_ratio(a, b, Policy()); }\
  1102. \
  1103. template <class T1, class T2>\
  1104. inline typename boost::math::tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x){ return boost::math::gamma_p_derivative(a, x, Policy()); }\
  1105. \
  1106. template <class T1, class T2>\
  1107. inline typename boost::math::tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p){ return boost::math::gamma_p_inv(a, p, Policy()); }\
  1108. \
  1109. template <class T1, class T2>\
  1110. inline typename boost::math::tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p){ return boost::math::gamma_p_inva(a, p, Policy()); }\
  1111. \
  1112. template <class T1, class T2>\
  1113. inline typename boost::math::tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q){ return boost::math::gamma_q_inv(a, q, Policy()); }\
  1114. \
  1115. template <class T1, class T2>\
  1116. inline typename boost::math::tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q){ return boost::math::gamma_q_inva(a, q, Policy()); }\
  1117. \
  1118. template <class T>\
  1119. inline typename boost::math::tools::promote_args<T>::type digamma(T x){ return boost::math::digamma(x, Policy()); }\
  1120. \
  1121. template <class T>\
  1122. inline typename boost::math::tools::promote_args<T>::type trigamma(T x){ return boost::math::trigamma(x, Policy()); }\
  1123. \
  1124. template <class T>\
  1125. inline typename boost::math::tools::promote_args<T>::type polygamma(int n, T x){ return boost::math::polygamma(n, x, Policy()); }\
  1126. \
  1127. template <class T1, class T2>\
  1128. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1129. hypot(T1 x, T2 y){ return boost::math::hypot(x, y, Policy()); }\
  1130. \
  1131. template <class RT>\
  1132. inline typename boost::math::tools::promote_args<RT>::type cbrt(RT z){ return boost::math::cbrt(z, Policy()); }\
  1133. \
  1134. template <class T>\
  1135. inline typename boost::math::tools::promote_args<T>::type log1p(T x){ return boost::math::log1p(x, Policy()); }\
  1136. \
  1137. template <class T>\
  1138. inline typename boost::math::tools::promote_args<T>::type log1pmx(T x){ return boost::math::log1pmx(x, Policy()); }\
  1139. \
  1140. template <class T>\
  1141. inline typename boost::math::tools::promote_args<T>::type expm1(T x){ return boost::math::expm1(x, Policy()); }\
  1142. \
  1143. template <class T1, class T2>\
  1144. inline typename boost::math::tools::promote_args<T1, T2>::type \
  1145. powm1(const T1 a, const T2 z){ return boost::math::powm1(a, z, Policy()); }\
  1146. \
  1147. template <class T>\
  1148. inline typename boost::math::tools::promote_args<T>::type sqrt1pm1(const T& val){ return boost::math::sqrt1pm1(val, Policy()); }\
  1149. \
  1150. template <class T>\
  1151. inline typename boost::math::tools::promote_args<T>::type sinc_pi(T x){ return boost::math::sinc_pi(x, Policy()); }\
  1152. \
  1153. template <class T>\
  1154. inline typename boost::math::tools::promote_args<T>::type sinhc_pi(T x){ return boost::math::sinhc_pi(x, Policy()); }\
  1155. \
  1156. template<typename T>\
  1157. inline typename boost::math::tools::promote_args<T>::type asinh(const T x){ return boost::math::asinh(x, Policy()); }\
  1158. \
  1159. template<typename T>\
  1160. inline typename boost::math::tools::promote_args<T>::type acosh(const T x){ return boost::math::acosh(x, Policy()); }\
  1161. \
  1162. template<typename T>\
  1163. inline typename boost::math::tools::promote_args<T>::type atanh(const T x){ return boost::math::atanh(x, Policy()); }\
  1164. \
  1165. template <class T1, class T2>\
  1166. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j(T1 v, T2 x)\
  1167. { return boost::math::cyl_bessel_j(v, x, Policy()); }\
  1168. \
  1169. template <class T1, class T2>\
  1170. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j_prime(T1 v, T2 x)\
  1171. { return boost::math::cyl_bessel_j_prime(v, x, Policy()); }\
  1172. \
  1173. template <class T>\
  1174. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel(unsigned v, T x)\
  1175. { return boost::math::sph_bessel(v, x, Policy()); }\
  1176. \
  1177. template <class T>\
  1178. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel_prime(unsigned v, T x)\
  1179. { return boost::math::sph_bessel_prime(v, x, Policy()); }\
  1180. \
  1181. template <class T1, class T2>\
  1182. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1183. cyl_bessel_i(T1 v, T2 x) { return boost::math::cyl_bessel_i(v, x, Policy()); }\
  1184. \
  1185. template <class T1, class T2>\
  1186. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1187. cyl_bessel_i_prime(T1 v, T2 x) { return boost::math::cyl_bessel_i_prime(v, x, Policy()); }\
  1188. \
  1189. template <class T1, class T2>\
  1190. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1191. cyl_bessel_k(T1 v, T2 x) { return boost::math::cyl_bessel_k(v, x, Policy()); }\
  1192. \
  1193. template <class T1, class T2>\
  1194. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1195. cyl_bessel_k_prime(T1 v, T2 x) { return boost::math::cyl_bessel_k_prime(v, x, Policy()); }\
  1196. \
  1197. template <class T1, class T2>\
  1198. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1199. cyl_neumann(T1 v, T2 x){ return boost::math::cyl_neumann(v, x, Policy()); }\
  1200. \
  1201. template <class T1, class T2>\
  1202. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  1203. cyl_neumann_prime(T1 v, T2 x){ return boost::math::cyl_neumann_prime(v, x, Policy()); }\
  1204. \
  1205. template <class T>\
  1206. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type \
  1207. sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\
  1208. \
  1209. template <class T>\
  1210. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type \
  1211. sph_neumann_prime(unsigned v, T x){ return boost::math::sph_neumann_prime(v, x, Policy()); }\
  1212. \
  1213. template <class T>\
  1214. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
  1215. { return boost::math::cyl_bessel_j_zero(v, m, Policy()); }\
  1216. \
  1217. template <class OutputIterator, class T>\
  1218. inline void cyl_bessel_j_zero(T v,\
  1219. int start_index,\
  1220. unsigned number_of_zeros,\
  1221. OutputIterator out_it)\
  1222. { boost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
  1223. \
  1224. template <class T>\
  1225. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
  1226. { return boost::math::cyl_neumann_zero(v, m, Policy()); }\
  1227. \
  1228. template <class OutputIterator, class T>\
  1229. inline void cyl_neumann_zero(T v,\
  1230. int start_index,\
  1231. unsigned number_of_zeros,\
  1232. OutputIterator out_it)\
  1233. { boost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
  1234. \
  1235. template <class T>\
  1236. inline typename boost::math::tools::promote_args<T>::type sin_pi(T x){ return boost::math::sin_pi(x); }\
  1237. \
  1238. template <class T>\
  1239. inline typename boost::math::tools::promote_args<T>::type cos_pi(T x){ return boost::math::cos_pi(x); }\
  1240. \
  1241. using boost::math::fpclassify;\
  1242. using boost::math::isfinite;\
  1243. using boost::math::isinf;\
  1244. using boost::math::isnan;\
  1245. using boost::math::isnormal;\
  1246. using boost::math::signbit;\
  1247. using boost::math::sign;\
  1248. using boost::math::copysign;\
  1249. using boost::math::changesign;\
  1250. \
  1251. template <class T, class U>\
  1252. inline typename boost::math::tools::promote_args<T,U>::type expint(T const& z, U const& u)\
  1253. { return boost::math::expint(z, u, Policy()); }\
  1254. \
  1255. template <class T>\
  1256. inline typename boost::math::tools::promote_args<T>::type expint(T z){ return boost::math::expint(z, Policy()); }\
  1257. \
  1258. template <class T>\
  1259. inline typename boost::math::tools::promote_args<T>::type zeta(T s){ return boost::math::zeta(s, Policy()); }\
  1260. \
  1261. template <class T>\
  1262. inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\
  1263. \
  1264. template <class T>\
  1265. inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\
  1266. \
  1267. template <class T>\
  1268. inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\
  1269. \
  1270. template <class T>\
  1271. inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\
  1272. \
  1273. template <class T>\
  1274. inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\
  1275. \
  1276. template <class T>\
  1277. inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\
  1278. \
  1279. template <class T>\
  1280. inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1281. \
  1282. template <class T>\
  1283. inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1284. \
  1285. template <class T>\
  1286. inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1287. \
  1288. template <int N, class T>\
  1289. inline typename boost::math::tools::promote_args<T>::type pow(T v){ return boost::math::pow<N>(v, Policy()); }\
  1290. \
  1291. template <class T> T nextafter(const T& a, const T& b){ return boost::math::nextafter(a, b, Policy()); }\
  1292. template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
  1293. template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
  1294. template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
  1295. template <class T> T ulp(const T& a){ return boost::math::ulp(a, Policy()); }\
  1296. \
  1297. template <class RT1, class RT2>\
  1298. inline typename boost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return boost::math::owens_t(a, z, Policy()); }\
  1299. \
  1300. template <class T1, class T2>\
  1301. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
  1302. { return boost::math::cyl_hankel_1(v, x, Policy()); }\
  1303. \
  1304. template <class T1, class T2>\
  1305. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
  1306. { return boost::math::cyl_hankel_2(v, x, Policy()); }\
  1307. \
  1308. template <class T1, class T2>\
  1309. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
  1310. { return boost::math::sph_hankel_1(v, x, Policy()); }\
  1311. \
  1312. template <class T1, class T2>\
  1313. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
  1314. { return boost::math::sph_hankel_2(v, x, Policy()); }\
  1315. \
  1316. template <class T>\
  1317. inline typename boost::math::tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)\
  1318. { return boost::math::jacobi_elliptic(k, theta, pcn, pdn, Policy()); }\
  1319. \
  1320. template <class U, class T>\
  1321. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sn(U k, T theta)\
  1322. { return boost::math::jacobi_sn(k, theta, Policy()); }\
  1323. \
  1324. template <class T, class U>\
  1325. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cn(T k, U theta)\
  1326. { return boost::math::jacobi_cn(k, theta, Policy()); }\
  1327. \
  1328. template <class T, class U>\
  1329. inline typename boost::math::tools::promote_args<T, U>::type jacobi_dn(T k, U theta)\
  1330. { return boost::math::jacobi_dn(k, theta, Policy()); }\
  1331. \
  1332. template <class T, class U>\
  1333. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cd(T k, U theta)\
  1334. { return boost::math::jacobi_cd(k, theta, Policy()); }\
  1335. \
  1336. template <class T, class U>\
  1337. inline typename boost::math::tools::promote_args<T, U>::type jacobi_dc(T k, U theta)\
  1338. { return boost::math::jacobi_dc(k, theta, Policy()); }\
  1339. \
  1340. template <class T, class U>\
  1341. inline typename boost::math::tools::promote_args<T, U>::type jacobi_ns(T k, U theta)\
  1342. { return boost::math::jacobi_ns(k, theta, Policy()); }\
  1343. \
  1344. template <class T, class U>\
  1345. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sd(T k, U theta)\
  1346. { return boost::math::jacobi_sd(k, theta, Policy()); }\
  1347. \
  1348. template <class T, class U>\
  1349. inline typename boost::math::tools::promote_args<T, U>::type jacobi_ds(T k, U theta)\
  1350. { return boost::math::jacobi_ds(k, theta, Policy()); }\
  1351. \
  1352. template <class T, class U>\
  1353. inline typename boost::math::tools::promote_args<T, U>::type jacobi_nc(T k, U theta)\
  1354. { return boost::math::jacobi_nc(k, theta, Policy()); }\
  1355. \
  1356. template <class T, class U>\
  1357. inline typename boost::math::tools::promote_args<T, U>::type jacobi_nd(T k, U theta)\
  1358. { return boost::math::jacobi_nd(k, theta, Policy()); }\
  1359. \
  1360. template <class T, class U>\
  1361. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sc(T k, U theta)\
  1362. { return boost::math::jacobi_sc(k, theta, Policy()); }\
  1363. \
  1364. template <class T, class U>\
  1365. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cs(T k, U theta)\
  1366. { return boost::math::jacobi_cs(k, theta, Policy()); }\
  1367. \
  1368. template <class T>\
  1369. inline typename boost::math::tools::promote_args<T>::type airy_ai(T x)\
  1370. { return boost::math::airy_ai(x, Policy()); }\
  1371. \
  1372. template <class T>\
  1373. inline typename boost::math::tools::promote_args<T>::type airy_bi(T x)\
  1374. { return boost::math::airy_bi(x, Policy()); }\
  1375. \
  1376. template <class T>\
  1377. inline typename boost::math::tools::promote_args<T>::type airy_ai_prime(T x)\
  1378. { return boost::math::airy_ai_prime(x, Policy()); }\
  1379. \
  1380. template <class T>\
  1381. inline typename boost::math::tools::promote_args<T>::type airy_bi_prime(T x)\
  1382. { return boost::math::airy_bi_prime(x, Policy()); }\
  1383. \
  1384. template <class T>\
  1385. inline T airy_ai_zero(int m)\
  1386. { return boost::math::airy_ai_zero<T>(m, Policy()); }\
  1387. template <class T, class OutputIterator>\
  1388. OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
  1389. { return boost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
  1390. \
  1391. template <class T>\
  1392. inline T airy_bi_zero(int m)\
  1393. { return boost::math::airy_bi_zero<T>(m, Policy()); }\
  1394. template <class T, class OutputIterator>\
  1395. OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
  1396. { return boost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
  1397. \
  1398. template <class T>\
  1399. T bernoulli_b2n(const int i)\
  1400. { return boost::math::bernoulli_b2n<T>(i, Policy()); }\
  1401. template <class T, class OutputIterator>\
  1402. OutputIterator bernoulli_b2n(int start_index, unsigned number_of_bernoullis_b2n, OutputIterator out_it)\
  1403. { return boost::math::bernoulli_b2n<T>(start_index, number_of_bernoullis_b2n, out_it, Policy()); }\
  1404. \
  1405. template <class T>\
  1406. T tangent_t2n(const int i)\
  1407. { return boost::math::tangent_t2n<T>(i, Policy()); }\
  1408. template <class T, class OutputIterator>\
  1409. OutputIterator tangent_t2n(int start_index, unsigned number_of_bernoullis_b2n, OutputIterator out_it)\
  1410. { return boost::math::tangent_t2n<T>(start_index, number_of_bernoullis_b2n, out_it, Policy()); }\
  1411. \
  1412. template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_w0(T z) { return boost::math::lambert_w0(z, Policy()); }\
  1413. template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_wm1(T z) { return boost::math::lambert_w0(z, Policy()); }\
  1414. template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_w0_prime(T z) { return boost::math::lambert_w0(z, Policy()); }\
  1415. template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_wm1_prime(T z) { return boost::math::lambert_w0(z, Policy()); }\
  1416. \
  1417. template <class T, class U>\
  1418. inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_1F0(const T& a, const U& z)\
  1419. { return boost::math::hypergeometric_1F0(a, z, Policy()); }\
  1420. \
  1421. template <class T, class U>\
  1422. inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_0F1(const T& a, const U& z)\
  1423. { return boost::math::hypergeometric_0F1(a, z, Policy()); }\
  1424. \
  1425. template <class T, class U, class V>\
  1426. inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_2F0(const T& a1, const U& a2, const V& z)\
  1427. { return boost::math::hypergeometric_2F0(a1, a2, z, Policy()); }\
  1428. \
  1429. #endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP