math_fwd.hpp 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  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 <boost/math/special_functions/detail/round_fwd.hpp>
  19. #include <boost/math/tools/promotion.hpp> // for argument promotion.
  20. #include <boost/math/policies/policy.hpp>
  21. #include <boost/mpl/comparison.hpp>
  22. #include <boost/config/no_tr1/complex.hpp>
  23. #define BOOST_NO_MACRO_EXPAND /**/
  24. namespace boost
  25. {
  26. namespace math
  27. { // Math functions (in roughly alphabetic order).
  28. // Beta functions.
  29. template <class RT1, class RT2>
  30. typename tools::promote_args<RT1, RT2>::type
  31. beta(RT1 a, RT2 b); // Beta function (2 arguments).
  32. template <class RT1, class RT2, class A>
  33. typename tools::promote_args<RT1, RT2, A>::type
  34. beta(RT1 a, RT2 b, A x); // Beta function (3 arguments).
  35. template <class RT1, class RT2, class RT3, class Policy>
  36. typename tools::promote_args<RT1, RT2, RT3>::type
  37. beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments).
  38. template <class RT1, class RT2, class RT3>
  39. typename tools::promote_args<RT1, RT2, RT3>::type
  40. betac(RT1 a, RT2 b, RT3 x);
  41. template <class RT1, class RT2, class RT3, class Policy>
  42. typename tools::promote_args<RT1, RT2, RT3>::type
  43. betac(RT1 a, RT2 b, RT3 x, const Policy& pol);
  44. template <class RT1, class RT2, class RT3>
  45. typename tools::promote_args<RT1, RT2, RT3>::type
  46. ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function.
  47. template <class RT1, class RT2, class RT3, class Policy>
  48. typename tools::promote_args<RT1, RT2, RT3>::type
  49. ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function.
  50. template <class RT1, class RT2, class RT3>
  51. typename tools::promote_args<RT1, RT2, RT3>::type
  52. ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function.
  53. template <class RT1, class RT2, class RT3, class Policy>
  54. typename tools::promote_args<RT1, RT2, RT3>::type
  55. ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function.
  56. template <class T1, class T2, class T3, class T4>
  57. typename tools::promote_args<T1, T2, T3, T4>::type
  58. ibeta_inv(T1 a, T2 b, T3 p, T4* py);
  59. template <class T1, class T2, class T3, class T4, class Policy>
  60. typename tools::promote_args<T1, T2, T3, T4>::type
  61. ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol);
  62. template <class RT1, class RT2, class RT3>
  63. typename tools::promote_args<RT1, RT2, RT3>::type
  64. ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  65. template <class RT1, class RT2, class RT3, class Policy>
  66. typename tools::promote_args<RT1, RT2, RT3>::type
  67. ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  68. template <class RT1, class RT2, class RT3>
  69. typename tools::promote_args<RT1, RT2, RT3>::type
  70. ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  71. template <class RT1, class RT2, class RT3, class Policy>
  72. typename tools::promote_args<RT1, RT2, RT3>::type
  73. ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  74. template <class RT1, class RT2, class RT3>
  75. typename tools::promote_args<RT1, RT2, RT3>::type
  76. ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
  77. template <class RT1, class RT2, class RT3, class Policy>
  78. typename tools::promote_args<RT1, RT2, RT3>::type
  79. ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
  80. template <class T1, class T2, class T3, class T4>
  81. typename tools::promote_args<T1, T2, T3, T4>::type
  82. ibetac_inv(T1 a, T2 b, T3 q, T4* py);
  83. template <class T1, class T2, class T3, class T4, class Policy>
  84. typename tools::promote_args<T1, T2, T3, T4>::type
  85. ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol);
  86. template <class RT1, class RT2, class RT3>
  87. typename tools::promote_args<RT1, RT2, RT3>::type
  88. ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  89. template <class RT1, class RT2, class RT3, class Policy>
  90. typename tools::promote_args<RT1, RT2, RT3>::type
  91. ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  92. template <class RT1, class RT2, class RT3>
  93. typename tools::promote_args<RT1, RT2, RT3>::type
  94. ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  95. template <class RT1, class RT2, class RT3, class Policy>
  96. typename tools::promote_args<RT1, RT2, RT3>::type
  97. ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  98. template <class RT1, class RT2, class RT3>
  99. typename tools::promote_args<RT1, RT2, RT3>::type
  100. ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
  101. template <class RT1, class RT2, class RT3, class Policy>
  102. typename tools::promote_args<RT1, RT2, RT3>::type
  103. ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
  104. template <class RT1, class RT2, class RT3>
  105. typename tools::promote_args<RT1, RT2, RT3>::type
  106. ibeta_derivative(RT1 a, RT2 b, RT3 x); // derivative of incomplete beta
  107. template <class RT1, class RT2, class RT3, class Policy>
  108. typename tools::promote_args<RT1, RT2, RT3>::type
  109. ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol); // derivative of incomplete beta
  110. // erf & erfc error functions.
  111. template <class RT> // Error function.
  112. typename tools::promote_args<RT>::type erf(RT z);
  113. template <class RT, class Policy> // Error function.
  114. typename tools::promote_args<RT>::type erf(RT z, const Policy&);
  115. template <class RT>// Error function complement.
  116. typename tools::promote_args<RT>::type erfc(RT z);
  117. template <class RT, class Policy>// Error function complement.
  118. typename tools::promote_args<RT>::type erfc(RT z, const Policy&);
  119. template <class RT>// Error function inverse.
  120. typename tools::promote_args<RT>::type erf_inv(RT z);
  121. template <class RT, class Policy>// Error function inverse.
  122. typename tools::promote_args<RT>::type erf_inv(RT z, const Policy& pol);
  123. template <class RT>// Error function complement inverse.
  124. typename tools::promote_args<RT>::type erfc_inv(RT z);
  125. template <class RT, class Policy>// Error function complement inverse.
  126. typename tools::promote_args<RT>::type erfc_inv(RT z, const Policy& pol);
  127. // Polynomials:
  128. template <class T1, class T2, class T3>
  129. typename tools::promote_args<T1, T2, T3>::type
  130. legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1);
  131. template <class T>
  132. typename tools::promote_args<T>::type
  133. legendre_p(int l, T x);
  134. template <class T, class Policy>
  135. typename tools::promote_args<T>::type
  136. legendre_p(int l, T x, const Policy& pol);
  137. template <class T>
  138. typename tools::promote_args<T>::type
  139. legendre_q(unsigned l, T x);
  140. template <class T, class Policy>
  141. typename tools::promote_args<T>::type
  142. legendre_q(unsigned l, T x, const Policy& pol);
  143. template <class T1, class T2, class T3>
  144. typename tools::promote_args<T1, T2, T3>::type
  145. legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
  146. template <class T>
  147. typename tools::promote_args<T>::type
  148. legendre_p(int l, int m, T x);
  149. template <class T, class Policy>
  150. typename tools::promote_args<T>::type
  151. legendre_p(int l, int m, T x, const Policy& pol);
  152. template <class T1, class T2, class T3>
  153. typename tools::promote_args<T1, T2, T3>::type
  154. laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1);
  155. template <class T1, class T2, class T3>
  156. typename tools::promote_args<T1, T2, T3>::type
  157. laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1);
  158. template <class T>
  159. typename tools::promote_args<T>::type
  160. laguerre(unsigned n, T x);
  161. template <class T, class Policy>
  162. typename tools::promote_args<T>::type
  163. laguerre(unsigned n, unsigned m, T x, const Policy& pol);
  164. template <class T1, class T2>
  165. struct laguerre_result
  166. {
  167. typedef typename mpl::if_<
  168. policies::is_policy<T2>,
  169. typename tools::promote_args<T1>::type,
  170. typename tools::promote_args<T2>::type
  171. >::type type;
  172. };
  173. template <class T1, class T2>
  174. typename laguerre_result<T1, T2>::type
  175. laguerre(unsigned n, T1 m, T2 x);
  176. template <class T>
  177. typename tools::promote_args<T>::type
  178. hermite(unsigned n, T x);
  179. template <class T, class Policy>
  180. typename tools::promote_args<T>::type
  181. hermite(unsigned n, T x, const Policy& pol);
  182. template <class T1, class T2, class T3>
  183. typename tools::promote_args<T1, T2, T3>::type
  184. hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
  185. template <class T1, class T2>
  186. std::complex<typename tools::promote_args<T1, T2>::type>
  187. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi);
  188. template <class T1, class T2, class Policy>
  189. std::complex<typename tools::promote_args<T1, T2>::type>
  190. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  191. template <class T1, class T2>
  192. typename tools::promote_args<T1, T2>::type
  193. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi);
  194. template <class T1, class T2, class Policy>
  195. typename tools::promote_args<T1, T2>::type
  196. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  197. template <class T1, class T2>
  198. typename tools::promote_args<T1, T2>::type
  199. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi);
  200. template <class T1, class T2, class Policy>
  201. typename tools::promote_args<T1, T2>::type
  202. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
  203. // Elliptic integrals:
  204. template <class T1, class T2, class T3>
  205. typename tools::promote_args<T1, T2, T3>::type
  206. ellint_rf(T1 x, T2 y, T3 z);
  207. template <class T1, class T2, class T3, class Policy>
  208. typename tools::promote_args<T1, T2, T3>::type
  209. ellint_rf(T1 x, T2 y, T3 z, const Policy& pol);
  210. template <class T1, class T2, class T3>
  211. typename tools::promote_args<T1, T2, T3>::type
  212. ellint_rd(T1 x, T2 y, T3 z);
  213. template <class T1, class T2, class T3, class Policy>
  214. typename tools::promote_args<T1, T2, T3>::type
  215. ellint_rd(T1 x, T2 y, T3 z, const Policy& pol);
  216. template <class T1, class T2>
  217. typename tools::promote_args<T1, T2>::type
  218. ellint_rc(T1 x, T2 y);
  219. template <class T1, class T2, class Policy>
  220. typename tools::promote_args<T1, T2>::type
  221. ellint_rc(T1 x, T2 y, const Policy& pol);
  222. template <class T1, class T2, class T3, class T4>
  223. typename tools::promote_args<T1, T2, T3, T4>::type
  224. ellint_rj(T1 x, T2 y, T3 z, T4 p);
  225. template <class T1, class T2, class T3, class T4, class Policy>
  226. typename tools::promote_args<T1, T2, T3, T4>::type
  227. ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol);
  228. template <typename T>
  229. typename tools::promote_args<T>::type ellint_2(T k);
  230. template <class T1, class T2>
  231. typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi);
  232. template <class T1, class T2, class Policy>
  233. typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi, const Policy& pol);
  234. template <typename T>
  235. typename tools::promote_args<T>::type ellint_1(T k);
  236. template <class T1, class T2>
  237. typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi);
  238. template <class T1, class T2, class Policy>
  239. typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy& pol);
  240. namespace detail{
  241. template <class T, class U, class V>
  242. struct ellint_3_result
  243. {
  244. typedef typename mpl::if_<
  245. policies::is_policy<V>,
  246. typename tools::promote_args<T, U>::type,
  247. typename tools::promote_args<T, U, V>::type
  248. >::type type;
  249. };
  250. } // namespace detail
  251. template <class T1, class T2, class T3>
  252. typename detail::ellint_3_result<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi);
  253. template <class T1, class T2, class T3, class Policy>
  254. typename tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol);
  255. template <class T1, class T2>
  256. typename tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v);
  257. // Factorial functions.
  258. // Note: not for integral types, at present.
  259. template <class RT>
  260. struct max_factorial;
  261. template <class RT>
  262. RT factorial(unsigned int);
  263. template <class RT, class Policy>
  264. RT factorial(unsigned int, const Policy& pol);
  265. template <class RT>
  266. RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT));
  267. template <class RT>
  268. RT double_factorial(unsigned i);
  269. template <class RT, class Policy>
  270. RT double_factorial(unsigned i, const Policy& pol);
  271. template <class RT>
  272. typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n);
  273. template <class RT, class Policy>
  274. typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
  275. template <class RT>
  276. typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
  277. template <class RT, class Policy>
  278. typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
  279. // Gamma functions.
  280. template <class RT>
  281. typename tools::promote_args<RT>::type tgamma(RT z);
  282. template <class RT>
  283. typename tools::promote_args<RT>::type tgamma1pm1(RT z);
  284. template <class RT, class Policy>
  285. typename tools::promote_args<RT>::type tgamma1pm1(RT z, const Policy& pol);
  286. template <class RT1, class RT2>
  287. typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z);
  288. template <class RT1, class RT2, class Policy>
  289. typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z, const Policy& pol);
  290. template <class RT>
  291. typename tools::promote_args<RT>::type lgamma(RT z, int* sign);
  292. template <class RT, class Policy>
  293. typename tools::promote_args<RT>::type lgamma(RT z, int* sign, const Policy& pol);
  294. template <class RT>
  295. typename tools::promote_args<RT>::type lgamma(RT x);
  296. template <class RT, class Policy>
  297. typename tools::promote_args<RT>::type lgamma(RT x, const Policy& pol);
  298. template <class RT1, class RT2>
  299. typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z);
  300. template <class RT1, class RT2, class Policy>
  301. typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z, const Policy&);
  302. template <class RT1, class RT2>
  303. typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z);
  304. template <class RT1, class RT2, class Policy>
  305. typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z, const Policy&);
  306. template <class RT1, class RT2>
  307. typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z);
  308. template <class RT1, class RT2, class Policy>
  309. typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z, const Policy&);
  310. template <class T1, class T2>
  311. typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta);
  312. template <class T1, class T2, class Policy>
  313. typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&);
  314. template <class T1, class T2>
  315. typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b);
  316. template <class T1, class T2, class Policy>
  317. typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b, const Policy&);
  318. template <class T1, class T2>
  319. typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x);
  320. template <class T1, class T2, class Policy>
  321. typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x, const Policy&);
  322. // gamma inverse.
  323. template <class T1, class T2>
  324. typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p);
  325. template <class T1, class T2, class Policy>
  326. typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p, const Policy&);
  327. template <class T1, class T2>
  328. typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p);
  329. template <class T1, class T2, class Policy>
  330. typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p, const Policy&);
  331. template <class T1, class T2>
  332. typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q);
  333. template <class T1, class T2, class Policy>
  334. typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q, const Policy&);
  335. template <class T1, class T2>
  336. typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q);
  337. template <class T1, class T2, class Policy>
  338. typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q, const Policy&);
  339. // digamma:
  340. template <class T>
  341. typename tools::promote_args<T>::type digamma(T x);
  342. template <class T, class Policy>
  343. typename tools::promote_args<T>::type digamma(T x, const Policy&);
  344. // Hypotenuse function sqrt(x ^ 2 + y ^ 2).
  345. template <class T1, class T2>
  346. typename tools::promote_args<T1, T2>::type
  347. hypot(T1 x, T2 y);
  348. template <class T1, class T2, class Policy>
  349. typename tools::promote_args<T1, T2>::type
  350. hypot(T1 x, T2 y, const Policy&);
  351. // cbrt - cube root.
  352. template <class RT>
  353. typename tools::promote_args<RT>::type cbrt(RT z);
  354. template <class RT, class Policy>
  355. typename tools::promote_args<RT>::type cbrt(RT z, const Policy&);
  356. // log1p is log(x + 1)
  357. template <class T>
  358. typename tools::promote_args<T>::type log1p(T);
  359. template <class T, class Policy>
  360. typename tools::promote_args<T>::type log1p(T, const Policy&);
  361. // log1pmx is log(x + 1) - x
  362. template <class T>
  363. typename tools::promote_args<T>::type log1pmx(T);
  364. template <class T, class Policy>
  365. typename tools::promote_args<T>::type log1pmx(T, const Policy&);
  366. // Exp (x) minus 1 functions.
  367. template <class T>
  368. typename tools::promote_args<T>::type expm1(T);
  369. template <class T, class Policy>
  370. typename tools::promote_args<T>::type expm1(T, const Policy&);
  371. // Power - 1
  372. template <class T1, class T2>
  373. typename tools::promote_args<T1, T2>::type
  374. powm1(const T1 a, const T2 z);
  375. template <class T1, class T2, class Policy>
  376. typename tools::promote_args<T1, T2>::type
  377. powm1(const T1 a, const T2 z, const Policy&);
  378. // sqrt(1+x) - 1
  379. template <class T>
  380. typename tools::promote_args<T>::type sqrt1pm1(const T& val);
  381. template <class T, class Policy>
  382. typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy&);
  383. // sinus cardinals:
  384. template <class T>
  385. typename tools::promote_args<T>::type sinc_pi(T x);
  386. template <class T, class Policy>
  387. typename tools::promote_args<T>::type sinc_pi(T x, const Policy&);
  388. template <class T>
  389. typename tools::promote_args<T>::type sinhc_pi(T x);
  390. template <class T, class Policy>
  391. typename tools::promote_args<T>::type sinhc_pi(T x, const Policy&);
  392. // inverse hyperbolics:
  393. template<typename T>
  394. typename tools::promote_args<T>::type asinh(T x);
  395. template<typename T, class Policy>
  396. typename tools::promote_args<T>::type asinh(T x, const Policy&);
  397. template<typename T>
  398. typename tools::promote_args<T>::type acosh(T x);
  399. template<typename T, class Policy>
  400. typename tools::promote_args<T>::type acosh(T x, const Policy&);
  401. template<typename T>
  402. typename tools::promote_args<T>::type atanh(T x);
  403. template<typename T, class Policy>
  404. typename tools::promote_args<T>::type atanh(T x, const Policy&);
  405. namespace detail{
  406. typedef mpl::int_<0> bessel_no_int_tag; // No integer optimisation possible.
  407. typedef mpl::int_<1> bessel_maybe_int_tag; // Maybe integer optimisation.
  408. typedef mpl::int_<2> bessel_int_tag; // Definite integer optimistaion.
  409. template <class T1, class T2, class Policy>
  410. struct bessel_traits
  411. {
  412. typedef typename tools::promote_args<
  413. T1, T2
  414. >::type result_type;
  415. typedef typename policies::precision<result_type, Policy>::type precision_type;
  416. typedef typename mpl::if_<
  417. mpl::or_<
  418. mpl::less_equal<precision_type, mpl::int_<0> >,
  419. mpl::greater<precision_type, mpl::int_<64> > >,
  420. bessel_no_int_tag,
  421. typename mpl::if_<
  422. is_integral<T1>,
  423. bessel_int_tag,
  424. bessel_maybe_int_tag
  425. >::type
  426. >::type optimisation_tag;
  427. };
  428. } // detail
  429. // Bessel functions:
  430. template <class T1, class T2, class Policy>
  431. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol);
  432. template <class T1, class T2>
  433. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j(T1 v, T2 x);
  434. template <class T, class Policy>
  435. typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel(unsigned v, T x, const Policy& pol);
  436. template <class T>
  437. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel(unsigned v, T x);
  438. template <class T1, class T2, class Policy>
  439. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol);
  440. template <class T1, class T2>
  441. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i(T1 v, T2 x);
  442. template <class T1, class T2, class Policy>
  443. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol);
  444. template <class T1, class T2>
  445. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k(T1 v, T2 x);
  446. template <class T1, class T2, class Policy>
  447. typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann(T1 v, T2 x, const Policy& pol);
  448. template <class T1, class T2>
  449. typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann(T1 v, T2 x);
  450. template <class T, class Policy>
  451. typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann(unsigned v, T x, const Policy& pol);
  452. template <class T>
  453. typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
  454. template <class T, class Policy>
  455. typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
  456. template <class T>
  457. typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
  458. template <class T, class OutputIterator>
  459. OutputIterator cyl_bessel_j_zero(T v,
  460. int start_index,
  461. unsigned number_of_zeros,
  462. OutputIterator out_it);
  463. template <class T, class OutputIterator, class Policy>
  464. OutputIterator cyl_bessel_j_zero(T v,
  465. int start_index,
  466. unsigned number_of_zeros,
  467. OutputIterator out_it,
  468. const Policy&);
  469. template <class T, class Policy>
  470. typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
  471. template <class T>
  472. typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
  473. template <class T, class OutputIterator>
  474. OutputIterator cyl_neumann_zero(T v,
  475. int start_index,
  476. unsigned number_of_zeros,
  477. OutputIterator out_it);
  478. template <class T, class OutputIterator, class Policy>
  479. OutputIterator cyl_neumann_zero(T v,
  480. int start_index,
  481. unsigned number_of_zeros,
  482. OutputIterator out_it,
  483. const Policy&);
  484. template <class T1, class T2>
  485. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
  486. template <class T1, class T2, class Policy>
  487. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
  488. template <class T1, class T2, class Policy>
  489. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
  490. template <class T1, class T2>
  491. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
  492. template <class T1, class T2, class Policy>
  493. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
  494. template <class T1, class T2>
  495. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
  496. template <class T1, class T2, class Policy>
  497. std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
  498. template <class T1, class T2>
  499. std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
  500. template <class T, class Policy>
  501. typename tools::promote_args<T>::type airy_ai(T x, const Policy&);
  502. template <class T>
  503. typename tools::promote_args<T>::type airy_ai(T x);
  504. template <class T, class Policy>
  505. typename tools::promote_args<T>::type airy_bi(T x, const Policy&);
  506. template <class T>
  507. typename tools::promote_args<T>::type airy_bi(T x);
  508. template <class T, class Policy>
  509. typename tools::promote_args<T>::type airy_ai_prime(T x, const Policy&);
  510. template <class T>
  511. typename tools::promote_args<T>::type airy_ai_prime(T x);
  512. template <class T, class Policy>
  513. typename tools::promote_args<T>::type airy_bi_prime(T x, const Policy&);
  514. template <class T>
  515. typename tools::promote_args<T>::type airy_bi_prime(T x);
  516. template <class T>
  517. T airy_ai_zero(unsigned m);
  518. template <class T, class Policy>
  519. T airy_ai_zero(unsigned m, const Policy&);
  520. template <class OutputIterator>
  521. OutputIterator airy_ai_zero(
  522. unsigned start_index,
  523. unsigned number_of_zeros,
  524. OutputIterator out_it);
  525. template <class OutputIterator, class Policy>
  526. OutputIterator airy_ai_zero(
  527. unsigned start_index,
  528. unsigned number_of_zeros,
  529. OutputIterator out_it,
  530. const Policy&);
  531. template <class T>
  532. T airy_bi_zero(unsigned m);
  533. template <class T, class Policy>
  534. T airy_bi_zero(unsigned m, const Policy&);
  535. template <class OutputIterator>
  536. OutputIterator airy_bi_zero(
  537. unsigned start_index,
  538. unsigned number_of_zeros,
  539. OutputIterator out_it);
  540. template <class OutputIterator, class Policy>
  541. OutputIterator airy_bi_zero(
  542. unsigned start_index,
  543. unsigned number_of_zeros,
  544. OutputIterator out_it,
  545. const Policy&);
  546. template <class T, class Policy>
  547. typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
  548. template <class T>
  549. typename tools::promote_args<T>::type sin_pi(T x);
  550. template <class T, class Policy>
  551. typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
  552. template <class T>
  553. typename tools::promote_args<T>::type cos_pi(T x);
  554. template <class T>
  555. int fpclassify BOOST_NO_MACRO_EXPAND(T t);
  556. template <class T>
  557. bool isfinite BOOST_NO_MACRO_EXPAND(T z);
  558. template <class T>
  559. bool isinf BOOST_NO_MACRO_EXPAND(T t);
  560. template <class T>
  561. bool isnan BOOST_NO_MACRO_EXPAND(T t);
  562. template <class T>
  563. bool isnormal BOOST_NO_MACRO_EXPAND(T t);
  564. template<class T>
  565. int signbit BOOST_NO_MACRO_EXPAND(T x);
  566. template <class T>
  567. int sign BOOST_NO_MACRO_EXPAND(const T& z);
  568. template <class T, class U>
  569. typename tools::promote_args_permissive<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
  570. template <class T>
  571. typename tools::promote_args_permissive<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
  572. // Exponential integrals:
  573. namespace detail{
  574. template <class T, class U>
  575. struct expint_result
  576. {
  577. typedef typename mpl::if_<
  578. policies::is_policy<U>,
  579. typename tools::promote_args<T>::type,
  580. typename tools::promote_args<U>::type
  581. >::type type;
  582. };
  583. } // namespace detail
  584. template <class T, class Policy>
  585. typename tools::promote_args<T>::type expint(unsigned n, T z, const Policy&);
  586. template <class T, class U>
  587. typename detail::expint_result<T, U>::type expint(T const z, U const u);
  588. template <class T>
  589. typename tools::promote_args<T>::type expint(T z);
  590. // Zeta:
  591. template <class T, class Policy>
  592. typename tools::promote_args<T>::type zeta(T s, const Policy&);
  593. // Owen's T function:
  594. template <class T1, class T2, class Policy>
  595. typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
  596. template <class T1, class T2>
  597. typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
  598. // Jacobi Functions:
  599. template <class T, class U, class V, class Policy>
  600. typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
  601. template <class T, class U, class V>
  602. typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
  603. template <class U, class T, class Policy>
  604. typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
  605. template <class U, class T>
  606. typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta);
  607. template <class T, class U, class Policy>
  608. typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta, const Policy& pol);
  609. template <class T, class U>
  610. typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta);
  611. template <class T, class U, class Policy>
  612. typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta, const Policy& pol);
  613. template <class T, class U>
  614. typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta);
  615. template <class T, class U, class Policy>
  616. typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta, const Policy& pol);
  617. template <class T, class U>
  618. typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta);
  619. template <class T, class U, class Policy>
  620. typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta, const Policy& pol);
  621. template <class T, class U>
  622. typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta);
  623. template <class T, class U, class Policy>
  624. typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta, const Policy& pol);
  625. template <class T, class U>
  626. typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta);
  627. template <class T, class U, class Policy>
  628. typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta, const Policy& pol);
  629. template <class T, class U>
  630. typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta);
  631. template <class T, class U, class Policy>
  632. typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta, const Policy& pol);
  633. template <class T, class U>
  634. typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta);
  635. template <class T, class U, class Policy>
  636. typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta, const Policy& pol);
  637. template <class T, class U>
  638. typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta);
  639. template <class T, class U, class Policy>
  640. typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta, const Policy& pol);
  641. template <class T, class U>
  642. typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta);
  643. template <class T, class U, class Policy>
  644. typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta, const Policy& pol);
  645. template <class T, class U>
  646. typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta);
  647. template <class T, class U, class Policy>
  648. typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta, const Policy& pol);
  649. template <class T, class U>
  650. typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta);
  651. template <class T>
  652. typename tools::promote_args<T>::type zeta(T s);
  653. // pow:
  654. template <int N, typename T, class Policy>
  655. typename tools::promote_args<T>::type pow(T base, const Policy& policy);
  656. template <int N, typename T>
  657. typename tools::promote_args<T>::type pow(T base);
  658. // next:
  659. template <class T, class U, class Policy>
  660. typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
  661. template <class T, class U>
  662. typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
  663. template <class T, class Policy>
  664. typename tools::promote_args<T>::type float_next(const T&, const Policy&);
  665. template <class T>
  666. typename tools::promote_args<T>::type float_next(const T&);
  667. template <class T, class Policy>
  668. typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
  669. template <class T>
  670. typename tools::promote_args<T>::type float_prior(const T&);
  671. template <class T, class U, class Policy>
  672. typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
  673. template <class T, class U>
  674. typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
  675. template <class T, class Policy>
  676. typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
  677. template <class T>
  678. typename tools::promote_args<T>::type float_advance(const T& val, int distance);
  679. } // namespace math
  680. } // namespace boost
  681. #ifdef BOOST_HAS_LONG_LONG
  682. #define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
  683. \
  684. template <class T>\
  685. inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  686. \
  687. template <class T>\
  688. inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
  689. \
  690. template <class T>\
  691. inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
  692. #else
  693. #define BOOST_MATH_DETAIL_LL_FUNC(Policy)
  694. #endif
  695. #define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
  696. \
  697. BOOST_MATH_DETAIL_LL_FUNC(Policy)\
  698. \
  699. template <class RT1, class RT2>\
  700. inline typename boost::math::tools::promote_args<RT1, RT2>::type \
  701. beta(RT1 a, RT2 b) { return ::boost::math::beta(a, b, Policy()); }\
  702. \
  703. template <class RT1, class RT2, class A>\
  704. inline typename boost::math::tools::promote_args<RT1, RT2, A>::type \
  705. beta(RT1 a, RT2 b, A x){ return ::boost::math::beta(a, b, x, Policy()); }\
  706. \
  707. template <class RT1, class RT2, class RT3>\
  708. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  709. betac(RT1 a, RT2 b, RT3 x) { return ::boost::math::betac(a, b, x, Policy()); }\
  710. \
  711. template <class RT1, class RT2, class RT3>\
  712. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  713. ibeta(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta(a, b, x, Policy()); }\
  714. \
  715. template <class RT1, class RT2, class RT3>\
  716. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  717. ibetac(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibetac(a, b, x, Policy()); }\
  718. \
  719. template <class T1, class T2, class T3, class T4>\
  720. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  721. ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::boost::math::ibeta_inv(a, b, p, py, Policy()); }\
  722. \
  723. template <class RT1, class RT2, class RT3>\
  724. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  725. ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inv(a, b, p, Policy()); }\
  726. \
  727. template <class T1, class T2, class T3, class T4>\
  728. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  729. ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::boost::math::ibetac_inv(a, b, q, py, Policy()); }\
  730. \
  731. template <class RT1, class RT2, class RT3>\
  732. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  733. ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inva(a, b, p, Policy()); }\
  734. \
  735. template <class T1, class T2, class T3>\
  736. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  737. ibetac_inva(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_inva(a, b, q, Policy()); }\
  738. \
  739. template <class RT1, class RT2, class RT3>\
  740. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  741. ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_invb(a, b, p, Policy()); }\
  742. \
  743. template <class T1, class T2, class T3>\
  744. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  745. ibetac_invb(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_invb(a, b, q, Policy()); }\
  746. \
  747. template <class RT1, class RT2, class RT3>\
  748. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  749. ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::boost::math::ibetac_inv(a, b, q, Policy()); }\
  750. \
  751. template <class RT1, class RT2, class RT3>\
  752. inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
  753. ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta_derivative(a, b, x, Policy()); }\
  754. \
  755. template <class RT>\
  756. inline typename boost::math::tools::promote_args<RT>::type erf(RT z) { return ::boost::math::erf(z, Policy()); }\
  757. \
  758. template <class RT>\
  759. inline typename boost::math::tools::promote_args<RT>::type erfc(RT z){ return ::boost::math::erfc(z, Policy()); }\
  760. \
  761. template <class RT>\
  762. inline typename boost::math::tools::promote_args<RT>::type erf_inv(RT z) { return ::boost::math::erf_inv(z, Policy()); }\
  763. \
  764. template <class RT>\
  765. inline typename boost::math::tools::promote_args<RT>::type erfc_inv(RT z){ return ::boost::math::erfc_inv(z, Policy()); }\
  766. \
  767. using boost::math::legendre_next;\
  768. \
  769. template <class T>\
  770. inline typename boost::math::tools::promote_args<T>::type \
  771. legendre_p(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\
  772. \
  773. template <class T>\
  774. inline typename boost::math::tools::promote_args<T>::type \
  775. legendre_q(unsigned l, T x){ return ::boost::math::legendre_q(l, x, Policy()); }\
  776. \
  777. using ::boost::math::legendre_next;\
  778. \
  779. template <class T>\
  780. inline typename boost::math::tools::promote_args<T>::type \
  781. legendre_p(int l, int m, T x){ return ::boost::math::legendre_p(l, m, x, Policy()); }\
  782. \
  783. using ::boost::math::laguerre_next;\
  784. \
  785. template <class T>\
  786. inline typename boost::math::tools::promote_args<T>::type \
  787. laguerre(unsigned n, T x){ return ::boost::math::laguerre(n, x, Policy()); }\
  788. \
  789. template <class T1, class T2>\
  790. inline typename boost::math::laguerre_result<T1, T2>::type \
  791. laguerre(unsigned n, T1 m, T2 x) { return ::boost::math::laguerre(n, m, x, Policy()); }\
  792. \
  793. template <class T>\
  794. inline typename boost::math::tools::promote_args<T>::type \
  795. hermite(unsigned n, T x){ return ::boost::math::hermite(n, x, Policy()); }\
  796. \
  797. using boost::math::hermite_next;\
  798. \
  799. template <class T1, class T2>\
  800. inline std::complex<typename boost::math::tools::promote_args<T1, T2>::type> \
  801. spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\
  802. \
  803. template <class T1, class T2>\
  804. inline typename boost::math::tools::promote_args<T1, T2>::type \
  805. spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::boost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\
  806. \
  807. template <class T1, class T2>\
  808. inline typename boost::math::tools::promote_args<T1, T2>::type \
  809. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\
  810. \
  811. template <class T1, class T2, class Policy>\
  812. inline typename boost::math::tools::promote_args<T1, T2>::type \
  813. spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\
  814. \
  815. template <class T1, class T2, class T3>\
  816. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  817. ellint_rf(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rf(x, y, z, Policy()); }\
  818. \
  819. template <class T1, class T2, class T3>\
  820. inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
  821. ellint_rd(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rd(x, y, z, Policy()); }\
  822. \
  823. template <class T1, class T2>\
  824. inline typename boost::math::tools::promote_args<T1, T2>::type \
  825. ellint_rc(T1 x, T2 y){ return ::boost::math::ellint_rc(x, y, Policy()); }\
  826. \
  827. template <class T1, class T2, class T3, class T4>\
  828. inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
  829. ellint_rj(T1 x, T2 y, T3 z, T4 p){ return boost::math::ellint_rj(x, y, z, p, Policy()); }\
  830. \
  831. template <typename T>\
  832. inline typename boost::math::tools::promote_args<T>::type ellint_2(T k){ return boost::math::ellint_2(k, Policy()); }\
  833. \
  834. template <class T1, class T2>\
  835. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi){ return boost::math::ellint_2(k, phi, Policy()); }\
  836. \
  837. template <typename T>\
  838. inline typename boost::math::tools::promote_args<T>::type ellint_1(T k){ return boost::math::ellint_1(k, Policy()); }\
  839. \
  840. template <class T1, class T2>\
  841. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi){ return boost::math::ellint_1(k, phi, Policy()); }\
  842. \
  843. template <class T1, class T2, class T3>\
  844. 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()); }\
  845. \
  846. template <class T1, class T2>\
  847. inline typename boost::math::tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v){ return boost::math::ellint_3(k, v, Policy()); }\
  848. \
  849. using boost::math::max_factorial;\
  850. template <class RT>\
  851. inline RT factorial(unsigned int i) { return boost::math::factorial<RT>(i, Policy()); }\
  852. using boost::math::unchecked_factorial;\
  853. template <class RT>\
  854. inline RT double_factorial(unsigned i){ return boost::math::double_factorial<RT>(i, Policy()); }\
  855. template <class RT>\
  856. inline typename boost::math::tools::promote_args<RT>::type falling_factorial(RT x, unsigned n){ return boost::math::falling_factorial(x, n, Policy()); }\
  857. template <class RT>\
  858. inline typename boost::math::tools::promote_args<RT>::type rising_factorial(RT x, unsigned n){ return boost::math::rising_factorial(x, n, Policy()); }\
  859. \
  860. template <class RT>\
  861. inline typename boost::math::tools::promote_args<RT>::type tgamma(RT z){ return boost::math::tgamma(z, Policy()); }\
  862. \
  863. template <class RT>\
  864. inline typename boost::math::tools::promote_args<RT>::type tgamma1pm1(RT z){ return boost::math::tgamma1pm1(z, Policy()); }\
  865. \
  866. template <class RT1, class RT2>\
  867. inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z){ return boost::math::tgamma(a, z, Policy()); }\
  868. \
  869. template <class RT>\
  870. inline typename boost::math::tools::promote_args<RT>::type lgamma(RT z, int* sign){ return boost::math::lgamma(z, sign, Policy()); }\
  871. \
  872. template <class RT>\
  873. inline typename boost::math::tools::promote_args<RT>::type lgamma(RT x){ return boost::math::lgamma(x, Policy()); }\
  874. \
  875. template <class RT1, class RT2>\
  876. inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z){ return boost::math::tgamma_lower(a, z, Policy()); }\
  877. \
  878. template <class RT1, class RT2>\
  879. inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z){ return boost::math::gamma_q(a, z, Policy()); }\
  880. \
  881. template <class RT1, class RT2>\
  882. inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z){ return boost::math::gamma_p(a, z, Policy()); }\
  883. \
  884. template <class T1, class T2>\
  885. 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()); }\
  886. \
  887. template <class T1, class T2>\
  888. inline typename boost::math::tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b) { return boost::math::tgamma_ratio(a, b, Policy()); }\
  889. \
  890. template <class T1, class T2>\
  891. 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()); }\
  892. \
  893. template <class T1, class T2>\
  894. 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()); }\
  895. \
  896. template <class T1, class T2>\
  897. 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()); }\
  898. \
  899. template <class T1, class T2>\
  900. 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()); }\
  901. \
  902. template <class T1, class T2>\
  903. 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()); }\
  904. \
  905. template <class T>\
  906. inline typename boost::math::tools::promote_args<T>::type digamma(T x){ return boost::math::digamma(x, Policy()); }\
  907. \
  908. template <class T1, class T2>\
  909. inline typename boost::math::tools::promote_args<T1, T2>::type \
  910. hypot(T1 x, T2 y){ return boost::math::hypot(x, y, Policy()); }\
  911. \
  912. template <class RT>\
  913. inline typename boost::math::tools::promote_args<RT>::type cbrt(RT z){ return boost::math::cbrt(z, Policy()); }\
  914. \
  915. template <class T>\
  916. inline typename boost::math::tools::promote_args<T>::type log1p(T x){ return boost::math::log1p(x, Policy()); }\
  917. \
  918. template <class T>\
  919. inline typename boost::math::tools::promote_args<T>::type log1pmx(T x){ return boost::math::log1pmx(x, Policy()); }\
  920. \
  921. template <class T>\
  922. inline typename boost::math::tools::promote_args<T>::type expm1(T x){ return boost::math::expm1(x, Policy()); }\
  923. \
  924. template <class T1, class T2>\
  925. inline typename boost::math::tools::promote_args<T1, T2>::type \
  926. powm1(const T1 a, const T2 z){ return boost::math::powm1(a, z, Policy()); }\
  927. \
  928. template <class T>\
  929. inline typename boost::math::tools::promote_args<T>::type sqrt1pm1(const T& val){ return boost::math::sqrt1pm1(val, Policy()); }\
  930. \
  931. template <class T>\
  932. inline typename boost::math::tools::promote_args<T>::type sinc_pi(T x){ return boost::math::sinc_pi(x, Policy()); }\
  933. \
  934. template <class T>\
  935. inline typename boost::math::tools::promote_args<T>::type sinhc_pi(T x){ return boost::math::sinhc_pi(x, Policy()); }\
  936. \
  937. template<typename T>\
  938. inline typename boost::math::tools::promote_args<T>::type asinh(const T x){ return boost::math::asinh(x, Policy()); }\
  939. \
  940. template<typename T>\
  941. inline typename boost::math::tools::promote_args<T>::type acosh(const T x){ return boost::math::acosh(x, Policy()); }\
  942. \
  943. template<typename T>\
  944. inline typename boost::math::tools::promote_args<T>::type atanh(const T x){ return boost::math::atanh(x, Policy()); }\
  945. \
  946. template <class T1, class T2>\
  947. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j(T1 v, T2 x)\
  948. { return boost::math::cyl_bessel_j(v, x, Policy()); }\
  949. \
  950. template <class T>\
  951. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel(unsigned v, T x)\
  952. { return boost::math::sph_bessel(v, x, Policy()); }\
  953. \
  954. template <class T1, class T2>\
  955. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  956. cyl_bessel_i(T1 v, T2 x) { return boost::math::cyl_bessel_i(v, x, Policy()); }\
  957. \
  958. template <class T1, class T2>\
  959. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  960. cyl_bessel_k(T1 v, T2 x) { return boost::math::cyl_bessel_k(v, x, Policy()); }\
  961. \
  962. template <class T1, class T2>\
  963. inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
  964. cyl_neumann(T1 v, T2 x){ return boost::math::cyl_neumann(v, x, Policy()); }\
  965. \
  966. template <class T>\
  967. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type \
  968. sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\
  969. \
  970. template <class T>\
  971. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
  972. { return boost::math::cyl_bessel_j_zero(v, m, Policy()); }\
  973. \
  974. template <class OutputIterator, class T>\
  975. inline void cyl_bessel_j_zero(T v,\
  976. int start_index,\
  977. unsigned number_of_zeros,\
  978. OutputIterator out_it)\
  979. { boost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
  980. \
  981. template <class T>\
  982. inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
  983. { return boost::math::cyl_neumann_zero(v, m, Policy()); }\
  984. \
  985. template <class OutputIterator, class T>\
  986. inline void cyl_neumann_zero(T v,\
  987. int start_index,\
  988. unsigned number_of_zeros,\
  989. OutputIterator out_it)\
  990. { boost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
  991. \
  992. template <class T>\
  993. inline typename boost::math::tools::promote_args<T>::type sin_pi(T x){ return boost::math::sin_pi(x); }\
  994. \
  995. template <class T>\
  996. inline typename boost::math::tools::promote_args<T>::type cos_pi(T x){ return boost::math::cos_pi(x); }\
  997. \
  998. using boost::math::fpclassify;\
  999. using boost::math::isfinite;\
  1000. using boost::math::isinf;\
  1001. using boost::math::isnan;\
  1002. using boost::math::isnormal;\
  1003. using boost::math::signbit;\
  1004. using boost::math::sign;\
  1005. using boost::math::copysign;\
  1006. using boost::math::changesign;\
  1007. \
  1008. template <class T, class U>\
  1009. inline typename boost::math::tools::promote_args<T,U>::type expint(T const& z, U const& u)\
  1010. { return boost::math::expint(z, u, Policy()); }\
  1011. \
  1012. template <class T>\
  1013. inline typename boost::math::tools::promote_args<T>::type expint(T z){ return boost::math::expint(z, Policy()); }\
  1014. \
  1015. template <class T>\
  1016. inline typename boost::math::tools::promote_args<T>::type zeta(T s){ return boost::math::zeta(s, Policy()); }\
  1017. \
  1018. template <class T>\
  1019. inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\
  1020. \
  1021. template <class T>\
  1022. inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\
  1023. \
  1024. template <class T>\
  1025. inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\
  1026. \
  1027. template <class T>\
  1028. inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\
  1029. \
  1030. template <class T>\
  1031. inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\
  1032. \
  1033. template <class T>\
  1034. inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\
  1035. \
  1036. template <class T>\
  1037. inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1038. \
  1039. template <class T>\
  1040. inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1041. \
  1042. template <class T>\
  1043. inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
  1044. \
  1045. template <int N, class T>\
  1046. inline typename boost::math::tools::promote_args<T>::type pow(T v){ return boost::math::pow<N>(v, Policy()); }\
  1047. \
  1048. template <class T> T nextafter(const T& a, const T& b){ return boost::math::nextafter(a, b, Policy()); }\
  1049. template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
  1050. template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
  1051. template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
  1052. \
  1053. template <class RT1, class RT2>\
  1054. inline typename boost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return boost::math::owens_t(a, z, Policy()); }\
  1055. \
  1056. template <class T1, class T2>\
  1057. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
  1058. { return boost::math::cyl_hankel_1(v, x, Policy()); }\
  1059. \
  1060. template <class T1, class T2>\
  1061. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
  1062. { return boost::math::cyl_hankel_2(v, x, Policy()); }\
  1063. \
  1064. template <class T1, class T2>\
  1065. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
  1066. { return boost::math::sph_hankel_1(v, x, Policy()); }\
  1067. \
  1068. template <class T1, class T2>\
  1069. inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
  1070. { return boost::math::sph_hankel_2(v, x, Policy()); }\
  1071. \
  1072. template <class T>\
  1073. inline typename boost::math::tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)\
  1074. { return boost::math::jacobi_elliptic(k, theta, pcn, pdn, Policy()); }\
  1075. \
  1076. template <class U, class T>\
  1077. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sn(U k, T theta)\
  1078. { return boost::math::jacobi_sn(k, theta, Policy()); }\
  1079. \
  1080. template <class T, class U>\
  1081. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cn(T k, U theta)\
  1082. { return boost::math::jacobi_cn(k, theta, Policy()); }\
  1083. \
  1084. template <class T, class U>\
  1085. inline typename boost::math::tools::promote_args<T, U>::type jacobi_dn(T k, U theta)\
  1086. { return boost::math::jacobi_dn(k, theta, Policy()); }\
  1087. \
  1088. template <class T, class U>\
  1089. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cd(T k, U theta)\
  1090. { return boost::math::jacobi_cd(k, theta, Policy()); }\
  1091. \
  1092. template <class T, class U>\
  1093. inline typename boost::math::tools::promote_args<T, U>::type jacobi_dc(T k, U theta)\
  1094. { return boost::math::jacobi_dc(k, theta, Policy()); }\
  1095. \
  1096. template <class T, class U>\
  1097. inline typename boost::math::tools::promote_args<T, U>::type jacobi_ns(T k, U theta)\
  1098. { return boost::math::jacobi_ns(k, theta, Policy()); }\
  1099. \
  1100. template <class T, class U>\
  1101. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sd(T k, U theta)\
  1102. { return boost::math::jacobi_sd(k, theta, Policy()); }\
  1103. \
  1104. template <class T, class U>\
  1105. inline typename boost::math::tools::promote_args<T, U>::type jacobi_ds(T k, U theta)\
  1106. { return boost::math::jacobi_ds(k, theta, Policy()); }\
  1107. \
  1108. template <class T, class U>\
  1109. inline typename boost::math::tools::promote_args<T, U>::type jacobi_nc(T k, U theta)\
  1110. { return boost::math::jacobi_nc(k, theta, Policy()); }\
  1111. \
  1112. template <class T, class U>\
  1113. inline typename boost::math::tools::promote_args<T, U>::type jacobi_nd(T k, U theta)\
  1114. { return boost::math::jacobi_nd(k, theta, Policy()); }\
  1115. \
  1116. template <class T, class U>\
  1117. inline typename boost::math::tools::promote_args<T, U>::type jacobi_sc(T k, U theta)\
  1118. { return boost::math::jacobi_sc(k, theta, Policy()); }\
  1119. \
  1120. template <class T, class U>\
  1121. inline typename boost::math::tools::promote_args<T, U>::type jacobi_cs(T k, U theta)\
  1122. { return boost::math::jacobi_cs(k, theta, Policy()); }\
  1123. \
  1124. template <class T>\
  1125. inline typename boost::math::tools::promote_args<T>::type airy_ai(T x)\
  1126. { return boost::math::airy_ai(x, Policy()); }\
  1127. \
  1128. template <class T>\
  1129. inline typename boost::math::tools::promote_args<T>::type airy_bi(T x)\
  1130. { return boost::math::airy_bi(x, Policy()); }\
  1131. \
  1132. template <class T>\
  1133. inline typename boost::math::tools::promote_args<T>::type airy_ai_prime(T x)\
  1134. { return boost::math::airy_ai_prime(x, Policy()); }\
  1135. \
  1136. template <class T>\
  1137. inline typename boost::math::tools::promote_args<T>::type airy_bi_prime(T x)\
  1138. { return boost::math::airy_bi_prime(x, Policy()); }\
  1139. \
  1140. template <class T>\
  1141. inline T airy_ai_zero(int m)\
  1142. { return boost::math::airy_ai_zero<T>(m, Policy()); }\
  1143. template <class T, class OutputIterator>\
  1144. OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
  1145. { return boost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
  1146. \
  1147. template <class T>\
  1148. inline T airy_bi_zero(int m)\
  1149. { return boost::math::airy_bi_zero<T>(m, Policy()); }\
  1150. template <class T, class OutputIterator>\
  1151. OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
  1152. { return boost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
  1153. \
  1154. #endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP