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)
148 _GLIBCXX_BEGIN_NAMESPACE_VERSION
152 #if _GLIBCXX_USE_C99_MATH_TR1
303 #if _GLIBCXX_USE_C99_MATH
304 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
307 template<
typename _Tp>
308 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
312 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
313 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
314 FP_SUBNORMAL, FP_ZERO, __type(__f));
317 template<
typename _Tp>
318 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
322 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
323 return __builtin_isfinite(__type(__f));
326 template<
typename _Tp>
327 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
331 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
332 return __builtin_isinf(__type(__f));
335 template<
typename _Tp>
336 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
340 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
341 return __builtin_isnan(__type(__f));
344 template<
typename _Tp>
345 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
349 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
350 return __builtin_isnormal(__type(__f));
353 template<
typename _Tp>
354 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
358 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
359 return __builtin_signbit(__type(__f));
362 template<
typename _Tp>
363 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
365 isgreater(_Tp __f1, _Tp __f2)
367 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
368 return __builtin_isgreater(__type(__f1), __type(__f2));
371 template<
typename _Tp>
372 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
374 isgreaterequal(_Tp __f1, _Tp __f2)
376 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
377 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
380 template<
typename _Tp>
381 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
383 isless(_Tp __f1, _Tp __f2)
385 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
386 return __builtin_isless(__type(__f1), __type(__f2));
389 template<
typename _Tp>
390 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
392 islessequal(_Tp __f1, _Tp __f2)
394 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
395 return __builtin_islessequal(__type(__f1), __type(__f2));
398 template<
typename _Tp>
399 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
401 islessgreater(_Tp __f1, _Tp __f2)
403 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
404 return __builtin_islessgreater(__type(__f1), __type(__f2));
407 template<
typename _Tp>
408 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
410 isunordered(_Tp __f1, _Tp __f2)
412 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
413 return __builtin_isunordered(__type(__f1), __type(__f2));
419 #if _GLIBCXX_USE_C99_MATH_TR1
448 #if __cplusplus >= 201103L
477 using std::nearbyint;
478 using std::nextafter;
479 using std::nexttoward;
480 using std::remainder;
489 #else // __cplusplus < 201103L
493 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
496 {
return __builtin_acoshf(__x); }
499 acosh(
long double __x)
500 {
return __builtin_acoshl(__x); }
503 template<
typename _Tp>
504 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
507 {
return __builtin_acosh(__x); }
509 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
512 {
return __builtin_asinhf(__x); }
515 asinh(
long double __x)
516 {
return __builtin_asinhl(__x); }
519 template<
typename _Tp>
520 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
523 {
return __builtin_asinh(__x); }
525 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
528 {
return __builtin_atanhf(__x); }
531 atanh(
long double __x)
532 {
return __builtin_atanhl(__x); }
535 template<
typename _Tp>
536 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
539 {
return __builtin_atanh(__x); }
541 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
544 {
return __builtin_cbrtf(__x); }
547 cbrt(
long double __x)
548 {
return __builtin_cbrtl(__x); }
551 template<
typename _Tp>
552 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
555 {
return __builtin_cbrt(__x); }
557 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
559 copysign(
float __x,
float __y)
560 {
return __builtin_copysignf(__x, __y); }
563 copysign(
long double __x,
long double __y)
564 {
return __builtin_copysignl(__x, __y); }
567 template<
typename _Tp,
typename _Up>
568 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
569 copysign(_Tp __x, _Up __y)
571 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
572 return copysign(__type(__x), __type(__y));
575 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
578 {
return __builtin_erff(__x); }
582 {
return __builtin_erfl(__x); }
585 template<
typename _Tp>
586 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
589 {
return __builtin_erf(__x); }
591 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
594 {
return __builtin_erfcf(__x); }
597 erfc(
long double __x)
598 {
return __builtin_erfcl(__x); }
601 template<
typename _Tp>
602 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
605 {
return __builtin_erfc(__x); }
607 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
610 {
return __builtin_exp2f(__x); }
613 exp2(
long double __x)
614 {
return __builtin_exp2l(__x); }
617 template<
typename _Tp>
618 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
621 {
return __builtin_exp2(__x); }
623 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
626 {
return __builtin_expm1f(__x); }
629 expm1(
long double __x)
630 {
return __builtin_expm1l(__x); }
633 template<
typename _Tp>
634 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
637 {
return __builtin_expm1(__x); }
639 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
641 fdim(
float __x,
float __y)
642 {
return __builtin_fdimf(__x, __y); }
645 fdim(
long double __x,
long double __y)
646 {
return __builtin_fdiml(__x, __y); }
649 template<
typename _Tp,
typename _Up>
650 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
651 fdim(_Tp __x, _Up __y)
653 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
654 return fdim(__type(__x), __type(__y));
657 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
659 fma(
float __x,
float __y,
float __z)
660 {
return __builtin_fmaf(__x, __y, __z); }
663 fma(
long double __x,
long double __y,
long double __z)
664 {
return __builtin_fmal(__x, __y, __z); }
667 template<
typename _Tp,
typename _Up,
typename _Vp>
668 inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
669 fma(_Tp __x, _Up __y, _Vp __z)
671 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
672 return fma(__type(__x), __type(__y), __type(__z));
675 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
677 fmax(
float __x,
float __y)
678 {
return __builtin_fmaxf(__x, __y); }
681 fmax(
long double __x,
long double __y)
682 {
return __builtin_fmaxl(__x, __y); }
685 template<
typename _Tp,
typename _Up>
686 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
687 fmax(_Tp __x, _Up __y)
689 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
690 return fmax(__type(__x), __type(__y));
693 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
695 fmin(
float __x,
float __y)
696 {
return __builtin_fminf(__x, __y); }
699 fmin(
long double __x,
long double __y)
700 {
return __builtin_fminl(__x, __y); }
703 template<
typename _Tp,
typename _Up>
704 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
705 fmin(_Tp __x, _Up __y)
707 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
708 return fmin(__type(__x), __type(__y));
711 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
713 hypot(
float __x,
float __y)
714 {
return __builtin_hypotf(__x, __y); }
717 hypot(
long double __x,
long double __y)
718 {
return __builtin_hypotl(__x, __y); }
721 template<
typename _Tp,
typename _Up>
722 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
723 hypot(_Tp __y, _Up __x)
725 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
726 return hypot(__type(__y), __type(__x));
729 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
732 {
return __builtin_ilogbf(__x); }
735 ilogb(
long double __x)
736 {
return __builtin_ilogbl(__x); }
739 template<
typename _Tp>
740 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
743 {
return __builtin_ilogb(__x); }
745 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
748 {
return __builtin_lgammaf(__x); }
751 lgamma(
long double __x)
752 {
return __builtin_lgammal(__x); }
755 template<
typename _Tp>
756 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
759 {
return __builtin_lgamma(__x); }
761 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
764 {
return __builtin_llrintf(__x); }
767 llrint(
long double __x)
768 {
return __builtin_llrintl(__x); }
771 template<
typename _Tp>
772 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
775 {
return __builtin_llrint(__x); }
777 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
780 {
return __builtin_llroundf(__x); }
783 llround(
long double __x)
784 {
return __builtin_llroundl(__x); }
787 template<
typename _Tp>
788 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
791 {
return __builtin_llround(__x); }
793 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
796 {
return __builtin_log1pf(__x); }
799 log1p(
long double __x)
800 {
return __builtin_log1pl(__x); }
803 template<
typename _Tp>
804 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
807 {
return __builtin_log1p(__x); }
810 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
813 {
return __builtin_log2f(__x); }
816 log2(
long double __x)
817 {
return __builtin_log2l(__x); }
820 template<
typename _Tp>
821 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
824 {
return __builtin_log2(__x); }
826 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
829 {
return __builtin_logbf(__x); }
832 logb(
long double __x)
833 {
return __builtin_logbl(__x); }
836 template<
typename _Tp>
837 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
841 return __builtin_logb(__x);
844 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
847 {
return __builtin_lrintf(__x); }
850 lrint(
long double __x)
851 {
return __builtin_lrintl(__x); }
854 template<
typename _Tp>
855 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
858 {
return __builtin_lrint(__x); }
860 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
863 {
return __builtin_lroundf(__x); }
866 lround(
long double __x)
867 {
return __builtin_lroundl(__x); }
870 template<
typename _Tp>
871 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
874 {
return __builtin_lround(__x); }
876 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
879 {
return __builtin_nearbyintf(__x); }
882 nearbyint(
long double __x)
883 {
return __builtin_nearbyintl(__x); }
886 template<
typename _Tp>
887 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
890 {
return __builtin_nearbyint(__x); }
892 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
894 nextafter(
float __x,
float __y)
895 {
return __builtin_nextafterf(__x, __y); }
898 nextafter(
long double __x,
long double __y)
899 {
return __builtin_nextafterl(__x, __y); }
902 template<
typename _Tp,
typename _Up>
903 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
904 nextafter(_Tp __x, _Up __y)
906 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
907 return nextafter(__type(__x), __type(__y));
910 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
912 nexttoward(
float __x,
long double __y)
913 {
return __builtin_nexttowardf(__x, __y); }
916 nexttoward(
long double __x,
long double __y)
917 {
return __builtin_nexttowardl(__x, __y); }
920 template<
typename _Tp>
921 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
923 nexttoward(_Tp __x,
long double __y)
924 {
return __builtin_nexttoward(__x, __y); }
926 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
928 remainder(
float __x,
float __y)
929 {
return __builtin_remainderf(__x, __y); }
932 remainder(
long double __x,
long double __y)
933 {
return __builtin_remainderl(__x, __y); }
936 template<
typename _Tp,
typename _Up>
937 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
938 remainder(_Tp __x, _Up __y)
940 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
941 return remainder(__type(__x), __type(__y));
944 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
946 remquo(
float __x,
float __y,
int* __pquo)
947 {
return __builtin_remquof(__x, __y, __pquo); }
950 remquo(
long double __x,
long double __y,
int* __pquo)
951 {
return __builtin_remquol(__x, __y, __pquo); }
954 template<
typename _Tp,
typename _Up>
955 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
956 remquo(_Tp __x, _Up __y,
int* __pquo)
958 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
959 return remquo(__type(__x), __type(__y), __pquo);
962 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
965 {
return __builtin_rintf(__x); }
968 rint(
long double __x)
969 {
return __builtin_rintl(__x); }
972 template<
typename _Tp>
973 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
976 {
return __builtin_rint(__x); }
978 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
981 {
return __builtin_roundf(__x); }
984 round(
long double __x)
985 {
return __builtin_roundl(__x); }
988 template<
typename _Tp>
989 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
992 {
return __builtin_round(__x); }
994 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
996 scalbln(
float __x,
long __ex)
997 {
return __builtin_scalblnf(__x, __ex); }
1000 scalbln(
long double __x,
long __ex)
1001 {
return __builtin_scalblnl(__x, __ex); }
1004 template<
typename _Tp>
1005 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1007 scalbln(_Tp __x,
long __ex)
1008 {
return __builtin_scalbln(__x, __ex); }
1010 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1012 scalbn(
float __x,
int __ex)
1013 {
return __builtin_scalbnf(__x, __ex); }
1016 scalbn(
long double __x,
int __ex)
1017 {
return __builtin_scalbnl(__x, __ex); }
1020 template<
typename _Tp>
1021 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1023 scalbn(_Tp __x,
int __ex)
1024 {
return __builtin_scalbn(__x, __ex); }
1026 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1029 {
return __builtin_tgammaf(__x); }
1032 tgamma(
long double __x)
1033 {
return __builtin_tgammal(__x); }
1036 template<
typename _Tp>
1037 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1040 {
return __builtin_tgamma(__x); }
1042 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1045 {
return __builtin_truncf(__x); }
1048 trunc(
long double __x)
1049 {
return __builtin_truncl(__x); }
1052 template<
typename _Tp>
1053 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1056 {
return __builtin_trunc(__x); }
1058 #endif // __cplusplus < 201103L
1078 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1080 pow(
float __x,
float __y)
1084 pow(
long double __x,
long double __y)
1088 template<
typename _Tp,
typename _Up>
1089 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1090 pow(_Tp __x, _Up __y)
1092 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1093 return std::pow(__type(__x), __type(__y));
1096 #if __cplusplus >= 201103L
1105 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
1106 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1109 {
return __builtin_fabsf(__x); }
1112 fabs(
long double __x)
1113 {
return __builtin_fabsl(__x); }
1117 template<
typename _Tp>
1118 inline typename __gnu_cxx::__promote<_Tp>::__type
1130 _GLIBCXX_END_NAMESPACE_VERSION
1140 #if _GLIBCXX_USE_STD_SPEC_FUNCS
1142 namespace std _GLIBCXX_VISIBILITY(default)
1144 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1233 _GLIBCXX_END_NAMESPACE_VERSION
1236 #else // ! _GLIBCXX_USE_STD_SPEC_FUNCS
1240 #include <tr1/type_traits>
1242 #include <tr1/gamma.tcc>
1243 #include <tr1/bessel_function.tcc>
1244 #include <tr1/beta_function.tcc>
1245 #include <tr1/ell_integral.tcc>
1246 #include <tr1/exp_integral.tcc>
1247 #include <tr1/legendre_function.tcc>
1248 #include <tr1/modified_bessel_func.tcc>
1249 #include <tr1/poly_hermite.tcc>
1250 #include <tr1/poly_laguerre.tcc>
1251 #include <tr1/riemann_zeta.tcc>
1253 namespace std _GLIBCXX_VISIBILITY(default)
1255 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1264 {
return __detail::__assoc_laguerre<float>(__n, __m, __x); }
1269 return __detail::__assoc_laguerre<long double>(__n, __m, __x);
1273 template<
typename _Tp>
1274 inline typename __gnu_cxx::__promote<_Tp>::__type
1277 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1278 return __detail::__assoc_laguerre<__type>(__n, __m, __x);
1283 {
return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
1286 assoc_legendrel(
unsigned int __l,
unsigned int __m,
long double __x)
1287 {
return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
1290 template<
typename _Tp>
1291 inline typename __gnu_cxx::__promote<_Tp>::__type
1294 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1295 return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
1299 betaf(
float __x,
float __y)
1300 {
return __detail::__beta<float>(__x, __y); }
1303 betal(
long double __x,
long double __y)
1304 {
return __detail::__beta<long double>(__x, __y); }
1307 template<
typename _Tpx,
typename _Tpy>
1308 inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
1311 typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
1312 return __detail::__beta<__type>(__x, __y);
1317 {
return __detail::__comp_ellint_1<float>(__k); }
1320 comp_ellint_1l(
long double __k)
1321 {
return __detail::__comp_ellint_1<long double>(__k); }
1324 template<
typename _Tp>
1325 inline typename __gnu_cxx::__promote<_Tp>::__type
1328 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1329 return __detail::__comp_ellint_1<__type>(__k);
1334 {
return __detail::__comp_ellint_2<float>(__k); }
1337 comp_ellint_2l(
long double __k)
1338 {
return __detail::__comp_ellint_2<long double>(__k); }
1341 template<
typename _Tp>
1342 inline typename __gnu_cxx::__promote<_Tp>::__type
1345 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1346 return __detail::__comp_ellint_2<__type>(__k);
1351 {
return __detail::__comp_ellint_3<float>(__k, __nu); }
1354 comp_ellint_3l(
long double __k,
long double __nu)
1355 {
return __detail::__comp_ellint_3<long double>(__k, __nu); }
1358 template<
typename _Tp,
typename _Tpn>
1359 inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
1362 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
1363 return __detail::__comp_ellint_3<__type>(__k, __nu);
1368 {
return __detail::__cyl_bessel_i<float>(__nu, __x); }
1371 cyl_bessel_il(
long double __nu,
long double __x)
1372 {
return __detail::__cyl_bessel_i<long double>(__nu, __x); }
1375 template<
typename _Tpnu,
typename _Tp>
1376 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1379 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1380 return __detail::__cyl_bessel_i<__type>(__nu, __x);
1385 {
return __detail::__cyl_bessel_j<float>(__nu, __x); }
1388 cyl_bessel_jl(
long double __nu,
long double __x)
1389 {
return __detail::__cyl_bessel_j<long double>(__nu, __x); }
1392 template<
typename _Tpnu,
typename _Tp>
1393 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1396 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1397 return __detail::__cyl_bessel_j<__type>(__nu, __x);
1402 {
return __detail::__cyl_bessel_k<float>(__nu, __x); }
1405 cyl_bessel_kl(
long double __nu,
long double __x)
1406 {
return __detail::__cyl_bessel_k<long double>(__nu, __x); }
1409 template<
typename _Tpnu,
typename _Tp>
1410 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1413 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1414 return __detail::__cyl_bessel_k<__type>(__nu, __x);
1419 {
return __detail::__cyl_neumann_n<float>(__nu, __x); }
1422 cyl_neumannl(
long double __nu,
long double __x)
1423 {
return __detail::__cyl_neumann_n<long double>(__nu, __x); }
1426 template<
typename _Tpnu,
typename _Tp>
1427 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1430 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1431 return __detail::__cyl_neumann_n<__type>(__nu, __x);
1436 {
return __detail::__ellint_1<float>(__k, __phi); }
1439 ellint_1l(
long double __k,
long double __phi)
1440 {
return __detail::__ellint_1<long double>(__k, __phi); }
1443 template<
typename _Tp,
typename _Tpp>
1444 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1447 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1448 return __detail::__ellint_1<__type>(__k, __phi);
1453 {
return __detail::__ellint_2<float>(__k, __phi); }
1456 ellint_2l(
long double __k,
long double __phi)
1457 {
return __detail::__ellint_2<long double>(__k, __phi); }
1460 template<
typename _Tp,
typename _Tpp>
1461 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1464 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1465 return __detail::__ellint_2<__type>(__k, __phi);
1469 ellint_3f(
float __k,
float __nu,
float __phi)
1470 {
return __detail::__ellint_3<float>(__k, __nu, __phi); }
1473 ellint_3l(
long double __k,
long double __nu,
long double __phi)
1474 {
return __detail::__ellint_3<long double>(__k, __nu, __phi); }
1477 template<
typename _Tp,
typename _Tpn,
typename _Tpp>
1478 inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
1481 typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
1482 return __detail::__ellint_3<__type>(__k, __nu, __phi);
1487 {
return __detail::__expint<float>(__x); }
1490 expintl(
long double __x)
1491 {
return __detail::__expint<long double>(__x); }
1494 template<
typename _Tp>
1495 inline typename __gnu_cxx::__promote<_Tp>::__type
1498 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1499 return __detail::__expint<__type>(__x);
1503 hermitef(
unsigned int __n,
float __x)
1504 {
return __detail::__poly_hermite<float>(__n, __x); }
1507 hermitel(
unsigned int __n,
long double __x)
1508 {
return __detail::__poly_hermite<long double>(__n, __x); }
1511 template<
typename _Tp>
1512 inline typename __gnu_cxx::__promote<_Tp>::__type
1515 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1516 return __detail::__poly_hermite<__type>(__n, __x);
1521 {
return __detail::__laguerre<float>(__n, __x); }
1524 laguerrel(
unsigned int __n,
long double __x)
1525 {
return __detail::__laguerre<long double>(__n, __x); }
1528 template<
typename _Tp>
1529 inline typename __gnu_cxx::__promote<_Tp>::__type
1532 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1533 return __detail::__laguerre<__type>(__n, __x);
1538 {
return __detail::__poly_legendre_p<float>(__n, __x); }
1541 legendrel(
unsigned int __n,
long double __x)
1542 {
return __detail::__poly_legendre_p<long double>(__n, __x); }
1545 template<
typename _Tp>
1546 inline typename __gnu_cxx::__promote<_Tp>::__type
1549 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1550 return __detail::__poly_legendre_p<__type>(__n, __x);
1555 {
return __detail::__riemann_zeta<float>(__x); }
1558 riemann_zetal(
long double __x)
1559 {
return __detail::__riemann_zeta<long double>(__x); }
1562 template<
typename _Tp>
1563 inline typename __gnu_cxx::__promote<_Tp>::__type
1566 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1567 return __detail::__riemann_zeta<__type>(__x);
1572 {
return __detail::__sph_bessel<float>(__n, __x); }
1575 sph_bessell(
unsigned int __n,
long double __x)
1576 {
return __detail::__sph_bessel<long double>(__n, __x); }
1579 template<
typename _Tp>
1580 inline typename __gnu_cxx::__promote<_Tp>::__type
1583 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1584 return __detail::__sph_bessel<__type>(__n, __x);
1588 sph_legendref(
unsigned int __l,
unsigned int __m,
float __theta)
1589 {
return __detail::__sph_legendre<float>(__l, __m, __theta); }
1592 sph_legendrel(
unsigned int __l,
unsigned int __m,
long double __theta)
1593 {
return __detail::__sph_legendre<long double>(__l, __m, __theta); }
1596 template<
typename _Tp>
1597 inline typename __gnu_cxx::__promote<_Tp>::__type
1600 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1601 return __detail::__sph_legendre<__type>(__l, __m, __theta);
1606 {
return __detail::__sph_neumann<float>(__n, __x); }
1609 sph_neumannl(
unsigned int __n,
long double __x)
1610 {
return __detail::__sph_neumann<long double>(__n, __x); }
1613 template<
typename _Tp>
1614 inline typename __gnu_cxx::__promote<_Tp>::__type
1617 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1618 return __detail::__sph_neumann<__type>(__n, __x);
1625 _GLIBCXX_END_NAMESPACE_VERSION
1628 #endif // _GLIBCXX_USE_STD_SPEC_FUNCS
1630 #if _GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__)
1631 namespace std _GLIBCXX_VISIBILITY(default)
1633 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1646 _GLIBCXX_END_NAMESPACE_VERSION
1649 #else // ! (_GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__))
1653 #include <tr1/type_traits>
1655 #include <tr1/hypergeometric.tcc>
1657 namespace std _GLIBCXX_VISIBILITY(default)
1659 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1669 {
return __detail::__conf_hyperg<float>(__a, __c, __x); }
1672 conf_hypergl(
long double __a,
long double __c,
long double __x)
1673 {
return __detail::__conf_hyperg<long double>(__a, __c, __x); }
1676 template<
typename _Tpa,
typename _Tpc,
typename _Tp>
1677 inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
1680 typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
1681 return __detail::__conf_hyperg<__type>(__a, __c, __x);
1685 hypergf(
float __a,
float __b,
float __c,
float __x)
1686 {
return __detail::__hyperg<float>(__a, __b, __c, __x); }
1689 hypergl(
long double __a,
long double __b,
long double __c,
long double __x)
1690 {
return __detail::__hyperg<long double>(__a, __b, __c, __x); }
1693 template<
typename _Tpa,
typename _Tpb,
typename _Tpc,
typename _Tp>
1694 inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
1695 hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
1697 typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
1698 return __detail::__hyperg<__type>(__a, __b, __c, __x);
1705 _GLIBCXX_END_NAMESPACE_VERSION
1707 #endif // _GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__)
1709 #endif // _GLIBCXX_TR1_CMATH
long double sph_bessell(unsigned int __n, long double __x)
long double sph_neumannl(unsigned int __n, long double __x)
complex< _Tp > log10(const complex< _Tp > &)
Return complex base 10 logarithm of z.
float comp_ellint_3f(float __k, float __nu)
Return the complete elliptic integral of the third kind for float modulus k.
_Tp fabs(const std::complex< _Tp > &)
fabs(__z) [8.1.8].
long double comp_ellint_3l(long double __k, long double __nu)
Return the complete elliptic integral of the third kind for long double modulus k.
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_i(_Tpnu __nu, _Tp __x)
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_neumann(_Tpnu __nu, _Tp __x)
5.2.1.11 Cylindrical Neumann functions.
__gnu_cxx::__promote_4< _Tpa, _Tpb, _Tpc, _Tp >::__type hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
5.2.1.17 Hypergeometric functions.
float sph_besself(unsigned int __n, float __x)
complex< _Tp > cosh(const complex< _Tp > &)
Return complex hyperbolic cosine of z.
__gnu_cxx::__promote< _Tp >::__type hermite(unsigned int __n, _Tp __x)
__gnu_cxx::__promote< _Tp >::__type hermite(unsigned int __n, _Tp __x)
5.2.1.16 Hermite polynomials.
long double ellint_1l(long double __k, long double __phi)
float assoc_legendref(unsigned int __l, unsigned int __m, float __x)
__gnu_cxx::__promote_3< _Tp, _Tpn, _Tpp >::__type ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
Return the incomplete elliptic integral of the third kind .
long double cyl_bessel_il(long double __nu, long double __x)
__gnu_cxx::__promote< _Tp >::__type riemann_zeta(_Tp __x)
5.2.1.20 Riemann zeta function.
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_1(_Tp __k, _Tpp __phi)
float ellint_2f(float __k, float __phi)
Return the incomplete elliptic integral of the second kind for float argument.
long double assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
long double riemann_zetal(long double __s)
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_k(_Tpnu __nu, _Tp __x)
long double comp_ellint_1l(long double __k)
__gnu_cxx::__promote_2< _Tp, _Tpn >::__type comp_ellint_3(_Tp __k, _Tpn __nu)
5.2.1.6 Complete elliptic integrals of the third kind.
__gnu_cxx::__promote< _Tp >::__type assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
5.2.1.2 Associated Legendre functions.
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_i(_Tpnu __nu, _Tp __x)
5.2.1.8 Regular modified cylindrical Bessel functions.
std::complex< _Tp > atan(const std::complex< _Tp > &)
atan(__z) [8.1.4].
long double cyl_bessel_jl(long double __nu, long double __x)
__gnu_cxx::__promote< _Tp >::__type sph_bessel(unsigned int __n, _Tp __x)
__gnu_cxx::__promote< _Tp >::__type comp_ellint_1(_Tp __k)
5.2.1.4 Complete elliptic integrals of the first kind.
__gnu_cxx::__promote_3< _Tp, _Tpn, _Tpp >::__type ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
5.2.1.14 Incomplete elliptic integrals of the third kind.
long double hermitel(unsigned int __n, long double __x)
__gnu_cxx::__promote< _Tp >::__type assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
float cyl_bessel_jf(float __nu, float __x)
std::complex< _Tp > acos(const std::complex< _Tp > &)
acos(__z) [8.1.2].
__gnu_cxx::__promote< _Tp >::__type sph_bessel(unsigned int __n, _Tp __x)
5.2.1.21 Spherical Bessel functions.
__gnu_cxx::__promote< _Tp >::__type expint(_Tp __x)
float assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
__gnu_cxx::__promote< _Tp >::__type comp_ellint_2(_Tp __k)
__gnu_cxx::__promote< _Tp >::__type laguerre(unsigned int __n, _Tp __x)
5.2.1.18 Laguerre polynomials.
long double ellint_2l(long double __k, long double __phi)
Return the incomplete elliptic integral of the second kind .
float sph_neumannf(unsigned int __n, float __x)
__gnu_cxx::__promote< _Tp >::__type laguerre(unsigned int __n, _Tp __x)
__gnu_cxx::__promote< _Tp >::__type legendre(unsigned int __l, _Tp __x)
long double assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
__gnu_cxx::__promote_2< _Tpx, _Tpy >::__type beta(_Tpx __x, _Tpy __y)
5.2.1.3 Beta functions.
__gnu_cxx::__promote< _Tp >::__type assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
5.2.1.1 Associated Laguerre polynomials.
__gnu_cxx::__promote_4< _Tpa, _Tpb, _Tpc, _Tp >::__type hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
__gnu_cxx::__promote< _Tp >::__type legendre(unsigned int __n, _Tp __x)
5.2.1.19 Legendre polynomials.
long double cyl_neumannl(long double __nu, long double __x)
std::complex< _Tp > asin(const std::complex< _Tp > &)
asin(__z) [8.1.3].
complex< _Tp > sinh(const complex< _Tp > &)
Return complex hyperbolic sine of z.
__gnu_cxx::__promote_3< _Tpa, _Tpc, _Tp >::__type conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
std::complex< _Tp > asinh(const std::complex< _Tp > &)
asinh(__z) [8.1.6].
float hypergf(float __a, float __b, float __c, float __x)
float ellint_1f(float __k, float __phi)
__gnu_cxx::__promote< _Tp >::__type sph_neumann(unsigned int __n, _Tp __x)
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
long double ellint_3l(long double __k, long double __nu, long double __phi)
Return the incomplete elliptic integral of the third kind .
long double laguerrel(unsigned int __n, long double __x)
std::complex< _Tp > acosh(const std::complex< _Tp > &)
acosh(__z) [8.1.5].
__gnu_cxx::__promote< _Tp >::__type comp_ellint_2(_Tp __k)
5.2.1.5 Complete elliptic integrals of the second kind.
float sph_legendref(unsigned int __l, unsigned int __m, float __theta)
complex< _Tp > tan(const complex< _Tp > &)
Return complex tangent of z.
__gnu_cxx::__promote< _Tp >::__type sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
5.2.1.22 Spherical associated Legendre functions.
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_j(_Tpnu __nu, _Tp __x)
5.2.1.9 Cylindrical Bessel functions (of the first kind).
__gnu_cxx::__promote< _Tp >::__type assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
float comp_ellint_1f(float __k)
float cyl_bessel_if(float __nu, float __x)
__gnu_cxx::__promote< _Tp >::__type riemann_zeta(_Tp __s)
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_k(_Tpnu __nu, _Tp __x)
5.2.1.10 Irregular modified cylindrical Bessel functions.
__gnu_cxx::__promote< _Tp >::__type expint(_Tp __x)
5.2.1.15 Exponential integrals.
float laguerref(unsigned int __n, float __x)
float riemann_zetaf(float __s)
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_1(_Tp __k, _Tpp __phi)
5.2.1.12 Incomplete elliptic integrals of the first kind.
float ellint_3f(float __k, float __nu, float __phi)
Return the incomplete elliptic integral of the third kind for float argument.
long double conf_hypergl(long double __a, long double __c, long double __x)
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
long double legendrel(unsigned int __l, long double __x)
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_2(_Tp __k, _Tpp __phi)
5.2.1.13 Incomplete elliptic integrals of the second kind.
__gnu_cxx::__promote_3< _Tpa, _Tpc, _Tp >::__type conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
5.2.1.7 Confluent hypergeometric functions.
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_2(_Tp __k, _Tpp __phi)
complex< _Tp > sin(const complex< _Tp > &)
Return complex sine of z.
std::complex< _Tp > atanh(const std::complex< _Tp > &)
atanh(__z) [8.1.7].
long double hypergl(long double __a, long double __b, long double __c, long double __x)
__gnu_cxx::__promote< _Tp >::__type sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
long double expintl(long double __x)
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
complex< _Tp > pow(const complex< _Tp > &, int)
Return x to the y'th power.
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_neumann(_Tpnu __nu, _Tp __x)
float betaf(float __a, float __b)
float legendref(unsigned int __l, float __x)
float hermitef(unsigned int __n, float __x)
complex< _Tp > tanh(const complex< _Tp > &)
Return complex hyperbolic tangent of z.
long double cyl_bessel_kl(long double __nu, long double __x)
long double comp_ellint_2l(long double __k)
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_j(_Tpnu __nu, _Tp __x)
__gnu_cxx::__promote_2< _Tp, _Tpn >::__type comp_ellint_3(_Tp __k, _Tpn __nu)
float cyl_neumannf(float __nu, float __x)
float cyl_bessel_kf(float __nu, float __x)
long double betal(long double __a, long double __b)
float conf_hypergf(float __a, float __c, float __x)
__gnu_cxx::__promote< _Tp >::__type sph_neumann(unsigned int __n, _Tp __x)
5.2.1.23 Spherical Neumann functions.
complex< _Tp > cos(const complex< _Tp > &)
Return complex cosine of z.
float comp_ellint_2f(float __k)
long double sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
__gnu_cxx::__promote< _Tp >::__type comp_ellint_1(_Tp __k)