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