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