math_fwd.hpp 72 KB

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