1 // TR1 cmath -*- C++ -*-
3 // Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
27 * This is a TR1 C++ Library header.
30 #ifndef _GLIBCXX_TR1_CMATH
31 #define _GLIBCXX_TR1_CMATH 1
33 #pragma GCC system_header
37 #ifdef _GLIBCXX_USE_C99_MATH_TR1
147 namespace std _GLIBCXX_VISIBILITY(default)
151 _GLIBCXX_BEGIN_NAMESPACE_VERSION
153 #if _GLIBCXX_USE_C99_MATH_TR1
302 #if _GLIBCXX_USE_C99_MATH
303 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
305 /// Function template definitions [8.16.3].
306 template<typename _Tp>
307 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
311 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
312 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
313 FP_SUBNORMAL, FP_ZERO, __type(__f));
316 template<typename _Tp>
317 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
321 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
322 return __builtin_isfinite(__type(__f));
325 template<typename _Tp>
326 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
330 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
331 return __builtin_isinf(__type(__f));
334 template<typename _Tp>
335 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
339 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
340 return __builtin_isnan(__type(__f));
343 template<typename _Tp>
344 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
348 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
349 return __builtin_isnormal(__type(__f));
352 template<typename _Tp>
353 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
357 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
358 return __builtin_signbit(__type(__f));
361 template<typename _Tp>
362 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
364 isgreater(_Tp __f1, _Tp __f2)
366 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
367 return __builtin_isgreater(__type(__f1), __type(__f2));
370 template<typename _Tp>
371 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
373 isgreaterequal(_Tp __f1, _Tp __f2)
375 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
376 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
379 template<typename _Tp>
380 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
382 isless(_Tp __f1, _Tp __f2)
384 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
385 return __builtin_isless(__type(__f1), __type(__f2));
388 template<typename _Tp>
389 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
391 islessequal(_Tp __f1, _Tp __f2)
393 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
394 return __builtin_islessequal(__type(__f1), __type(__f2));
397 template<typename _Tp>
398 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
400 islessgreater(_Tp __f1, _Tp __f2)
402 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
403 return __builtin_islessgreater(__type(__f1), __type(__f2));
406 template<typename _Tp>
407 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
409 isunordered(_Tp __f1, _Tp __f2)
411 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
412 return __builtin_isunordered(__type(__f1), __type(__f2));
418 #if _GLIBCXX_USE_C99_MATH_TR1
420 /// Additional overloads [8.16.4].
425 { return __builtin_acoshf(__x); }
428 acosh(long double __x)
429 { return __builtin_acoshl(__x); }
431 template<typename _Tp>
432 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
435 { return __builtin_acosh(__x); }
441 { return __builtin_asinhf(__x); }
444 asinh(long double __x)
445 { return __builtin_asinhl(__x); }
447 template<typename _Tp>
448 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
451 { return __builtin_asinh(__x); }
458 { return __builtin_atanhf(__x); }
461 atanh(long double __x)
462 { return __builtin_atanhl(__x); }
464 template<typename _Tp>
465 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
468 { return __builtin_atanh(__x); }
472 { return __builtin_cbrtf(__x); }
475 cbrt(long double __x)
476 { return __builtin_cbrtl(__x); }
478 template<typename _Tp>
479 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
482 { return __builtin_cbrt(__x); }
487 copysign(float __x, float __y)
488 { return __builtin_copysignf(__x, __y); }
491 copysign(long double __x, long double __y)
492 { return __builtin_copysignl(__x, __y); }
494 template<typename _Tp, typename _Up>
495 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
496 copysign(_Tp __x, _Up __y)
498 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
499 return copysign(__type(__x), __type(__y));
507 { return __builtin_erff(__x); }
511 { return __builtin_erfl(__x); }
513 template<typename _Tp>
514 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
517 { return __builtin_erf(__x); }
521 { return __builtin_erfcf(__x); }
524 erfc(long double __x)
525 { return __builtin_erfcl(__x); }
527 template<typename _Tp>
528 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
531 { return __builtin_erfc(__x); }
537 { return __builtin_exp2f(__x); }
540 exp2(long double __x)
541 { return __builtin_exp2l(__x); }
543 template<typename _Tp>
544 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
547 { return __builtin_exp2(__x); }
551 { return __builtin_expm1f(__x); }
554 expm1(long double __x)
555 { return __builtin_expm1l(__x); }
557 template<typename _Tp>
558 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
561 { return __builtin_expm1(__x); }
563 // Note: we deal with fabs in a special way, because an using std::fabs
564 // would bring in also the overloads for complex types, which in C++0x
565 // mode have a different return type.
566 // With __CORRECT_ISO_CPP_MATH_H_PROTO1, math.h imports std::fabs in the
567 // global namespace after the declarations of the float / double / long
568 // double overloads but before the std::complex overloads.
571 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
574 { return __builtin_fabsf(__x); }
577 fabs(long double __x)
578 { return __builtin_fabsl(__x); }
580 template<typename _Tp>
581 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
584 { return __builtin_fabs(__x); }
588 fdim(float __x, float __y)
589 { return __builtin_fdimf(__x, __y); }
592 fdim(long double __x, long double __y)
593 { return __builtin_fdiml(__x, __y); }
595 template<typename _Tp, typename _Up>
596 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
597 fdim(_Tp __x, _Up __y)
599 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
600 return fdim(__type(__x), __type(__y));
606 fma(float __x, float __y, float __z)
607 { return __builtin_fmaf(__x, __y, __z); }
610 fma(long double __x, long double __y, long double __z)
611 { return __builtin_fmal(__x, __y, __z); }
613 template<typename _Tp, typename _Up, typename _Vp>
614 inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
615 fma(_Tp __x, _Up __y, _Vp __z)
617 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
618 return fma(__type(__x), __type(__y), __type(__z));
622 fmax(float __x, float __y)
623 { return __builtin_fmaxf(__x, __y); }
626 fmax(long double __x, long double __y)
627 { return __builtin_fmaxl(__x, __y); }
629 template<typename _Tp, typename _Up>
630 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
631 fmax(_Tp __x, _Up __y)
633 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
634 return fmax(__type(__x), __type(__y));
638 fmin(float __x, float __y)
639 { return __builtin_fminf(__x, __y); }
642 fmin(long double __x, long double __y)
643 { return __builtin_fminl(__x, __y); }
645 template<typename _Tp, typename _Up>
646 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
647 fmin(_Tp __x, _Up __y)
649 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
650 return fmin(__type(__x), __type(__y));
657 hypot(float __x, float __y)
658 { return __builtin_hypotf(__x, __y); }
661 hypot(long double __x, long double __y)
662 { return __builtin_hypotl(__x, __y); }
664 template<typename _Tp, typename _Up>
665 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
666 hypot(_Tp __y, _Up __x)
668 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
669 return hypot(__type(__y), __type(__x));
674 { return __builtin_ilogbf(__x); }
677 ilogb(long double __x)
678 { return __builtin_ilogbl(__x); }
680 template<typename _Tp>
681 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
684 { return __builtin_ilogb(__x); }
690 { return __builtin_lgammaf(__x); }
693 lgamma(long double __x)
694 { return __builtin_lgammal(__x); }
696 template<typename _Tp>
697 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
700 { return __builtin_lgamma(__x); }
704 { return __builtin_llrintf(__x); }
707 llrint(long double __x)
708 { return __builtin_llrintl(__x); }
710 template<typename _Tp>
711 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
714 { return __builtin_llrint(__x); }
718 { return __builtin_llroundf(__x); }
721 llround(long double __x)
722 { return __builtin_llroundl(__x); }
724 template<typename _Tp>
725 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
728 { return __builtin_llround(__x); }
735 { return __builtin_log1pf(__x); }
738 log1p(long double __x)
739 { return __builtin_log1pl(__x); }
741 template<typename _Tp>
742 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
745 { return __builtin_log1p(__x); }
750 { return __builtin_log2f(__x); }
753 log2(long double __x)
754 { return __builtin_log2l(__x); }
756 template<typename _Tp>
757 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
760 { return __builtin_log2(__x); }
764 { return __builtin_logbf(__x); }
767 logb(long double __x)
768 { return __builtin_logbl(__x); }
770 template<typename _Tp>
771 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
775 return __builtin_logb(__x);
780 { return __builtin_lrintf(__x); }
783 lrint(long double __x)
784 { return __builtin_lrintl(__x); }
786 template<typename _Tp>
787 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
790 { return __builtin_lrint(__x); }
794 { return __builtin_lroundf(__x); }
797 lround(long double __x)
798 { return __builtin_lroundl(__x); }
800 template<typename _Tp>
801 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
804 { return __builtin_lround(__x); }
808 { return __builtin_nearbyintf(__x); }
811 nearbyint(long double __x)
812 { return __builtin_nearbyintl(__x); }
814 template<typename _Tp>
815 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
818 { return __builtin_nearbyint(__x); }
821 nextafter(float __x, float __y)
822 { return __builtin_nextafterf(__x, __y); }
825 nextafter(long double __x, long double __y)
826 { return __builtin_nextafterl(__x, __y); }
828 template<typename _Tp, typename _Up>
829 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
830 nextafter(_Tp __x, _Up __y)
832 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
833 return nextafter(__type(__x), __type(__y));
837 nexttoward(float __x, long double __y)
838 { return __builtin_nexttowardf(__x, __y); }
841 nexttoward(long double __x, long double __y)
842 { return __builtin_nexttowardl(__x, __y); }
844 template<typename _Tp>
845 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
847 nexttoward(_Tp __x, long double __y)
848 { return __builtin_nexttoward(__x, __y); }
850 // DR 550. What should the return type of pow(float,int) be?
851 // NB: C++0x and TR1 != C++03.
855 remainder(float __x, float __y)
856 { return __builtin_remainderf(__x, __y); }
859 remainder(long double __x, long double __y)
860 { return __builtin_remainderl(__x, __y); }
862 template<typename _Tp, typename _Up>
863 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
864 remainder(_Tp __x, _Up __y)
866 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
867 return remainder(__type(__x), __type(__y));
871 remquo(float __x, float __y, int* __pquo)
872 { return __builtin_remquof(__x, __y, __pquo); }
875 remquo(long double __x, long double __y, int* __pquo)
876 { return __builtin_remquol(__x, __y, __pquo); }
878 template<typename _Tp, typename _Up>
879 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
880 remquo(_Tp __x, _Up __y, int* __pquo)
882 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
883 return remquo(__type(__x), __type(__y), __pquo);
888 { return __builtin_rintf(__x); }
891 rint(long double __x)
892 { return __builtin_rintl(__x); }
894 template<typename _Tp>
895 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
898 { return __builtin_rint(__x); }
902 { return __builtin_roundf(__x); }
905 round(long double __x)
906 { return __builtin_roundl(__x); }
908 template<typename _Tp>
909 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
912 { return __builtin_round(__x); }
915 scalbln(float __x, long __ex)
916 { return __builtin_scalblnf(__x, __ex); }
919 scalbln(long double __x, long __ex)
920 { return __builtin_scalblnl(__x, __ex); }
922 template<typename _Tp>
923 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
925 scalbln(_Tp __x, long __ex)
926 { return __builtin_scalbln(__x, __ex); }
929 scalbn(float __x, int __ex)
930 { return __builtin_scalbnf(__x, __ex); }
933 scalbn(long double __x, int __ex)
934 { return __builtin_scalbnl(__x, __ex); }
936 template<typename _Tp>
937 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
939 scalbn(_Tp __x, int __ex)
940 { return __builtin_scalbn(__x, __ex); }
950 { return __builtin_tgammaf(__x); }
953 tgamma(long double __x)
954 { return __builtin_tgammal(__x); }
956 template<typename _Tp>
957 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
960 { return __builtin_tgamma(__x); }
964 { return __builtin_truncf(__x); }
967 trunc(long double __x)
968 { return __builtin_truncl(__x); }
970 template<typename _Tp>
971 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
974 { return __builtin_trunc(__x); }
977 _GLIBCXX_END_NAMESPACE_VERSION
981 namespace std _GLIBCXX_VISIBILITY(default)
985 _GLIBCXX_BEGIN_NAMESPACE_VERSION
987 // DR 550. What should the return type of pow(float,int) be?
988 // NB: C++0x and TR1 != C++03.
990 pow(double __x, double __y)
991 { return std::pow(__x, __y); }
994 pow(float __x, float __y)
995 { return std::pow(__x, __y); }
998 pow(long double __x, long double __y)
999 { return std::pow(__x, __y); }
1001 template<typename _Tp, typename _Up>
1002 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1003 pow(_Tp __x, _Up __y)
1005 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1006 return std::pow(__type(__x), __type(__y));
1009 _GLIBCXX_END_NAMESPACE_VERSION
1013 #include <bits/stl_algobase.h>
1015 #include <tr1/type_traits>
1017 #include <tr1/gamma.tcc>
1018 #include <tr1/bessel_function.tcc>
1019 #include <tr1/beta_function.tcc>
1020 #include <tr1/ell_integral.tcc>
1021 #include <tr1/exp_integral.tcc>
1022 #include <tr1/hypergeometric.tcc>
1023 #include <tr1/legendre_function.tcc>
1024 #include <tr1/modified_bessel_func.tcc>
1025 #include <tr1/poly_hermite.tcc>
1026 #include <tr1/poly_laguerre.tcc>
1027 #include <tr1/riemann_zeta.tcc>
1029 namespace std _GLIBCXX_VISIBILITY(default)
1033 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1036 * @defgroup tr1_math_spec_func Mathematical Special Functions
1039 * A collection of advanced mathematical special functions.
1044 assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
1045 { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
1048 assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
1050 return __detail::__assoc_laguerre<long double>(__n, __m, __x);
1053 /// 5.2.1.1 Associated Laguerre polynomials.
1054 template<typename _Tp>
1055 inline typename __gnu_cxx::__promote<_Tp>::__type
1056 assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
1058 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1059 return __detail::__assoc_laguerre<__type>(__n, __m, __x);
1063 assoc_legendref(unsigned int __l, unsigned int __m, float __x)
1064 { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
1067 assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
1068 { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
1070 /// 5.2.1.2 Associated Legendre functions.
1071 template<typename _Tp>
1072 inline typename __gnu_cxx::__promote<_Tp>::__type
1073 assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
1075 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1076 return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
1080 betaf(float __x, float __y)
1081 { return __detail::__beta<float>(__x, __y); }
1084 betal(long double __x, long double __y)
1085 { return __detail::__beta<long double>(__x, __y); }
1087 /// 5.2.1.3 Beta functions.
1088 template<typename _Tpx, typename _Tpy>
1089 inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
1090 beta(_Tpx __x, _Tpy __y)
1092 typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
1093 return __detail::__beta<__type>(__x, __y);
1097 comp_ellint_1f(float __k)
1098 { return __detail::__comp_ellint_1<float>(__k); }
1101 comp_ellint_1l(long double __k)
1102 { return __detail::__comp_ellint_1<long double>(__k); }
1104 /// 5.2.1.4 Complete elliptic integrals of the first kind.
1105 template<typename _Tp>
1106 inline typename __gnu_cxx::__promote<_Tp>::__type
1107 comp_ellint_1(_Tp __k)
1109 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1110 return __detail::__comp_ellint_1<__type>(__k);
1114 comp_ellint_2f(float __k)
1115 { return __detail::__comp_ellint_2<float>(__k); }
1118 comp_ellint_2l(long double __k)
1119 { return __detail::__comp_ellint_2<long double>(__k); }
1121 /// 5.2.1.5 Complete elliptic integrals of the second kind.
1122 template<typename _Tp>
1123 inline typename __gnu_cxx::__promote<_Tp>::__type
1124 comp_ellint_2(_Tp __k)
1126 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1127 return __detail::__comp_ellint_2<__type>(__k);
1131 comp_ellint_3f(float __k, float __nu)
1132 { return __detail::__comp_ellint_3<float>(__k, __nu); }
1135 comp_ellint_3l(long double __k, long double __nu)
1136 { return __detail::__comp_ellint_3<long double>(__k, __nu); }
1138 /// 5.2.1.6 Complete elliptic integrals of the third kind.
1139 template<typename _Tp, typename _Tpn>
1140 inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
1141 comp_ellint_3(_Tp __k, _Tpn __nu)
1143 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
1144 return __detail::__comp_ellint_3<__type>(__k, __nu);
1148 conf_hypergf(float __a, float __c, float __x)
1149 { return __detail::__conf_hyperg<float>(__a, __c, __x); }
1152 conf_hypergl(long double __a, long double __c, long double __x)
1153 { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
1155 /// 5.2.1.7 Confluent hypergeometric functions.
1156 template<typename _Tpa, typename _Tpc, typename _Tp>
1157 inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
1158 conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
1160 typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
1161 return __detail::__conf_hyperg<__type>(__a, __c, __x);
1165 cyl_bessel_if(float __nu, float __x)
1166 { return __detail::__cyl_bessel_i<float>(__nu, __x); }
1169 cyl_bessel_il(long double __nu, long double __x)
1170 { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
1172 /// 5.2.1.8 Regular modified cylindrical Bessel functions.
1173 template<typename _Tpnu, typename _Tp>
1174 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1175 cyl_bessel_i(_Tpnu __nu, _Tp __x)
1177 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1178 return __detail::__cyl_bessel_i<__type>(__nu, __x);
1182 cyl_bessel_jf(float __nu, float __x)
1183 { return __detail::__cyl_bessel_j<float>(__nu, __x); }
1186 cyl_bessel_jl(long double __nu, long double __x)
1187 { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
1189 /// 5.2.1.9 Cylindrical Bessel functions (of the first kind).
1190 template<typename _Tpnu, typename _Tp>
1191 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1192 cyl_bessel_j(_Tpnu __nu, _Tp __x)
1194 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1195 return __detail::__cyl_bessel_j<__type>(__nu, __x);
1199 cyl_bessel_kf(float __nu, float __x)
1200 { return __detail::__cyl_bessel_k<float>(__nu, __x); }
1203 cyl_bessel_kl(long double __nu, long double __x)
1204 { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
1206 /// 5.2.1.10 Irregular modified cylindrical Bessel functions.
1207 template<typename _Tpnu, typename _Tp>
1208 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1209 cyl_bessel_k(_Tpnu __nu, _Tp __x)
1211 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1212 return __detail::__cyl_bessel_k<__type>(__nu, __x);
1216 cyl_neumannf(float __nu, float __x)
1217 { return __detail::__cyl_neumann_n<float>(__nu, __x); }
1220 cyl_neumannl(long double __nu, long double __x)
1221 { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
1223 /// 5.2.1.11 Cylindrical Neumann functions.
1224 template<typename _Tpnu, typename _Tp>
1225 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1226 cyl_neumann(_Tpnu __nu, _Tp __x)
1228 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1229 return __detail::__cyl_neumann_n<__type>(__nu, __x);
1233 ellint_1f(float __k, float __phi)
1234 { return __detail::__ellint_1<float>(__k, __phi); }
1237 ellint_1l(long double __k, long double __phi)
1238 { return __detail::__ellint_1<long double>(__k, __phi); }
1240 /// 5.2.1.12 Incomplete elliptic integrals of the first kind.
1241 template<typename _Tp, typename _Tpp>
1242 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1243 ellint_1(_Tp __k, _Tpp __phi)
1245 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1246 return __detail::__ellint_1<__type>(__k, __phi);
1250 ellint_2f(float __k, float __phi)
1251 { return __detail::__ellint_2<float>(__k, __phi); }
1254 ellint_2l(long double __k, long double __phi)
1255 { return __detail::__ellint_2<long double>(__k, __phi); }
1257 /// 5.2.1.13 Incomplete elliptic integrals of the second kind.
1258 template<typename _Tp, typename _Tpp>
1259 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1260 ellint_2(_Tp __k, _Tpp __phi)
1262 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1263 return __detail::__ellint_2<__type>(__k, __phi);
1267 ellint_3f(float __k, float __nu, float __phi)
1268 { return __detail::__ellint_3<float>(__k, __nu, __phi); }
1271 ellint_3l(long double __k, long double __nu, long double __phi)
1272 { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
1274 /// 5.2.1.14 Incomplete elliptic integrals of the third kind.
1275 template<typename _Tp, typename _Tpn, typename _Tpp>
1276 inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
1277 ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
1279 typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
1280 return __detail::__ellint_3<__type>(__k, __nu, __phi);
1285 { return __detail::__expint<float>(__x); }
1288 expintl(long double __x)
1289 { return __detail::__expint<long double>(__x); }
1291 /// 5.2.1.15 Exponential integrals.
1292 template<typename _Tp>
1293 inline typename __gnu_cxx::__promote<_Tp>::__type
1296 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1297 return __detail::__expint<__type>(__x);
1301 hermitef(unsigned int __n, float __x)
1302 { return __detail::__poly_hermite<float>(__n, __x); }
1305 hermitel(unsigned int __n, long double __x)
1306 { return __detail::__poly_hermite<long double>(__n, __x); }
1308 /// 5.2.1.16 Hermite polynomials.
1309 template<typename _Tp>
1310 inline typename __gnu_cxx::__promote<_Tp>::__type
1311 hermite(unsigned int __n, _Tp __x)
1313 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1314 return __detail::__poly_hermite<__type>(__n, __x);
1318 hypergf(float __a, float __b, float __c, float __x)
1319 { return __detail::__hyperg<float>(__a, __b, __c, __x); }
1322 hypergl(long double __a, long double __b, long double __c, long double __x)
1323 { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
1325 /// 5.2.1.17 Hypergeometric functions.
1326 template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
1327 inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
1328 hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
1330 typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
1331 return __detail::__hyperg<__type>(__a, __b, __c, __x);
1335 laguerref(unsigned int __n, float __x)
1336 { return __detail::__laguerre<float>(__n, __x); }
1339 laguerrel(unsigned int __n, long double __x)
1340 { return __detail::__laguerre<long double>(__n, __x); }
1342 /// 5.2.1.18 Laguerre polynomials.
1343 template<typename _Tp>
1344 inline typename __gnu_cxx::__promote<_Tp>::__type
1345 laguerre(unsigned int __n, _Tp __x)
1347 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1348 return __detail::__laguerre<__type>(__n, __x);
1352 legendref(unsigned int __n, float __x)
1353 { return __detail::__poly_legendre_p<float>(__n, __x); }
1356 legendrel(unsigned int __n, long double __x)
1357 { return __detail::__poly_legendre_p<long double>(__n, __x); }
1359 /// 5.2.1.19 Legendre polynomials.
1360 template<typename _Tp>
1361 inline typename __gnu_cxx::__promote<_Tp>::__type
1362 legendre(unsigned int __n, _Tp __x)
1364 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1365 return __detail::__poly_legendre_p<__type>(__n, __x);
1369 riemann_zetaf(float __x)
1370 { return __detail::__riemann_zeta<float>(__x); }
1373 riemann_zetal(long double __x)
1374 { return __detail::__riemann_zeta<long double>(__x); }
1376 /// 5.2.1.20 Riemann zeta function.
1377 template<typename _Tp>
1378 inline typename __gnu_cxx::__promote<_Tp>::__type
1379 riemann_zeta(_Tp __x)
1381 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1382 return __detail::__riemann_zeta<__type>(__x);
1386 sph_besself(unsigned int __n, float __x)
1387 { return __detail::__sph_bessel<float>(__n, __x); }
1390 sph_bessell(unsigned int __n, long double __x)
1391 { return __detail::__sph_bessel<long double>(__n, __x); }
1393 /// 5.2.1.21 Spherical Bessel functions.
1394 template<typename _Tp>
1395 inline typename __gnu_cxx::__promote<_Tp>::__type
1396 sph_bessel(unsigned int __n, _Tp __x)
1398 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1399 return __detail::__sph_bessel<__type>(__n, __x);
1403 sph_legendref(unsigned int __l, unsigned int __m, float __theta)
1404 { return __detail::__sph_legendre<float>(__l, __m, __theta); }
1407 sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
1408 { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
1410 /// 5.2.1.22 Spherical associated Legendre functions.
1411 template<typename _Tp>
1412 inline typename __gnu_cxx::__promote<_Tp>::__type
1413 sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
1415 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1416 return __detail::__sph_legendre<__type>(__l, __m, __theta);
1420 sph_neumannf(unsigned int __n, float __x)
1421 { return __detail::__sph_neumann<float>(__n, __x); }
1424 sph_neumannl(unsigned int __n, long double __x)
1425 { return __detail::__sph_neumann<long double>(__n, __x); }
1427 /// 5.2.1.23 Spherical Neumann functions.
1428 template<typename _Tp>
1429 inline typename __gnu_cxx::__promote<_Tp>::__type
1430 sph_neumann(unsigned int __n, _Tp __x)
1432 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1433 return __detail::__sph_neumann<__type>(__n, __x);
1436 /* @} */ // tr1_math_spec_func
1437 _GLIBCXX_END_NAMESPACE_VERSION
1441 #endif // _GLIBCXX_TR1_CMATH