3 // TODO revise completely for new distribution classes.
5 // Copyright Paul A. Bristow 2006.
6 // Copyright John Maddock 2006.
8 // Use, modification and distribution are subject to the
9 // Boost Software License, Version 1.0.
10 // (See accompanying file LICENSE_1_0.txt
11 // or copy at http://www.boost.org/LICENSE_1_0.txt)
13 // Omnibus list of forward declarations of math special functions.
16 // RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types
17 // AT = Integer or Real type
19 #ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP
20 #define BOOST_MATH_SPECIAL_MATH_FWD_HPP
27 #include <boost/math/special_functions/detail/round_fwd.hpp>
28 #include <boost/math/tools/promotion.hpp> // for argument promotion.
29 #include <boost/math/policies/policy.hpp>
30 #include <boost/mpl/comparison.hpp>
31 #include <boost/utility/enable_if.hpp>
32 #include <boost/config/no_tr1/complex.hpp>
34 #define BOOST_NO_MACRO_EXPAND /**/
39 { // Math functions (in roughly alphabetic order).
42 template <class RT1, class RT2>
43 typename tools::promote_args<RT1, RT2>::type
44 beta(RT1 a, RT2 b); // Beta function (2 arguments).
46 template <class RT1, class RT2, class A>
47 typename tools::promote_args<RT1, RT2, A>::type
48 beta(RT1 a, RT2 b, A x); // Beta function (3 arguments).
50 template <class RT1, class RT2, class RT3, class Policy>
51 typename tools::promote_args<RT1, RT2, RT3>::type
52 beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments).
54 template <class RT1, class RT2, class RT3>
55 typename tools::promote_args<RT1, RT2, RT3>::type
56 betac(RT1 a, RT2 b, RT3 x);
58 template <class RT1, class RT2, class RT3, class Policy>
59 typename tools::promote_args<RT1, RT2, RT3>::type
60 betac(RT1 a, RT2 b, RT3 x, const Policy& pol);
62 template <class RT1, class RT2, class RT3>
63 typename tools::promote_args<RT1, RT2, RT3>::type
64 ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function.
66 template <class RT1, class RT2, class RT3, class Policy>
67 typename tools::promote_args<RT1, RT2, RT3>::type
68 ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function.
70 template <class RT1, class RT2, class RT3>
71 typename tools::promote_args<RT1, RT2, RT3>::type
72 ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function.
74 template <class RT1, class RT2, class RT3, class Policy>
75 typename tools::promote_args<RT1, RT2, RT3>::type
76 ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function.
78 template <class T1, class T2, class T3, class T4>
79 typename tools::promote_args<T1, T2, T3, T4>::type
80 ibeta_inv(T1 a, T2 b, T3 p, T4* py);
82 template <class T1, class T2, class T3, class T4, class Policy>
83 typename tools::promote_args<T1, T2, T3, T4>::type
84 ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol);
86 template <class RT1, class RT2, class RT3>
87 typename tools::promote_args<RT1, RT2, RT3>::type
88 ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
90 template <class RT1, class RT2, class RT3, class Policy>
91 typename tools::promote_args<RT1, RT2, RT3>::type
92 ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
94 template <class RT1, class RT2, class RT3>
95 typename tools::promote_args<RT1, RT2, RT3>::type
96 ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
98 template <class RT1, class RT2, class RT3, class Policy>
99 typename tools::promote_args<RT1, RT2, RT3>::type
100 ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
102 template <class RT1, class RT2, class RT3>
103 typename tools::promote_args<RT1, RT2, RT3>::type
104 ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
106 template <class RT1, class RT2, class RT3, class Policy>
107 typename tools::promote_args<RT1, RT2, RT3>::type
108 ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
110 template <class T1, class T2, class T3, class T4>
111 typename tools::promote_args<T1, T2, T3, T4>::type
112 ibetac_inv(T1 a, T2 b, T3 q, T4* py);
114 template <class T1, class T2, class T3, class T4, class Policy>
115 typename tools::promote_args<T1, T2, T3, T4>::type
116 ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol);
118 template <class RT1, class RT2, class RT3>
119 typename tools::promote_args<RT1, RT2, RT3>::type
120 ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
122 template <class RT1, class RT2, class RT3, class Policy>
123 typename tools::promote_args<RT1, RT2, RT3>::type
124 ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
126 template <class RT1, class RT2, class RT3>
127 typename tools::promote_args<RT1, RT2, RT3>::type
128 ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
130 template <class RT1, class RT2, class RT3, class Policy>
131 typename tools::promote_args<RT1, RT2, RT3>::type
132 ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
134 template <class RT1, class RT2, class RT3>
135 typename tools::promote_args<RT1, RT2, RT3>::type
136 ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
138 template <class RT1, class RT2, class RT3, class Policy>
139 typename tools::promote_args<RT1, RT2, RT3>::type
140 ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
142 template <class RT1, class RT2, class RT3>
143 typename tools::promote_args<RT1, RT2, RT3>::type
144 ibeta_derivative(RT1 a, RT2 b, RT3 x); // derivative of incomplete beta
146 template <class RT1, class RT2, class RT3, class Policy>
147 typename tools::promote_args<RT1, RT2, RT3>::type
148 ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol); // derivative of incomplete beta
151 template <class T, class Policy>
152 T binomial_coefficient(unsigned n, unsigned k, const Policy& pol);
154 T binomial_coefficient(unsigned n, unsigned k);
156 // erf & erfc error functions.
157 template <class RT> // Error function.
158 typename tools::promote_args<RT>::type erf(RT z);
159 template <class RT, class Policy> // Error function.
160 typename tools::promote_args<RT>::type erf(RT z, const Policy&);
162 template <class RT>// Error function complement.
163 typename tools::promote_args<RT>::type erfc(RT z);
164 template <class RT, class Policy>// Error function complement.
165 typename tools::promote_args<RT>::type erfc(RT z, const Policy&);
167 template <class RT>// Error function inverse.
168 typename tools::promote_args<RT>::type erf_inv(RT z);
169 template <class RT, class Policy>// Error function inverse.
170 typename tools::promote_args<RT>::type erf_inv(RT z, const Policy& pol);
172 template <class RT>// Error function complement inverse.
173 typename tools::promote_args<RT>::type erfc_inv(RT z);
174 template <class RT, class Policy>// Error function complement inverse.
175 typename tools::promote_args<RT>::type erfc_inv(RT z, const Policy& pol);
178 template <class T1, class T2, class T3>
179 typename tools::promote_args<T1, T2, T3>::type
180 legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1);
183 typename tools::promote_args<T>::type
184 legendre_p(int l, T x);
186 typename tools::promote_args<T>::type
187 legendre_p_prime(int l, T x);
190 template <class T, class Policy>
191 inline std::vector<T> legendre_p_zeros(int l, const Policy& pol);
194 inline std::vector<T> legendre_p_zeros(int l);
196 #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
197 template <class T, class Policy>
198 typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
199 legendre_p(int l, T x, const Policy& pol);
200 template <class T, class Policy>
201 inline typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
202 legendre_p_prime(int l, T x, const Policy& pol);
205 typename tools::promote_args<T>::type
206 legendre_q(unsigned l, T x);
207 #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
208 template <class T, class Policy>
209 typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
210 legendre_q(unsigned l, T x, const Policy& pol);
212 template <class T1, class T2, class T3>
213 typename tools::promote_args<T1, T2, T3>::type
214 legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
217 typename tools::promote_args<T>::type
218 legendre_p(int l, int m, T x);
220 template <class T, class Policy>
221 typename tools::promote_args<T>::type
222 legendre_p(int l, int m, T x, const Policy& pol);
224 template <class T1, class T2, class T3>
225 typename tools::promote_args<T1, T2, T3>::type
226 laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1);
228 template <class T1, class T2, class T3>
229 typename tools::promote_args<T1, T2, T3>::type
230 laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1);
233 typename tools::promote_args<T>::type
234 laguerre(unsigned n, T x);
236 template <class T, class Policy>
237 typename tools::promote_args<T>::type
238 laguerre(unsigned n, unsigned m, T x, const Policy& pol);
240 template <class T1, class T2>
241 struct laguerre_result
243 typedef typename mpl::if_<
244 policies::is_policy<T2>,
245 typename tools::promote_args<T1>::type,
246 typename tools::promote_args<T2>::type
250 template <class T1, class T2>
251 typename laguerre_result<T1, T2>::type
252 laguerre(unsigned n, T1 m, T2 x);
255 typename tools::promote_args<T>::type
256 hermite(unsigned n, T x);
258 template <class T, class Policy>
259 typename tools::promote_args<T>::type
260 hermite(unsigned n, T x, const Policy& pol);
262 template <class T1, class T2, class T3>
263 typename tools::promote_args<T1, T2, T3>::type
264 hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
266 template<class T1, class T2, class T3>
267 typename tools::promote_args<T1, T2, T3>::type chebyshev_next(T1 const & x, T2 const & Tn, T3 const & Tn_1);
269 template <class Real, class Policy>
270 typename tools::promote_args<Real>::type
271 chebyshev_t(unsigned n, Real const & x, const Policy&);
273 typename tools::promote_args<Real>::type chebyshev_t(unsigned n, Real const & x);
275 template <class Real, class Policy>
276 typename tools::promote_args<Real>::type
277 chebyshev_u(unsigned n, Real const & x, const Policy&);
279 typename tools::promote_args<Real>::type chebyshev_u(unsigned n, Real const & x);
281 template <class Real, class Policy>
282 typename tools::promote_args<Real>::type
283 chebyshev_t_prime(unsigned n, Real const & x, const Policy&);
285 typename tools::promote_args<Real>::type chebyshev_t_prime(unsigned n, Real const & x);
287 template<class Real, class T2>
288 Real chebyshev_clenshaw_recurrence(const Real* const c, size_t length, const T2& x);
290 template <class T1, class T2>
291 std::complex<typename tools::promote_args<T1, T2>::type>
292 spherical_harmonic(unsigned n, int m, T1 theta, T2 phi);
294 template <class T1, class T2, class Policy>
295 std::complex<typename tools::promote_args<T1, T2>::type>
296 spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
298 template <class T1, class T2>
299 typename tools::promote_args<T1, T2>::type
300 spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi);
302 template <class T1, class T2, class Policy>
303 typename tools::promote_args<T1, T2>::type
304 spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
306 template <class T1, class T2>
307 typename tools::promote_args<T1, T2>::type
308 spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi);
310 template <class T1, class T2, class Policy>
311 typename tools::promote_args<T1, T2>::type
312 spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
314 // Elliptic integrals:
315 template <class T1, class T2, class T3>
316 typename tools::promote_args<T1, T2, T3>::type
317 ellint_rf(T1 x, T2 y, T3 z);
319 template <class T1, class T2, class T3, class Policy>
320 typename tools::promote_args<T1, T2, T3>::type
321 ellint_rf(T1 x, T2 y, T3 z, const Policy& pol);
323 template <class T1, class T2, class T3>
324 typename tools::promote_args<T1, T2, T3>::type
325 ellint_rd(T1 x, T2 y, T3 z);
327 template <class T1, class T2, class T3, class Policy>
328 typename tools::promote_args<T1, T2, T3>::type
329 ellint_rd(T1 x, T2 y, T3 z, const Policy& pol);
331 template <class T1, class T2>
332 typename tools::promote_args<T1, T2>::type
333 ellint_rc(T1 x, T2 y);
335 template <class T1, class T2, class Policy>
336 typename tools::promote_args<T1, T2>::type
337 ellint_rc(T1 x, T2 y, const Policy& pol);
339 template <class T1, class T2, class T3, class T4>
340 typename tools::promote_args<T1, T2, T3, T4>::type
341 ellint_rj(T1 x, T2 y, T3 z, T4 p);
343 template <class T1, class T2, class T3, class T4, class Policy>
344 typename tools::promote_args<T1, T2, T3, T4>::type
345 ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol);
347 template <class T1, class T2, class T3>
348 typename tools::promote_args<T1, T2, T3>::type
349 ellint_rg(T1 x, T2 y, T3 z);
351 template <class T1, class T2, class T3, class Policy>
352 typename tools::promote_args<T1, T2, T3>::type
353 ellint_rg(T1 x, T2 y, T3 z, const Policy& pol);
355 template <typename T>
356 typename tools::promote_args<T>::type ellint_2(T k);
358 template <class T1, class T2>
359 typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi);
361 template <class T1, class T2, class Policy>
362 typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi, const Policy& pol);
364 template <typename T>
365 typename tools::promote_args<T>::type ellint_1(T k);
367 template <class T1, class T2>
368 typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi);
370 template <class T1, class T2, class Policy>
371 typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy& pol);
373 template <typename T>
374 typename tools::promote_args<T>::type ellint_d(T k);
376 template <class T1, class T2>
377 typename tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi);
379 template <class T1, class T2, class Policy>
380 typename tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi, const Policy& pol);
382 template <class T1, class T2>
383 typename tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi);
385 template <class T1, class T2, class Policy>
386 typename tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi, const Policy& pol);
388 template <class T1, class T2>
389 typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi);
391 template <class T1, class T2, class Policy>
392 typename tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi, const Policy& pol);
396 template <class T, class U, class V>
397 struct ellint_3_result
399 typedef typename mpl::if_<
400 policies::is_policy<V>,
401 typename tools::promote_args<T, U>::type,
402 typename tools::promote_args<T, U, V>::type
406 } // namespace detail
409 template <class T1, class T2, class T3>
410 typename detail::ellint_3_result<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi);
412 template <class T1, class T2, class T3, class Policy>
413 typename tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol);
415 template <class T1, class T2>
416 typename tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v);
418 // Factorial functions.
419 // Note: not for integral types, at present.
421 struct max_factorial;
423 RT factorial(unsigned int);
424 template <class RT, class Policy>
425 RT factorial(unsigned int, const Policy& pol);
427 RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT));
429 RT double_factorial(unsigned i);
430 template <class RT, class Policy>
431 RT double_factorial(unsigned i, const Policy& pol);
434 typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n);
436 template <class RT, class Policy>
437 typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
440 typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
442 template <class RT, class Policy>
443 typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
447 typename tools::promote_args<RT>::type tgamma(RT z);
450 typename tools::promote_args<RT>::type tgamma1pm1(RT z);
452 template <class RT, class Policy>
453 typename tools::promote_args<RT>::type tgamma1pm1(RT z, const Policy& pol);
455 template <class RT1, class RT2>
456 typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z);
458 template <class RT1, class RT2, class Policy>
459 typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z, const Policy& pol);
462 typename tools::promote_args<RT>::type lgamma(RT z, int* sign);
464 template <class RT, class Policy>
465 typename tools::promote_args<RT>::type lgamma(RT z, int* sign, const Policy& pol);
468 typename tools::promote_args<RT>::type lgamma(RT x);
470 template <class RT, class Policy>
471 typename tools::promote_args<RT>::type lgamma(RT x, const Policy& pol);
473 template <class RT1, class RT2>
474 typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z);
476 template <class RT1, class RT2, class Policy>
477 typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z, const Policy&);
479 template <class RT1, class RT2>
480 typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z);
482 template <class RT1, class RT2, class Policy>
483 typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z, const Policy&);
485 template <class RT1, class RT2>
486 typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z);
488 template <class RT1, class RT2, class Policy>
489 typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z, const Policy&);
491 template <class T1, class T2>
492 typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta);
494 template <class T1, class T2, class Policy>
495 typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&);
497 template <class T1, class T2>
498 typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b);
500 template <class T1, class T2, class Policy>
501 typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b, const Policy&);
503 template <class T1, class T2>
504 typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x);
506 template <class T1, class T2, class Policy>
507 typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x, const Policy&);
510 template <class T1, class T2>
511 typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p);
513 template <class T1, class T2, class Policy>
514 typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p, const Policy&);
516 template <class T1, class T2>
517 typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p);
519 template <class T1, class T2, class Policy>
520 typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p, const Policy&);
522 template <class T1, class T2>
523 typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q);
525 template <class T1, class T2, class Policy>
526 typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q, const Policy&);
528 template <class T1, class T2>
529 typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q);
531 template <class T1, class T2, class Policy>
532 typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q, const Policy&);
536 typename tools::promote_args<T>::type digamma(T x);
538 template <class T, class Policy>
539 typename tools::promote_args<T>::type digamma(T x, const Policy&);
543 typename tools::promote_args<T>::type trigamma(T x);
545 template <class T, class Policy>
546 typename tools::promote_args<T>::type trigamma(T x, const Policy&);
550 typename tools::promote_args<T>::type polygamma(int n, T x);
552 template <class T, class Policy>
553 typename tools::promote_args<T>::type polygamma(int n, T x, const Policy&);
555 // Hypotenuse function sqrt(x ^ 2 + y ^ 2).
556 template <class T1, class T2>
557 typename tools::promote_args<T1, T2>::type
560 template <class T1, class T2, class Policy>
561 typename tools::promote_args<T1, T2>::type
562 hypot(T1 x, T2 y, const Policy&);
566 typename tools::promote_args<RT>::type cbrt(RT z);
568 template <class RT, class Policy>
569 typename tools::promote_args<RT>::type cbrt(RT z, const Policy&);
571 // log1p is log(x + 1)
573 typename tools::promote_args<T>::type log1p(T);
575 template <class T, class Policy>
576 typename tools::promote_args<T>::type log1p(T, const Policy&);
578 // log1pmx is log(x + 1) - x
580 typename tools::promote_args<T>::type log1pmx(T);
582 template <class T, class Policy>
583 typename tools::promote_args<T>::type log1pmx(T, const Policy&);
585 // Exp (x) minus 1 functions.
587 typename tools::promote_args<T>::type expm1(T);
589 template <class T, class Policy>
590 typename tools::promote_args<T>::type expm1(T, const Policy&);
593 template <class T1, class T2>
594 typename tools::promote_args<T1, T2>::type
595 powm1(const T1 a, const T2 z);
597 template <class T1, class T2, class Policy>
598 typename tools::promote_args<T1, T2>::type
599 powm1(const T1 a, const T2 z, const Policy&);
603 typename tools::promote_args<T>::type sqrt1pm1(const T& val);
605 template <class T, class Policy>
606 typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy&);
610 typename tools::promote_args<T>::type sinc_pi(T x);
612 template <class T, class Policy>
613 typename tools::promote_args<T>::type sinc_pi(T x, const Policy&);
616 typename tools::promote_args<T>::type sinhc_pi(T x);
618 template <class T, class Policy>
619 typename tools::promote_args<T>::type sinhc_pi(T x, const Policy&);
621 // inverse hyperbolics:
623 typename tools::promote_args<T>::type asinh(T x);
625 template<typename T, class Policy>
626 typename tools::promote_args<T>::type asinh(T x, const Policy&);
629 typename tools::promote_args<T>::type acosh(T x);
631 template<typename T, class Policy>
632 typename tools::promote_args<T>::type acosh(T x, const Policy&);
635 typename tools::promote_args<T>::type atanh(T x);
637 template<typename T, class Policy>
638 typename tools::promote_args<T>::type atanh(T x, const Policy&);
642 typedef mpl::int_<0> bessel_no_int_tag; // No integer optimisation possible.
643 typedef mpl::int_<1> bessel_maybe_int_tag; // Maybe integer optimisation.
644 typedef mpl::int_<2> bessel_int_tag; // Definite integer optimistaion.
646 template <class T1, class T2, class Policy>
649 typedef typename mpl::if_<
651 typename tools::promote_args<T2>::type,
652 typename tools::promote_args<T1, T2>::type
655 typedef typename policies::precision<result_type, Policy>::type precision_type;
657 typedef typename mpl::if_<
659 mpl::less_equal<precision_type, mpl::int_<0> >,
660 mpl::greater<precision_type, mpl::int_<64> > >,
667 >::type optimisation_tag;
668 typedef typename mpl::if_<
670 mpl::less_equal<precision_type, mpl::int_<0> >,
671 mpl::greater<precision_type, mpl::int_<113> > >,
678 >::type optimisation_tag128;
683 template <class T1, class T2, class Policy>
684 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol);
685 template <class T1, class T2, class Policy>
686 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j_prime(T1 v, T2 x, const Policy& pol);
688 template <class T1, class T2>
689 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j(T1 v, T2 x);
690 template <class T1, class T2>
691 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j_prime(T1 v, T2 x);
693 template <class T, class Policy>
694 typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel(unsigned v, T x, const Policy& pol);
695 template <class T, class Policy>
696 typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel_prime(unsigned v, T x, const Policy& pol);
699 typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel(unsigned v, T x);
701 typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel_prime(unsigned v, T x);
703 template <class T1, class T2, class Policy>
704 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol);
705 template <class T1, class T2, class Policy>
706 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i_prime(T1 v, T2 x, const Policy& pol);
708 template <class T1, class T2>
709 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i(T1 v, T2 x);
710 template <class T1, class T2>
711 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i_prime(T1 v, T2 x);
713 template <class T1, class T2, class Policy>
714 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol);
715 template <class T1, class T2, class Policy>
716 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k_prime(T1 v, T2 x, const Policy& pol);
718 template <class T1, class T2>
719 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k(T1 v, T2 x);
720 template <class T1, class T2>
721 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k_prime(T1 v, T2 x);
723 template <class T1, class T2, class Policy>
724 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann(T1 v, T2 x, const Policy& pol);
725 template <class T1, class T2, class Policy>
726 typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann_prime(T1 v, T2 x, const Policy& pol);
728 template <class T1, class T2>
729 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann(T1 v, T2 x);
730 template <class T1, class T2>
731 typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann_prime(T1 v, T2 x);
733 template <class T, class Policy>
734 typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann(unsigned v, T x, const Policy& pol);
735 template <class T, class Policy>
736 typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann_prime(unsigned v, T x, const Policy& pol);
739 typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
741 typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann_prime(unsigned v, T x);
743 template <class T, class Policy>
744 typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
747 typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
749 template <class T, class OutputIterator>
750 OutputIterator cyl_bessel_j_zero(T v,
752 unsigned number_of_zeros,
753 OutputIterator out_it);
755 template <class T, class OutputIterator, class Policy>
756 OutputIterator cyl_bessel_j_zero(T v,
758 unsigned number_of_zeros,
759 OutputIterator out_it,
762 template <class T, class Policy>
763 typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
766 typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
768 template <class T, class OutputIterator>
769 OutputIterator cyl_neumann_zero(T v,
771 unsigned number_of_zeros,
772 OutputIterator out_it);
774 template <class T, class OutputIterator, class Policy>
775 OutputIterator cyl_neumann_zero(T v,
777 unsigned number_of_zeros,
778 OutputIterator out_it,
781 template <class T1, class T2>
782 std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
784 template <class T1, class T2, class Policy>
785 std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
787 template <class T1, class T2, class Policy>
788 std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
790 template <class T1, class T2>
791 std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
793 template <class T1, class T2, class Policy>
794 std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
796 template <class T1, class T2>
797 std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
799 template <class T1, class T2, class Policy>
800 std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
802 template <class T1, class T2>
803 std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
805 template <class T, class Policy>
806 typename tools::promote_args<T>::type airy_ai(T x, const Policy&);
809 typename tools::promote_args<T>::type airy_ai(T x);
811 template <class T, class Policy>
812 typename tools::promote_args<T>::type airy_bi(T x, const Policy&);
815 typename tools::promote_args<T>::type airy_bi(T x);
817 template <class T, class Policy>
818 typename tools::promote_args<T>::type airy_ai_prime(T x, const Policy&);
821 typename tools::promote_args<T>::type airy_ai_prime(T x);
823 template <class T, class Policy>
824 typename tools::promote_args<T>::type airy_bi_prime(T x, const Policy&);
827 typename tools::promote_args<T>::type airy_bi_prime(T x);
830 T airy_ai_zero(int m);
831 template <class T, class Policy>
832 T airy_ai_zero(int m, const Policy&);
834 template <class OutputIterator>
835 OutputIterator airy_ai_zero(
837 unsigned number_of_zeros,
838 OutputIterator out_it);
839 template <class OutputIterator, class Policy>
840 OutputIterator airy_ai_zero(
842 unsigned number_of_zeros,
843 OutputIterator out_it,
847 T airy_bi_zero(int m);
848 template <class T, class Policy>
849 T airy_bi_zero(int m, const Policy&);
851 template <class OutputIterator>
852 OutputIterator airy_bi_zero(
854 unsigned number_of_zeros,
855 OutputIterator out_it);
856 template <class OutputIterator, class Policy>
857 OutputIterator airy_bi_zero(
859 unsigned number_of_zeros,
860 OutputIterator out_it,
863 template <class T, class Policy>
864 typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
867 typename tools::promote_args<T>::type sin_pi(T x);
869 template <class T, class Policy>
870 typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
873 typename tools::promote_args<T>::type cos_pi(T x);
876 int fpclassify BOOST_NO_MACRO_EXPAND(T t);
879 bool isfinite BOOST_NO_MACRO_EXPAND(T z);
882 bool isinf BOOST_NO_MACRO_EXPAND(T t);
885 bool isnan BOOST_NO_MACRO_EXPAND(T t);
888 bool isnormal BOOST_NO_MACRO_EXPAND(T t);
891 int signbit BOOST_NO_MACRO_EXPAND(T x);
894 int sign BOOST_NO_MACRO_EXPAND(const T& z);
896 template <class T, class U>
897 typename tools::promote_args_permissive<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
900 typename tools::promote_args_permissive<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
902 // Exponential integrals:
905 template <class T, class U>
908 typedef typename mpl::if_<
909 policies::is_policy<U>,
910 typename tools::promote_args<T>::type,
911 typename tools::promote_args<U>::type
915 } // namespace detail
917 template <class T, class Policy>
918 typename tools::promote_args<T>::type expint(unsigned n, T z, const Policy&);
920 template <class T, class U>
921 typename detail::expint_result<T, U>::type expint(T const z, U const u);
924 typename tools::promote_args<T>::type expint(T z);
927 template <class T, class Policy>
928 typename tools::promote_args<T>::type zeta(T s, const Policy&);
930 // Owen's T function:
931 template <class T1, class T2, class Policy>
932 typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
934 template <class T1, class T2>
935 typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
938 template <class T, class U, class V, class Policy>
939 typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
941 template <class T, class U, class V>
942 typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
944 template <class U, class T, class Policy>
945 typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
947 template <class U, class T>
948 typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta);
950 template <class T, class U, class Policy>
951 typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta, const Policy& pol);
953 template <class T, class U>
954 typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta);
956 template <class T, class U, class Policy>
957 typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta, const Policy& pol);
959 template <class T, class U>
960 typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta);
962 template <class T, class U, class Policy>
963 typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta, const Policy& pol);
965 template <class T, class U>
966 typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta);
968 template <class T, class U, class Policy>
969 typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta, const Policy& pol);
971 template <class T, class U>
972 typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta);
974 template <class T, class U, class Policy>
975 typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta, const Policy& pol);
977 template <class T, class U>
978 typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta);
980 template <class T, class U, class Policy>
981 typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta, const Policy& pol);
983 template <class T, class U>
984 typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta);
986 template <class T, class U, class Policy>
987 typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta, const Policy& pol);
989 template <class T, class U>
990 typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta);
992 template <class T, class U, class Policy>
993 typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta, const Policy& pol);
995 template <class T, class U>
996 typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta);
998 template <class T, class U, class Policy>
999 typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta, const Policy& pol);
1001 template <class T, class U>
1002 typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta);
1004 template <class T, class U, class Policy>
1005 typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta, const Policy& pol);
1007 template <class T, class U>
1008 typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta);
1010 template <class T, class U, class Policy>
1011 typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta, const Policy& pol);
1013 template <class T, class U>
1014 typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta);
1018 typename tools::promote_args<T>::type zeta(T s);
1021 template <int N, typename T, class Policy>
1022 typename tools::promote_args<T>::type pow(T base, const Policy& policy);
1024 template <int N, typename T>
1025 typename tools::promote_args<T>::type pow(T base);
1028 template <class T, class U, class Policy>
1029 typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
1030 template <class T, class U>
1031 typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
1032 template <class T, class Policy>
1033 typename tools::promote_args<T>::type float_next(const T&, const Policy&);
1035 typename tools::promote_args<T>::type float_next(const T&);
1036 template <class T, class Policy>
1037 typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
1039 typename tools::promote_args<T>::type float_prior(const T&);
1040 template <class T, class U, class Policy>
1041 typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
1042 template <class T, class U>
1043 typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
1044 template <class T, class Policy>
1045 typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
1047 typename tools::promote_args<T>::type float_advance(const T& val, int distance);
1049 template <class T, class Policy>
1050 typename tools::promote_args<T>::type ulp(const T& val, const Policy& pol);
1052 typename tools::promote_args<T>::type ulp(const T& val);
1054 template <class T, class U>
1055 typename tools::promote_args<T, U>::type relative_difference(const T&, const U&);
1056 template <class T, class U>
1057 typename tools::promote_args<T, U>::type epsilon_difference(const T&, const U&);
1060 T unchecked_bernoulli_b2n(const std::size_t n);
1061 template <class T, class Policy>
1062 T bernoulli_b2n(const int i, const Policy &pol);
1064 T bernoulli_b2n(const int i);
1065 template <class T, class OutputIterator, class Policy>
1066 OutputIterator bernoulli_b2n(const int start_index,
1067 const unsigned number_of_bernoullis_b2n,
1068 OutputIterator out_it,
1070 template <class T, class OutputIterator>
1071 OutputIterator bernoulli_b2n(const int start_index,
1072 const unsigned number_of_bernoullis_b2n,
1073 OutputIterator out_it);
1074 template <class T, class Policy>
1075 T tangent_t2n(const int i, const Policy &pol);
1077 T tangent_t2n(const int i);
1078 template <class T, class OutputIterator, class Policy>
1079 OutputIterator tangent_t2n(const int start_index,
1080 const unsigned number_of_bernoullis_b2n,
1081 OutputIterator out_it,
1083 template <class T, class OutputIterator>
1084 OutputIterator tangent_t2n(const int start_index,
1085 const unsigned number_of_bernoullis_b2n,
1086 OutputIterator out_it);
1089 } // namespace boost
1091 #ifdef BOOST_HAS_LONG_LONG
1092 #define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
1095 inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
1098 inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
1101 inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
1104 #define BOOST_MATH_DETAIL_LL_FUNC(Policy)
1107 #define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
1109 BOOST_MATH_DETAIL_LL_FUNC(Policy)\
1111 template <class RT1, class RT2>\
1112 inline typename boost::math::tools::promote_args<RT1, RT2>::type \
1113 beta(RT1 a, RT2 b) { return ::boost::math::beta(a, b, Policy()); }\
1115 template <class RT1, class RT2, class A>\
1116 inline typename boost::math::tools::promote_args<RT1, RT2, A>::type \
1117 beta(RT1 a, RT2 b, A x){ return ::boost::math::beta(a, b, x, Policy()); }\
1119 template <class RT1, class RT2, class RT3>\
1120 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1121 betac(RT1 a, RT2 b, RT3 x) { return ::boost::math::betac(a, b, x, Policy()); }\
1123 template <class RT1, class RT2, class RT3>\
1124 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1125 ibeta(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta(a, b, x, Policy()); }\
1127 template <class RT1, class RT2, class RT3>\
1128 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1129 ibetac(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibetac(a, b, x, Policy()); }\
1131 template <class T1, class T2, class T3, class T4>\
1132 inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
1133 ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::boost::math::ibeta_inv(a, b, p, py, Policy()); }\
1135 template <class RT1, class RT2, class RT3>\
1136 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1137 ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inv(a, b, p, Policy()); }\
1139 template <class T1, class T2, class T3, class T4>\
1140 inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
1141 ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::boost::math::ibetac_inv(a, b, q, py, Policy()); }\
1143 template <class RT1, class RT2, class RT3>\
1144 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1145 ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inva(a, b, p, Policy()); }\
1147 template <class T1, class T2, class T3>\
1148 inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
1149 ibetac_inva(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_inva(a, b, q, Policy()); }\
1151 template <class RT1, class RT2, class RT3>\
1152 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1153 ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_invb(a, b, p, Policy()); }\
1155 template <class T1, class T2, class T3>\
1156 inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
1157 ibetac_invb(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_invb(a, b, q, Policy()); }\
1159 template <class RT1, class RT2, class RT3>\
1160 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1161 ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::boost::math::ibetac_inv(a, b, q, Policy()); }\
1163 template <class RT1, class RT2, class RT3>\
1164 inline typename boost::math::tools::promote_args<RT1, RT2, RT3>::type \
1165 ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta_derivative(a, b, x, Policy()); }\
1167 template <class T> T binomial_coefficient(unsigned n, unsigned k){ return ::boost::math::binomial_coefficient<T, Policy>(n, k, Policy()); }\
1169 template <class RT>\
1170 inline typename boost::math::tools::promote_args<RT>::type erf(RT z) { return ::boost::math::erf(z, Policy()); }\
1172 template <class RT>\
1173 inline typename boost::math::tools::promote_args<RT>::type erfc(RT z){ return ::boost::math::erfc(z, Policy()); }\
1175 template <class RT>\
1176 inline typename boost::math::tools::promote_args<RT>::type erf_inv(RT z) { return ::boost::math::erf_inv(z, Policy()); }\
1178 template <class RT>\
1179 inline typename boost::math::tools::promote_args<RT>::type erfc_inv(RT z){ return ::boost::math::erfc_inv(z, Policy()); }\
1181 using boost::math::legendre_next;\
1184 inline typename boost::math::tools::promote_args<T>::type \
1185 legendre_p(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\
1188 inline typename boost::math::tools::promote_args<T>::type \
1189 legendre_p_prime(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\
1192 inline typename boost::math::tools::promote_args<T>::type \
1193 legendre_q(unsigned l, T x){ return ::boost::math::legendre_q(l, x, Policy()); }\
1195 using ::boost::math::legendre_next;\
1198 inline typename boost::math::tools::promote_args<T>::type \
1199 legendre_p(int l, int m, T x){ return ::boost::math::legendre_p(l, m, x, Policy()); }\
1201 using ::boost::math::laguerre_next;\
1204 inline typename boost::math::tools::promote_args<T>::type \
1205 laguerre(unsigned n, T x){ return ::boost::math::laguerre(n, x, Policy()); }\
1207 template <class T1, class T2>\
1208 inline typename boost::math::laguerre_result<T1, T2>::type \
1209 laguerre(unsigned n, T1 m, T2 x) { return ::boost::math::laguerre(n, m, x, Policy()); }\
1212 inline typename boost::math::tools::promote_args<T>::type \
1213 hermite(unsigned n, T x){ return ::boost::math::hermite(n, x, Policy()); }\
1215 using boost::math::hermite_next;\
1217 using boost::math::chebyshev_next;\
1219 template<class Real>\
1220 Real chebyshev_t(unsigned n, Real const & x){ return ::boost::math::chebyshev_t(n, x, Policy()); }\
1222 template<class Real>\
1223 Real chebyshev_u(unsigned n, Real const & x){ return ::boost::math::chebyshev_u(n, x, Policy()); }\
1225 template<class Real>\
1226 Real chebyshev_t_prime(unsigned n, Real const & x){ return ::boost::math::chebyshev_t_prime(n, x, Policy()); }\
1228 using ::boost::math::chebyshev_clenshaw_recurrence;\
1230 template <class T1, class T2>\
1231 inline std::complex<typename boost::math::tools::promote_args<T1, T2>::type> \
1232 spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\
1234 template <class T1, class T2>\
1235 inline typename boost::math::tools::promote_args<T1, T2>::type \
1236 spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::boost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\
1238 template <class T1, class T2>\
1239 inline typename boost::math::tools::promote_args<T1, T2>::type \
1240 spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\
1242 template <class T1, class T2, class Policy>\
1243 inline typename boost::math::tools::promote_args<T1, T2>::type \
1244 spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\
1246 template <class T1, class T2, class T3>\
1247 inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
1248 ellint_rf(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rf(x, y, z, Policy()); }\
1250 template <class T1, class T2, class T3>\
1251 inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
1252 ellint_rd(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rd(x, y, z, Policy()); }\
1254 template <class T1, class T2>\
1255 inline typename boost::math::tools::promote_args<T1, T2>::type \
1256 ellint_rc(T1 x, T2 y){ return ::boost::math::ellint_rc(x, y, Policy()); }\
1258 template <class T1, class T2, class T3, class T4>\
1259 inline typename boost::math::tools::promote_args<T1, T2, T3, T4>::type \
1260 ellint_rj(T1 x, T2 y, T3 z, T4 p){ return boost::math::ellint_rj(x, y, z, p, Policy()); }\
1262 template <class T1, class T2, class T3>\
1263 inline typename boost::math::tools::promote_args<T1, T2, T3>::type \
1264 ellint_rg(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rg(x, y, z, Policy()); }\
1266 template <typename T>\
1267 inline typename boost::math::tools::promote_args<T>::type ellint_2(T k){ return boost::math::ellint_2(k, Policy()); }\
1269 template <class T1, class T2>\
1270 inline typename boost::math::tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi){ return boost::math::ellint_2(k, phi, Policy()); }\
1272 template <typename T>\
1273 inline typename boost::math::tools::promote_args<T>::type ellint_d(T k){ return boost::math::ellint_d(k, Policy()); }\
1275 template <class T1, class T2>\
1276 inline typename boost::math::tools::promote_args<T1, T2>::type ellint_d(T1 k, T2 phi){ return boost::math::ellint_d(k, phi, Policy()); }\
1278 template <class T1, class T2>\
1279 inline typename boost::math::tools::promote_args<T1, T2>::type jacobi_zeta(T1 k, T2 phi){ return boost::math::jacobi_zeta(k, phi, Policy()); }\
1281 template <class T1, class T2>\
1282 inline typename boost::math::tools::promote_args<T1, T2>::type heuman_lambda(T1 k, T2 phi){ return boost::math::heuman_lambda(k, phi, Policy()); }\
1284 template <typename T>\
1285 inline typename boost::math::tools::promote_args<T>::type ellint_1(T k){ return boost::math::ellint_1(k, Policy()); }\
1287 template <class T1, class T2>\
1288 inline typename boost::math::tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi){ return boost::math::ellint_1(k, phi, Policy()); }\
1290 template <class T1, class T2, class T3>\
1291 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()); }\
1293 template <class T1, class T2>\
1294 inline typename boost::math::tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v){ return boost::math::ellint_3(k, v, Policy()); }\
1296 using boost::math::max_factorial;\
1297 template <class RT>\
1298 inline RT factorial(unsigned int i) { return boost::math::factorial<RT>(i, Policy()); }\
1299 using boost::math::unchecked_factorial;\
1300 template <class RT>\
1301 inline RT double_factorial(unsigned i){ return boost::math::double_factorial<RT>(i, Policy()); }\
1302 template <class RT>\
1303 inline typename boost::math::tools::promote_args<RT>::type falling_factorial(RT x, unsigned n){ return boost::math::falling_factorial(x, n, Policy()); }\
1304 template <class RT>\
1305 inline typename boost::math::tools::promote_args<RT>::type rising_factorial(RT x, unsigned n){ return boost::math::rising_factorial(x, n, Policy()); }\
1307 template <class RT>\
1308 inline typename boost::math::tools::promote_args<RT>::type tgamma(RT z){ return boost::math::tgamma(z, Policy()); }\
1310 template <class RT>\
1311 inline typename boost::math::tools::promote_args<RT>::type tgamma1pm1(RT z){ return boost::math::tgamma1pm1(z, Policy()); }\
1313 template <class RT1, class RT2>\
1314 inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z){ return boost::math::tgamma(a, z, Policy()); }\
1316 template <class RT>\
1317 inline typename boost::math::tools::promote_args<RT>::type lgamma(RT z, int* sign){ return boost::math::lgamma(z, sign, Policy()); }\
1319 template <class RT>\
1320 inline typename boost::math::tools::promote_args<RT>::type lgamma(RT x){ return boost::math::lgamma(x, Policy()); }\
1322 template <class RT1, class RT2>\
1323 inline typename boost::math::tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z){ return boost::math::tgamma_lower(a, z, Policy()); }\
1325 template <class RT1, class RT2>\
1326 inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z){ return boost::math::gamma_q(a, z, Policy()); }\
1328 template <class RT1, class RT2>\
1329 inline typename boost::math::tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z){ return boost::math::gamma_p(a, z, Policy()); }\
1331 template <class T1, class T2>\
1332 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()); }\
1334 template <class T1, class T2>\
1335 inline typename boost::math::tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b) { return boost::math::tgamma_ratio(a, b, Policy()); }\
1337 template <class T1, class T2>\
1338 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()); }\
1340 template <class T1, class T2>\
1341 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()); }\
1343 template <class T1, class T2>\
1344 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()); }\
1346 template <class T1, class T2>\
1347 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()); }\
1349 template <class T1, class T2>\
1350 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()); }\
1353 inline typename boost::math::tools::promote_args<T>::type digamma(T x){ return boost::math::digamma(x, Policy()); }\
1356 inline typename boost::math::tools::promote_args<T>::type trigamma(T x){ return boost::math::trigamma(x, Policy()); }\
1359 inline typename boost::math::tools::promote_args<T>::type polygamma(int n, T x){ return boost::math::polygamma(n, x, Policy()); }\
1361 template <class T1, class T2>\
1362 inline typename boost::math::tools::promote_args<T1, T2>::type \
1363 hypot(T1 x, T2 y){ return boost::math::hypot(x, y, Policy()); }\
1365 template <class RT>\
1366 inline typename boost::math::tools::promote_args<RT>::type cbrt(RT z){ return boost::math::cbrt(z, Policy()); }\
1369 inline typename boost::math::tools::promote_args<T>::type log1p(T x){ return boost::math::log1p(x, Policy()); }\
1372 inline typename boost::math::tools::promote_args<T>::type log1pmx(T x){ return boost::math::log1pmx(x, Policy()); }\
1375 inline typename boost::math::tools::promote_args<T>::type expm1(T x){ return boost::math::expm1(x, Policy()); }\
1377 template <class T1, class T2>\
1378 inline typename boost::math::tools::promote_args<T1, T2>::type \
1379 powm1(const T1 a, const T2 z){ return boost::math::powm1(a, z, Policy()); }\
1382 inline typename boost::math::tools::promote_args<T>::type sqrt1pm1(const T& val){ return boost::math::sqrt1pm1(val, Policy()); }\
1385 inline typename boost::math::tools::promote_args<T>::type sinc_pi(T x){ return boost::math::sinc_pi(x, Policy()); }\
1388 inline typename boost::math::tools::promote_args<T>::type sinhc_pi(T x){ return boost::math::sinhc_pi(x, Policy()); }\
1390 template<typename T>\
1391 inline typename boost::math::tools::promote_args<T>::type asinh(const T x){ return boost::math::asinh(x, Policy()); }\
1393 template<typename T>\
1394 inline typename boost::math::tools::promote_args<T>::type acosh(const T x){ return boost::math::acosh(x, Policy()); }\
1396 template<typename T>\
1397 inline typename boost::math::tools::promote_args<T>::type atanh(const T x){ return boost::math::atanh(x, Policy()); }\
1399 template <class T1, class T2>\
1400 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j(T1 v, T2 x)\
1401 { return boost::math::cyl_bessel_j(v, x, Policy()); }\
1403 template <class T1, class T2>\
1404 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j_prime(T1 v, T2 x)\
1405 { return boost::math::cyl_bessel_j_prime(v, x, Policy()); }\
1408 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel(unsigned v, T x)\
1409 { return boost::math::sph_bessel(v, x, Policy()); }\
1412 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel_prime(unsigned v, T x)\
1413 { return boost::math::sph_bessel_prime(v, x, Policy()); }\
1415 template <class T1, class T2>\
1416 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1417 cyl_bessel_i(T1 v, T2 x) { return boost::math::cyl_bessel_i(v, x, Policy()); }\
1419 template <class T1, class T2>\
1420 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1421 cyl_bessel_i_prime(T1 v, T2 x) { return boost::math::cyl_bessel_i_prime(v, x, Policy()); }\
1423 template <class T1, class T2>\
1424 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1425 cyl_bessel_k(T1 v, T2 x) { return boost::math::cyl_bessel_k(v, x, Policy()); }\
1427 template <class T1, class T2>\
1428 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1429 cyl_bessel_k_prime(T1 v, T2 x) { return boost::math::cyl_bessel_k_prime(v, x, Policy()); }\
1431 template <class T1, class T2>\
1432 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1433 cyl_neumann(T1 v, T2 x){ return boost::math::cyl_neumann(v, x, Policy()); }\
1435 template <class T1, class T2>\
1436 inline typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
1437 cyl_neumann_prime(T1 v, T2 x){ return boost::math::cyl_neumann_prime(v, x, Policy()); }\
1440 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type \
1441 sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\
1444 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type \
1445 sph_neumann_prime(unsigned v, T x){ return boost::math::sph_neumann_prime(v, x, Policy()); }\
1448 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
1449 { return boost::math::cyl_bessel_j_zero(v, m, Policy()); }\
1451 template <class OutputIterator, class T>\
1452 inline void cyl_bessel_j_zero(T v,\
1454 unsigned number_of_zeros,\
1455 OutputIterator out_it)\
1456 { boost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
1459 inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
1460 { return boost::math::cyl_neumann_zero(v, m, Policy()); }\
1462 template <class OutputIterator, class T>\
1463 inline void cyl_neumann_zero(T v,\
1465 unsigned number_of_zeros,\
1466 OutputIterator out_it)\
1467 { boost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
1470 inline typename boost::math::tools::promote_args<T>::type sin_pi(T x){ return boost::math::sin_pi(x); }\
1473 inline typename boost::math::tools::promote_args<T>::type cos_pi(T x){ return boost::math::cos_pi(x); }\
1475 using boost::math::fpclassify;\
1476 using boost::math::isfinite;\
1477 using boost::math::isinf;\
1478 using boost::math::isnan;\
1479 using boost::math::isnormal;\
1480 using boost::math::signbit;\
1481 using boost::math::sign;\
1482 using boost::math::copysign;\
1483 using boost::math::changesign;\
1485 template <class T, class U>\
1486 inline typename boost::math::tools::promote_args<T,U>::type expint(T const& z, U const& u)\
1487 { return boost::math::expint(z, u, Policy()); }\
1490 inline typename boost::math::tools::promote_args<T>::type expint(T z){ return boost::math::expint(z, Policy()); }\
1493 inline typename boost::math::tools::promote_args<T>::type zeta(T s){ return boost::math::zeta(s, Policy()); }\
1496 inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\
1499 inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\
1502 inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\
1505 inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\
1508 inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\
1511 inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\
1514 inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
1517 inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
1520 inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
1522 template <int N, class T>\
1523 inline typename boost::math::tools::promote_args<T>::type pow(T v){ return boost::math::pow<N>(v, Policy()); }\
1525 template <class T> T nextafter(const T& a, const T& b){ return boost::math::nextafter(a, b, Policy()); }\
1526 template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
1527 template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
1528 template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
1529 template <class T> T ulp(const T& a){ return boost::math::ulp(a, Policy()); }\
1531 template <class RT1, class RT2>\
1532 inline typename boost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return boost::math::owens_t(a, z, Policy()); }\
1534 template <class T1, class T2>\
1535 inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
1536 { return boost::math::cyl_hankel_1(v, x, Policy()); }\
1538 template <class T1, class T2>\
1539 inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
1540 { return boost::math::cyl_hankel_2(v, x, Policy()); }\
1542 template <class T1, class T2>\
1543 inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
1544 { return boost::math::sph_hankel_1(v, x, Policy()); }\
1546 template <class T1, class T2>\
1547 inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
1548 { return boost::math::sph_hankel_2(v, x, Policy()); }\
1551 inline typename boost::math::tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)\
1552 { return boost::math::jacobi_elliptic(k, theta, pcn, pdn, Policy()); }\
1554 template <class U, class T>\
1555 inline typename boost::math::tools::promote_args<T, U>::type jacobi_sn(U k, T theta)\
1556 { return boost::math::jacobi_sn(k, theta, Policy()); }\
1558 template <class T, class U>\
1559 inline typename boost::math::tools::promote_args<T, U>::type jacobi_cn(T k, U theta)\
1560 { return boost::math::jacobi_cn(k, theta, Policy()); }\
1562 template <class T, class U>\
1563 inline typename boost::math::tools::promote_args<T, U>::type jacobi_dn(T k, U theta)\
1564 { return boost::math::jacobi_dn(k, theta, Policy()); }\
1566 template <class T, class U>\
1567 inline typename boost::math::tools::promote_args<T, U>::type jacobi_cd(T k, U theta)\
1568 { return boost::math::jacobi_cd(k, theta, Policy()); }\
1570 template <class T, class U>\
1571 inline typename boost::math::tools::promote_args<T, U>::type jacobi_dc(T k, U theta)\
1572 { return boost::math::jacobi_dc(k, theta, Policy()); }\
1574 template <class T, class U>\
1575 inline typename boost::math::tools::promote_args<T, U>::type jacobi_ns(T k, U theta)\
1576 { return boost::math::jacobi_ns(k, theta, Policy()); }\
1578 template <class T, class U>\
1579 inline typename boost::math::tools::promote_args<T, U>::type jacobi_sd(T k, U theta)\
1580 { return boost::math::jacobi_sd(k, theta, Policy()); }\
1582 template <class T, class U>\
1583 inline typename boost::math::tools::promote_args<T, U>::type jacobi_ds(T k, U theta)\
1584 { return boost::math::jacobi_ds(k, theta, Policy()); }\
1586 template <class T, class U>\
1587 inline typename boost::math::tools::promote_args<T, U>::type jacobi_nc(T k, U theta)\
1588 { return boost::math::jacobi_nc(k, theta, Policy()); }\
1590 template <class T, class U>\
1591 inline typename boost::math::tools::promote_args<T, U>::type jacobi_nd(T k, U theta)\
1592 { return boost::math::jacobi_nd(k, theta, Policy()); }\
1594 template <class T, class U>\
1595 inline typename boost::math::tools::promote_args<T, U>::type jacobi_sc(T k, U theta)\
1596 { return boost::math::jacobi_sc(k, theta, Policy()); }\
1598 template <class T, class U>\
1599 inline typename boost::math::tools::promote_args<T, U>::type jacobi_cs(T k, U theta)\
1600 { return boost::math::jacobi_cs(k, theta, Policy()); }\
1603 inline typename boost::math::tools::promote_args<T>::type airy_ai(T x)\
1604 { return boost::math::airy_ai(x, Policy()); }\
1607 inline typename boost::math::tools::promote_args<T>::type airy_bi(T x)\
1608 { return boost::math::airy_bi(x, Policy()); }\
1611 inline typename boost::math::tools::promote_args<T>::type airy_ai_prime(T x)\
1612 { return boost::math::airy_ai_prime(x, Policy()); }\
1615 inline typename boost::math::tools::promote_args<T>::type airy_bi_prime(T x)\
1616 { return boost::math::airy_bi_prime(x, Policy()); }\
1619 inline T airy_ai_zero(int m)\
1620 { return boost::math::airy_ai_zero<T>(m, Policy()); }\
1621 template <class T, class OutputIterator>\
1622 OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
1623 { return boost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
1626 inline T airy_bi_zero(int m)\
1627 { return boost::math::airy_bi_zero<T>(m, Policy()); }\
1628 template <class T, class OutputIterator>\
1629 OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
1630 { return boost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
1633 T bernoulli_b2n(const int i)\
1634 { return boost::math::bernoulli_b2n<T>(i, Policy()); }\
1635 template <class T, class OutputIterator>\
1636 OutputIterator bernoulli_b2n(int start_index, unsigned number_of_bernoullis_b2n, OutputIterator out_it)\
1637 { return boost::math::bernoulli_b2n<T>(start_index, number_of_bernoullis_b2n, out_it, Policy()); }\
1640 T tangent_t2n(const int i)\
1641 { return boost::math::tangent_t2n<T>(i, Policy()); }\
1642 template <class T, class OutputIterator>\
1643 OutputIterator tangent_t2n(int start_index, unsigned number_of_bernoullis_b2n, OutputIterator out_it)\
1644 { return boost::math::tangent_t2n<T>(start_index, number_of_bernoullis_b2n, out_it, Policy()); }\
1651 #endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP