1 // TR1 cmath -*- C++ -*-
3 // Copyright (C) 2006-2013 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
26 * This is a TR1 C++ Library header.
29 #ifndef _GLIBCXX_TR1_CMATH
30 #define _GLIBCXX_TR1_CMATH 1
32 #pragma GCC system_header
36 #ifdef _GLIBCXX_USE_C99_MATH_TR1
146 namespace std _GLIBCXX_VISIBILITY(default)
150 _GLIBCXX_BEGIN_NAMESPACE_VERSION
152 #if _GLIBCXX_USE_C99_MATH_TR1
301 #if _GLIBCXX_USE_C99_MATH
302 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
304 /// Function template definitions [8.16.3].
305 template<typename _Tp>
306 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
310 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
311 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
312 FP_SUBNORMAL, FP_ZERO, __type(__f));
315 template<typename _Tp>
316 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
320 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
321 return __builtin_isfinite(__type(__f));
324 template<typename _Tp>
325 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
329 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
330 return __builtin_isinf(__type(__f));
333 template<typename _Tp>
334 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
338 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
339 return __builtin_isnan(__type(__f));
342 template<typename _Tp>
343 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
347 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
348 return __builtin_isnormal(__type(__f));
351 template<typename _Tp>
352 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
356 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
357 return __builtin_signbit(__type(__f));
360 template<typename _Tp>
361 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
363 isgreater(_Tp __f1, _Tp __f2)
365 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
366 return __builtin_isgreater(__type(__f1), __type(__f2));
369 template<typename _Tp>
370 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
372 isgreaterequal(_Tp __f1, _Tp __f2)
374 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
375 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
378 template<typename _Tp>
379 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
381 isless(_Tp __f1, _Tp __f2)
383 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
384 return __builtin_isless(__type(__f1), __type(__f2));
387 template<typename _Tp>
388 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
390 islessequal(_Tp __f1, _Tp __f2)
392 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
393 return __builtin_islessequal(__type(__f1), __type(__f2));
396 template<typename _Tp>
397 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
399 islessgreater(_Tp __f1, _Tp __f2)
401 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
402 return __builtin_islessgreater(__type(__f1), __type(__f2));
405 template<typename _Tp>
406 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
408 isunordered(_Tp __f1, _Tp __f2)
410 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
411 return __builtin_isunordered(__type(__f1), __type(__f2));
417 #if _GLIBCXX_USE_C99_MATH_TR1
419 /// Additional overloads [8.16.4].
424 { return __builtin_acoshf(__x); }
427 acosh(long double __x)
428 { return __builtin_acoshl(__x); }
430 template<typename _Tp>
431 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
434 { return __builtin_acosh(__x); }
440 { return __builtin_asinhf(__x); }
443 asinh(long double __x)
444 { return __builtin_asinhl(__x); }
446 template<typename _Tp>
447 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
450 { return __builtin_asinh(__x); }
457 { return __builtin_atanhf(__x); }
460 atanh(long double __x)
461 { return __builtin_atanhl(__x); }
463 template<typename _Tp>
464 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
467 { return __builtin_atanh(__x); }
471 { return __builtin_cbrtf(__x); }
474 cbrt(long double __x)
475 { return __builtin_cbrtl(__x); }
477 template<typename _Tp>
478 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
481 { return __builtin_cbrt(__x); }
486 copysign(float __x, float __y)
487 { return __builtin_copysignf(__x, __y); }
490 copysign(long double __x, long double __y)
491 { return __builtin_copysignl(__x, __y); }
493 template<typename _Tp, typename _Up>
494 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
495 copysign(_Tp __x, _Up __y)
497 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
498 return copysign(__type(__x), __type(__y));
506 { return __builtin_erff(__x); }
510 { return __builtin_erfl(__x); }
512 template<typename _Tp>
513 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
516 { return __builtin_erf(__x); }
520 { return __builtin_erfcf(__x); }
523 erfc(long double __x)
524 { return __builtin_erfcl(__x); }
526 template<typename _Tp>
527 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
530 { return __builtin_erfc(__x); }
536 { return __builtin_exp2f(__x); }
539 exp2(long double __x)
540 { return __builtin_exp2l(__x); }
542 template<typename _Tp>
543 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
546 { return __builtin_exp2(__x); }
550 { return __builtin_expm1f(__x); }
553 expm1(long double __x)
554 { return __builtin_expm1l(__x); }
556 template<typename _Tp>
557 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
560 { return __builtin_expm1(__x); }
562 // Note: we deal with fabs in a special way, because an using std::fabs
563 // would bring in also the overloads for complex types, which in C++0x
564 // mode have a different return type.
565 // With __CORRECT_ISO_CPP_MATH_H_PROTO, math.h imports std::fabs in the
566 // global namespace after the declarations of the float / double / long
567 // double overloads but before the std::complex overloads.
570 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
573 { return __builtin_fabsf(__x); }
576 fabs(long double __x)
577 { return __builtin_fabsl(__x); }
579 template<typename _Tp>
580 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
583 { return __builtin_fabs(__x); }
587 fdim(float __x, float __y)
588 { return __builtin_fdimf(__x, __y); }
591 fdim(long double __x, long double __y)
592 { return __builtin_fdiml(__x, __y); }
594 template<typename _Tp, typename _Up>
595 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
596 fdim(_Tp __x, _Up __y)
598 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
599 return fdim(__type(__x), __type(__y));
605 fma(float __x, float __y, float __z)
606 { return __builtin_fmaf(__x, __y, __z); }
609 fma(long double __x, long double __y, long double __z)
610 { return __builtin_fmal(__x, __y, __z); }
612 template<typename _Tp, typename _Up, typename _Vp>
613 inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
614 fma(_Tp __x, _Up __y, _Vp __z)
616 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
617 return fma(__type(__x), __type(__y), __type(__z));
621 fmax(float __x, float __y)
622 { return __builtin_fmaxf(__x, __y); }
625 fmax(long double __x, long double __y)
626 { return __builtin_fmaxl(__x, __y); }
628 template<typename _Tp, typename _Up>
629 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
630 fmax(_Tp __x, _Up __y)
632 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
633 return fmax(__type(__x), __type(__y));
637 fmin(float __x, float __y)
638 { return __builtin_fminf(__x, __y); }
641 fmin(long double __x, long double __y)
642 { return __builtin_fminl(__x, __y); }
644 template<typename _Tp, typename _Up>
645 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
646 fmin(_Tp __x, _Up __y)
648 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
649 return fmin(__type(__x), __type(__y));
656 hypot(float __x, float __y)
657 { return __builtin_hypotf(__x, __y); }
660 hypot(long double __x, long double __y)
661 { return __builtin_hypotl(__x, __y); }
663 template<typename _Tp, typename _Up>
664 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
665 hypot(_Tp __y, _Up __x)
667 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
668 return hypot(__type(__y), __type(__x));
673 { return __builtin_ilogbf(__x); }
676 ilogb(long double __x)
677 { return __builtin_ilogbl(__x); }
679 template<typename _Tp>
680 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
683 { return __builtin_ilogb(__x); }
689 { return __builtin_lgammaf(__x); }
692 lgamma(long double __x)
693 { return __builtin_lgammal(__x); }
695 template<typename _Tp>
696 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
699 { return __builtin_lgamma(__x); }
703 { return __builtin_llrintf(__x); }
706 llrint(long double __x)
707 { return __builtin_llrintl(__x); }
709 template<typename _Tp>
710 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
713 { return __builtin_llrint(__x); }
717 { return __builtin_llroundf(__x); }
720 llround(long double __x)
721 { return __builtin_llroundl(__x); }
723 template<typename _Tp>
724 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
727 { return __builtin_llround(__x); }
734 { return __builtin_log1pf(__x); }
737 log1p(long double __x)
738 { return __builtin_log1pl(__x); }
740 template<typename _Tp>
741 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
744 { return __builtin_log1p(__x); }
749 { return __builtin_log2f(__x); }
752 log2(long double __x)
753 { return __builtin_log2l(__x); }
755 template<typename _Tp>
756 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
759 { return __builtin_log2(__x); }
763 { return __builtin_logbf(__x); }
766 logb(long double __x)
767 { return __builtin_logbl(__x); }
769 template<typename _Tp>
770 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
774 return __builtin_logb(__x);
779 { return __builtin_lrintf(__x); }
782 lrint(long double __x)
783 { return __builtin_lrintl(__x); }
785 template<typename _Tp>
786 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
789 { return __builtin_lrint(__x); }
793 { return __builtin_lroundf(__x); }
796 lround(long double __x)
797 { return __builtin_lroundl(__x); }
799 template<typename _Tp>
800 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
803 { return __builtin_lround(__x); }
807 { return __builtin_nearbyintf(__x); }
810 nearbyint(long double __x)
811 { return __builtin_nearbyintl(__x); }
813 template<typename _Tp>
814 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
817 { return __builtin_nearbyint(__x); }
820 nextafter(float __x, float __y)
821 { return __builtin_nextafterf(__x, __y); }
824 nextafter(long double __x, long double __y)
825 { return __builtin_nextafterl(__x, __y); }
827 template<typename _Tp, typename _Up>
828 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
829 nextafter(_Tp __x, _Up __y)
831 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
832 return nextafter(__type(__x), __type(__y));
836 nexttoward(float __x, long double __y)
837 { return __builtin_nexttowardf(__x, __y); }
840 nexttoward(long double __x, long double __y)
841 { return __builtin_nexttowardl(__x, __y); }
843 template<typename _Tp>
844 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
846 nexttoward(_Tp __x, long double __y)
847 { return __builtin_nexttoward(__x, __y); }
849 // DR 550. What should the return type of pow(float,int) be?
850 // NB: C++0x and TR1 != C++03.
854 remainder(float __x, float __y)
855 { return __builtin_remainderf(__x, __y); }
858 remainder(long double __x, long double __y)
859 { return __builtin_remainderl(__x, __y); }
861 template<typename _Tp, typename _Up>
862 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
863 remainder(_Tp __x, _Up __y)
865 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
866 return remainder(__type(__x), __type(__y));
870 remquo(float __x, float __y, int* __pquo)
871 { return __builtin_remquof(__x, __y, __pquo); }
874 remquo(long double __x, long double __y, int* __pquo)
875 { return __builtin_remquol(__x, __y, __pquo); }
877 template<typename _Tp, typename _Up>
878 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
879 remquo(_Tp __x, _Up __y, int* __pquo)
881 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
882 return remquo(__type(__x), __type(__y), __pquo);
887 { return __builtin_rintf(__x); }
890 rint(long double __x)
891 { return __builtin_rintl(__x); }
893 template<typename _Tp>
894 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
897 { return __builtin_rint(__x); }
901 { return __builtin_roundf(__x); }
904 round(long double __x)
905 { return __builtin_roundl(__x); }
907 template<typename _Tp>
908 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
911 { return __builtin_round(__x); }
914 scalbln(float __x, long __ex)
915 { return __builtin_scalblnf(__x, __ex); }
918 scalbln(long double __x, long __ex)
919 { return __builtin_scalblnl(__x, __ex); }
921 template<typename _Tp>
922 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
924 scalbln(_Tp __x, long __ex)
925 { return __builtin_scalbln(__x, __ex); }
928 scalbn(float __x, int __ex)
929 { return __builtin_scalbnf(__x, __ex); }
932 scalbn(long double __x, int __ex)
933 { return __builtin_scalbnl(__x, __ex); }
935 template<typename _Tp>
936 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
938 scalbn(_Tp __x, int __ex)
939 { return __builtin_scalbn(__x, __ex); }
949 { return __builtin_tgammaf(__x); }
952 tgamma(long double __x)
953 { return __builtin_tgammal(__x); }
955 template<typename _Tp>
956 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
959 { return __builtin_tgamma(__x); }
963 { return __builtin_truncf(__x); }
966 trunc(long double __x)
967 { return __builtin_truncl(__x); }
969 template<typename _Tp>
970 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
973 { return __builtin_trunc(__x); }
976 _GLIBCXX_END_NAMESPACE_VERSION
980 namespace std _GLIBCXX_VISIBILITY(default)
984 _GLIBCXX_BEGIN_NAMESPACE_VERSION
986 // DR 550. What should the return type of pow(float,int) be?
987 // NB: C++0x and TR1 != C++03.
989 pow(double __x, double __y)
990 { return std::pow(__x, __y); }
993 pow(float __x, float __y)
994 { return std::pow(__x, __y); }
997 pow(long double __x, long double __y)
998 { return std::pow(__x, __y); }
1000 template<typename _Tp, typename _Up>
1001 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1002 pow(_Tp __x, _Up __y)
1004 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1005 return std::pow(__type(__x), __type(__y));
1008 _GLIBCXX_END_NAMESPACE_VERSION
1012 #include <bits/stl_algobase.h>
1014 #include <tr1/type_traits>
1016 #include <tr1/gamma.tcc>
1017 #include <tr1/bessel_function.tcc>
1018 #include <tr1/beta_function.tcc>
1019 #include <tr1/ell_integral.tcc>
1020 #include <tr1/exp_integral.tcc>
1021 #include <tr1/hypergeometric.tcc>
1022 #include <tr1/legendre_function.tcc>
1023 #include <tr1/modified_bessel_func.tcc>
1024 #include <tr1/poly_hermite.tcc>
1025 #include <tr1/poly_laguerre.tcc>
1026 #include <tr1/riemann_zeta.tcc>
1028 namespace std _GLIBCXX_VISIBILITY(default)
1032 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1035 * @defgroup tr1_math_spec_func Mathematical Special Functions
1038 * A collection of advanced mathematical special functions.
1043 assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
1044 { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
1047 assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
1049 return __detail::__assoc_laguerre<long double>(__n, __m, __x);
1052 /// 5.2.1.1 Associated Laguerre polynomials.
1053 template<typename _Tp>
1054 inline typename __gnu_cxx::__promote<_Tp>::__type
1055 assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
1057 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1058 return __detail::__assoc_laguerre<__type>(__n, __m, __x);
1062 assoc_legendref(unsigned int __l, unsigned int __m, float __x)
1063 { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
1066 assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
1067 { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
1069 /// 5.2.1.2 Associated Legendre functions.
1070 template<typename _Tp>
1071 inline typename __gnu_cxx::__promote<_Tp>::__type
1072 assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
1074 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1075 return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
1079 betaf(float __x, float __y)
1080 { return __detail::__beta<float>(__x, __y); }
1083 betal(long double __x, long double __y)
1084 { return __detail::__beta<long double>(__x, __y); }
1086 /// 5.2.1.3 Beta functions.
1087 template<typename _Tpx, typename _Tpy>
1088 inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
1089 beta(_Tpx __x, _Tpy __y)
1091 typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
1092 return __detail::__beta<__type>(__x, __y);
1096 comp_ellint_1f(float __k)
1097 { return __detail::__comp_ellint_1<float>(__k); }
1100 comp_ellint_1l(long double __k)
1101 { return __detail::__comp_ellint_1<long double>(__k); }
1103 /// 5.2.1.4 Complete elliptic integrals of the first kind.
1104 template<typename _Tp>
1105 inline typename __gnu_cxx::__promote<_Tp>::__type
1106 comp_ellint_1(_Tp __k)
1108 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1109 return __detail::__comp_ellint_1<__type>(__k);
1113 comp_ellint_2f(float __k)
1114 { return __detail::__comp_ellint_2<float>(__k); }
1117 comp_ellint_2l(long double __k)
1118 { return __detail::__comp_ellint_2<long double>(__k); }
1120 /// 5.2.1.5 Complete elliptic integrals of the second kind.
1121 template<typename _Tp>
1122 inline typename __gnu_cxx::__promote<_Tp>::__type
1123 comp_ellint_2(_Tp __k)
1125 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1126 return __detail::__comp_ellint_2<__type>(__k);
1130 comp_ellint_3f(float __k, float __nu)
1131 { return __detail::__comp_ellint_3<float>(__k, __nu); }
1134 comp_ellint_3l(long double __k, long double __nu)
1135 { return __detail::__comp_ellint_3<long double>(__k, __nu); }
1137 /// 5.2.1.6 Complete elliptic integrals of the third kind.
1138 template<typename _Tp, typename _Tpn>
1139 inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
1140 comp_ellint_3(_Tp __k, _Tpn __nu)
1142 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
1143 return __detail::__comp_ellint_3<__type>(__k, __nu);
1147 conf_hypergf(float __a, float __c, float __x)
1148 { return __detail::__conf_hyperg<float>(__a, __c, __x); }
1151 conf_hypergl(long double __a, long double __c, long double __x)
1152 { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
1154 /// 5.2.1.7 Confluent hypergeometric functions.
1155 template<typename _Tpa, typename _Tpc, typename _Tp>
1156 inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
1157 conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
1159 typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
1160 return __detail::__conf_hyperg<__type>(__a, __c, __x);
1164 cyl_bessel_if(float __nu, float __x)
1165 { return __detail::__cyl_bessel_i<float>(__nu, __x); }
1168 cyl_bessel_il(long double __nu, long double __x)
1169 { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
1171 /// 5.2.1.8 Regular modified cylindrical Bessel functions.
1172 template<typename _Tpnu, typename _Tp>
1173 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1174 cyl_bessel_i(_Tpnu __nu, _Tp __x)
1176 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1177 return __detail::__cyl_bessel_i<__type>(__nu, __x);
1181 cyl_bessel_jf(float __nu, float __x)
1182 { return __detail::__cyl_bessel_j<float>(__nu, __x); }
1185 cyl_bessel_jl(long double __nu, long double __x)
1186 { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
1188 /// 5.2.1.9 Cylindrical Bessel functions (of the first kind).
1189 template<typename _Tpnu, typename _Tp>
1190 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1191 cyl_bessel_j(_Tpnu __nu, _Tp __x)
1193 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1194 return __detail::__cyl_bessel_j<__type>(__nu, __x);
1198 cyl_bessel_kf(float __nu, float __x)
1199 { return __detail::__cyl_bessel_k<float>(__nu, __x); }
1202 cyl_bessel_kl(long double __nu, long double __x)
1203 { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
1205 /// 5.2.1.10 Irregular modified cylindrical Bessel functions.
1206 template<typename _Tpnu, typename _Tp>
1207 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1208 cyl_bessel_k(_Tpnu __nu, _Tp __x)
1210 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1211 return __detail::__cyl_bessel_k<__type>(__nu, __x);
1215 cyl_neumannf(float __nu, float __x)
1216 { return __detail::__cyl_neumann_n<float>(__nu, __x); }
1219 cyl_neumannl(long double __nu, long double __x)
1220 { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
1222 /// 5.2.1.11 Cylindrical Neumann functions.
1223 template<typename _Tpnu, typename _Tp>
1224 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1225 cyl_neumann(_Tpnu __nu, _Tp __x)
1227 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1228 return __detail::__cyl_neumann_n<__type>(__nu, __x);
1232 ellint_1f(float __k, float __phi)
1233 { return __detail::__ellint_1<float>(__k, __phi); }
1236 ellint_1l(long double __k, long double __phi)
1237 { return __detail::__ellint_1<long double>(__k, __phi); }
1239 /// 5.2.1.12 Incomplete elliptic integrals of the first kind.
1240 template<typename _Tp, typename _Tpp>
1241 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1242 ellint_1(_Tp __k, _Tpp __phi)
1244 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1245 return __detail::__ellint_1<__type>(__k, __phi);
1249 ellint_2f(float __k, float __phi)
1250 { return __detail::__ellint_2<float>(__k, __phi); }
1253 ellint_2l(long double __k, long double __phi)
1254 { return __detail::__ellint_2<long double>(__k, __phi); }
1256 /// 5.2.1.13 Incomplete elliptic integrals of the second kind.
1257 template<typename _Tp, typename _Tpp>
1258 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1259 ellint_2(_Tp __k, _Tpp __phi)
1261 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1262 return __detail::__ellint_2<__type>(__k, __phi);
1266 ellint_3f(float __k, float __nu, float __phi)
1267 { return __detail::__ellint_3<float>(__k, __nu, __phi); }
1270 ellint_3l(long double __k, long double __nu, long double __phi)
1271 { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
1273 /// 5.2.1.14 Incomplete elliptic integrals of the third kind.
1274 template<typename _Tp, typename _Tpn, typename _Tpp>
1275 inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
1276 ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
1278 typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
1279 return __detail::__ellint_3<__type>(__k, __nu, __phi);
1284 { return __detail::__expint<float>(__x); }
1287 expintl(long double __x)
1288 { return __detail::__expint<long double>(__x); }
1290 /// 5.2.1.15 Exponential integrals.
1291 template<typename _Tp>
1292 inline typename __gnu_cxx::__promote<_Tp>::__type
1295 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1296 return __detail::__expint<__type>(__x);
1300 hermitef(unsigned int __n, float __x)
1301 { return __detail::__poly_hermite<float>(__n, __x); }
1304 hermitel(unsigned int __n, long double __x)
1305 { return __detail::__poly_hermite<long double>(__n, __x); }
1307 /// 5.2.1.16 Hermite polynomials.
1308 template<typename _Tp>
1309 inline typename __gnu_cxx::__promote<_Tp>::__type
1310 hermite(unsigned int __n, _Tp __x)
1312 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1313 return __detail::__poly_hermite<__type>(__n, __x);
1317 hypergf(float __a, float __b, float __c, float __x)
1318 { return __detail::__hyperg<float>(__a, __b, __c, __x); }
1321 hypergl(long double __a, long double __b, long double __c, long double __x)
1322 { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
1324 /// 5.2.1.17 Hypergeometric functions.
1325 template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
1326 inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
1327 hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
1329 typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
1330 return __detail::__hyperg<__type>(__a, __b, __c, __x);
1334 laguerref(unsigned int __n, float __x)
1335 { return __detail::__laguerre<float>(__n, __x); }
1338 laguerrel(unsigned int __n, long double __x)
1339 { return __detail::__laguerre<long double>(__n, __x); }
1341 /// 5.2.1.18 Laguerre polynomials.
1342 template<typename _Tp>
1343 inline typename __gnu_cxx::__promote<_Tp>::__type
1344 laguerre(unsigned int __n, _Tp __x)
1346 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1347 return __detail::__laguerre<__type>(__n, __x);
1351 legendref(unsigned int __n, float __x)
1352 { return __detail::__poly_legendre_p<float>(__n, __x); }
1355 legendrel(unsigned int __n, long double __x)
1356 { return __detail::__poly_legendre_p<long double>(__n, __x); }
1358 /// 5.2.1.19 Legendre polynomials.
1359 template<typename _Tp>
1360 inline typename __gnu_cxx::__promote<_Tp>::__type
1361 legendre(unsigned int __n, _Tp __x)
1363 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1364 return __detail::__poly_legendre_p<__type>(__n, __x);
1368 riemann_zetaf(float __x)
1369 { return __detail::__riemann_zeta<float>(__x); }
1372 riemann_zetal(long double __x)
1373 { return __detail::__riemann_zeta<long double>(__x); }
1375 /// 5.2.1.20 Riemann zeta function.
1376 template<typename _Tp>
1377 inline typename __gnu_cxx::__promote<_Tp>::__type
1378 riemann_zeta(_Tp __x)
1380 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1381 return __detail::__riemann_zeta<__type>(__x);
1385 sph_besself(unsigned int __n, float __x)
1386 { return __detail::__sph_bessel<float>(__n, __x); }
1389 sph_bessell(unsigned int __n, long double __x)
1390 { return __detail::__sph_bessel<long double>(__n, __x); }
1392 /// 5.2.1.21 Spherical Bessel functions.
1393 template<typename _Tp>
1394 inline typename __gnu_cxx::__promote<_Tp>::__type
1395 sph_bessel(unsigned int __n, _Tp __x)
1397 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1398 return __detail::__sph_bessel<__type>(__n, __x);
1402 sph_legendref(unsigned int __l, unsigned int __m, float __theta)
1403 { return __detail::__sph_legendre<float>(__l, __m, __theta); }
1406 sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
1407 { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
1409 /// 5.2.1.22 Spherical associated Legendre functions.
1410 template<typename _Tp>
1411 inline typename __gnu_cxx::__promote<_Tp>::__type
1412 sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
1414 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1415 return __detail::__sph_legendre<__type>(__l, __m, __theta);
1419 sph_neumannf(unsigned int __n, float __x)
1420 { return __detail::__sph_neumann<float>(__n, __x); }
1423 sph_neumannl(unsigned int __n, long double __x)
1424 { return __detail::__sph_neumann<long double>(__n, __x); }
1426 /// 5.2.1.23 Spherical Neumann functions.
1427 template<typename _Tp>
1428 inline typename __gnu_cxx::__promote<_Tp>::__type
1429 sph_neumann(unsigned int __n, _Tp __x)
1431 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1432 return __detail::__sph_neumann<__type>(__n, __x);
1435 /* @} */ // tr1_math_spec_func
1436 _GLIBCXX_END_NAMESPACE_VERSION
1440 #endif // _GLIBCXX_TR1_CMATH