math_fwd.hpp 77 KB

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