1 // TR1 cmath -*- C++ -*-
 
    3 // Copyright (C) 2006-2014 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); }
 
  850   remainder(float __x, float __y)
 
  851   { return __builtin_remainderf(__x, __y); }
 
  854   remainder(long double __x, long double __y)
 
  855   { return __builtin_remainderl(__x, __y); }
 
  857   template<typename _Tp, typename _Up>
 
  858     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
 
  859     remainder(_Tp __x, _Up __y)
 
  861       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
 
  862       return remainder(__type(__x), __type(__y));
 
  866   remquo(float __x, float __y, int* __pquo)
 
  867   { return __builtin_remquof(__x, __y, __pquo); }
 
  870   remquo(long double __x, long double __y, int* __pquo)
 
  871   { return __builtin_remquol(__x, __y, __pquo); }
 
  873   template<typename _Tp, typename _Up>
 
  874     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
 
  875     remquo(_Tp __x, _Up __y, int* __pquo)
 
  877       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
 
  878       return remquo(__type(__x), __type(__y), __pquo);
 
  883   { return __builtin_rintf(__x); }
 
  886   rint(long double __x)
 
  887   { return __builtin_rintl(__x); }
 
  889   template<typename _Tp>
 
  890     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  893     { return __builtin_rint(__x); }
 
  897   { return __builtin_roundf(__x); }
 
  900   round(long double __x)
 
  901   { return __builtin_roundl(__x); }
 
  903   template<typename _Tp>
 
  904     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  907     { return __builtin_round(__x); }
 
  910   scalbln(float __x, long __ex)
 
  911   { return __builtin_scalblnf(__x, __ex); }
 
  914   scalbln(long double __x, long __ex)
 
  915   { return __builtin_scalblnl(__x, __ex); }
 
  917   template<typename _Tp>
 
  918     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  920     scalbln(_Tp __x, long __ex)
 
  921     { return __builtin_scalbln(__x, __ex); }
 
  924   scalbn(float __x, int __ex)
 
  925   { return __builtin_scalbnf(__x, __ex); }
 
  928   scalbn(long double __x, int __ex)
 
  929   { return __builtin_scalbnl(__x, __ex); }
 
  931   template<typename _Tp>
 
  932     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  934     scalbn(_Tp __x, int __ex)
 
  935     { return __builtin_scalbn(__x, __ex); }
 
  945   { return __builtin_tgammaf(__x); }
 
  948   tgamma(long double __x)
 
  949   { return __builtin_tgammal(__x); }
 
  951   template<typename _Tp>
 
  952     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  955     { return __builtin_tgamma(__x); }
 
  959   { return __builtin_truncf(__x); }
 
  962   trunc(long double __x)
 
  963   { return __builtin_truncl(__x); }
 
  965   template<typename _Tp>
 
  966     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
 
  969     { return __builtin_trunc(__x); }
 
  972 _GLIBCXX_END_NAMESPACE_VERSION
 
  976 namespace std _GLIBCXX_VISIBILITY(default)
 
  980 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
  982   // DR 550. What should the return type of pow(float,int) be?
 
  983   // NB: C++0x and TR1 != C++03.
 
  985   // The std::tr1::pow(double, double) overload cannot be provided
 
  986   // here, because it would clash with ::pow(double,double) declared
 
  987   // in <math.h>, if <tr1/math.h> is included at the same time (raised
 
  988   // by the fix of PR c++/54537). It is not possible either to use the
 
  989   // using-declaration 'using ::pow;' here, because if the user code
 
  990   // has a 'using std::pow;', it would bring the pow(*,int) averloads
 
  991   // in the tr1 namespace, which is undesirable. Consequently, the
 
  992   // solution is to forward std::tr1::pow(double,double) to
 
  993   // std::pow(double,double) via the templatized version below. See
 
  994   // the discussion about this issue here:
 
  995   // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
 
  998   pow(float __x, float __y)
 
  999   { return std::pow(__x, __y); }
 
 1002   pow(long double __x, long double __y)
 
 1003   { return std::pow(__x, __y); }
 
 1005   template<typename _Tp, typename _Up>
 
 1006     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
 
 1007     pow(_Tp __x, _Up __y)
 
 1009       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
 
 1010       return std::pow(__type(__x), __type(__y));
 
 1013 _GLIBCXX_END_NAMESPACE_VERSION
 
 1017 #include <bits/stl_algobase.h>
 
 1019 #include <tr1/type_traits>
 
 1021 #include <tr1/gamma.tcc>
 
 1022 #include <tr1/bessel_function.tcc>
 
 1023 #include <tr1/beta_function.tcc>
 
 1024 #include <tr1/ell_integral.tcc>
 
 1025 #include <tr1/exp_integral.tcc>
 
 1026 #include <tr1/hypergeometric.tcc>
 
 1027 #include <tr1/legendre_function.tcc>
 
 1028 #include <tr1/modified_bessel_func.tcc>
 
 1029 #include <tr1/poly_hermite.tcc>
 
 1030 #include <tr1/poly_laguerre.tcc>
 
 1031 #include <tr1/riemann_zeta.tcc>
 
 1033 namespace std _GLIBCXX_VISIBILITY(default)
 
 1037 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 1040    * @defgroup tr1_math_spec_func Mathematical Special Functions
 
 1043    * A collection of advanced mathematical special functions.
 
 1048   assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
 
 1049   { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
 
 1052   assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
 
 1054     return __detail::__assoc_laguerre<long double>(__n, __m, __x);
 
 1057   ///  5.2.1.1  Associated Laguerre polynomials.
 
 1058   template<typename _Tp>
 
 1059     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1060     assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
 
 1062       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1063       return __detail::__assoc_laguerre<__type>(__n, __m, __x);
 
 1067   assoc_legendref(unsigned int __l, unsigned int __m, float __x)
 
 1068   { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
 
 1071   assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
 
 1072   { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
 
 1074   ///  5.2.1.2  Associated Legendre functions.
 
 1075   template<typename _Tp>
 
 1076     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1077     assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
 
 1079       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1080       return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
 
 1084   betaf(float __x, float __y)
 
 1085   { return __detail::__beta<float>(__x, __y); }
 
 1088   betal(long double __x, long double __y)
 
 1089   { return __detail::__beta<long double>(__x, __y); }
 
 1091   ///  5.2.1.3  Beta functions.
 
 1092   template<typename _Tpx, typename _Tpy>
 
 1093     inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
 
 1094     beta(_Tpx __x, _Tpy __y)
 
 1096       typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
 
 1097       return __detail::__beta<__type>(__x, __y);
 
 1101   comp_ellint_1f(float __k)
 
 1102   { return __detail::__comp_ellint_1<float>(__k); }
 
 1105   comp_ellint_1l(long double __k)
 
 1106   { return __detail::__comp_ellint_1<long double>(__k); }
 
 1108   ///  5.2.1.4  Complete elliptic integrals of the first kind.
 
 1109   template<typename _Tp>
 
 1110     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1111     comp_ellint_1(_Tp __k)
 
 1113       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1114       return __detail::__comp_ellint_1<__type>(__k);
 
 1118   comp_ellint_2f(float __k)
 
 1119   { return __detail::__comp_ellint_2<float>(__k); }
 
 1122   comp_ellint_2l(long double __k)
 
 1123   { return __detail::__comp_ellint_2<long double>(__k); }
 
 1125   ///  5.2.1.5  Complete elliptic integrals of the second kind.
 
 1126   template<typename _Tp>
 
 1127     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1128     comp_ellint_2(_Tp __k)
 
 1130       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1131       return __detail::__comp_ellint_2<__type>(__k);
 
 1135   comp_ellint_3f(float __k, float __nu)
 
 1136   { return __detail::__comp_ellint_3<float>(__k, __nu); }
 
 1139   comp_ellint_3l(long double __k, long double __nu)
 
 1140   { return __detail::__comp_ellint_3<long double>(__k, __nu); }
 
 1142   ///  5.2.1.6  Complete elliptic integrals of the third kind.
 
 1143   template<typename _Tp, typename _Tpn>
 
 1144     inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
 
 1145     comp_ellint_3(_Tp __k, _Tpn __nu)
 
 1147       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
 
 1148       return __detail::__comp_ellint_3<__type>(__k, __nu);
 
 1152   conf_hypergf(float __a, float __c, float __x)
 
 1153   { return __detail::__conf_hyperg<float>(__a, __c, __x); }
 
 1156   conf_hypergl(long double __a, long double __c, long double __x)
 
 1157   { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
 
 1159   ///  5.2.1.7  Confluent hypergeometric functions.
 
 1160   template<typename _Tpa, typename _Tpc, typename _Tp>
 
 1161     inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
 
 1162     conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
 
 1164       typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
 
 1165       return __detail::__conf_hyperg<__type>(__a, __c, __x);
 
 1169   cyl_bessel_if(float __nu, float __x)
 
 1170   { return __detail::__cyl_bessel_i<float>(__nu, __x); }
 
 1173   cyl_bessel_il(long double __nu, long double __x)
 
 1174   { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
 
 1176   ///  5.2.1.8  Regular modified cylindrical Bessel functions.
 
 1177   template<typename _Tpnu, typename _Tp>
 
 1178     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
 
 1179     cyl_bessel_i(_Tpnu __nu, _Tp __x)
 
 1181       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
 
 1182       return __detail::__cyl_bessel_i<__type>(__nu, __x);
 
 1186   cyl_bessel_jf(float __nu, float __x)
 
 1187   { return __detail::__cyl_bessel_j<float>(__nu, __x); }
 
 1190   cyl_bessel_jl(long double __nu, long double __x)
 
 1191   { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
 
 1193   ///  5.2.1.9  Cylindrical Bessel functions (of the first kind).
 
 1194   template<typename _Tpnu, typename _Tp>
 
 1195     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
 
 1196     cyl_bessel_j(_Tpnu __nu, _Tp __x)
 
 1198       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
 
 1199       return __detail::__cyl_bessel_j<__type>(__nu, __x);
 
 1203   cyl_bessel_kf(float __nu, float __x)
 
 1204   { return __detail::__cyl_bessel_k<float>(__nu, __x); }
 
 1207   cyl_bessel_kl(long double __nu, long double __x)
 
 1208   { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
 
 1210   ///  5.2.1.10  Irregular modified cylindrical Bessel functions.
 
 1211   template<typename _Tpnu, typename _Tp>
 
 1212     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
 
 1213     cyl_bessel_k(_Tpnu __nu, _Tp __x)
 
 1215       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
 
 1216       return __detail::__cyl_bessel_k<__type>(__nu, __x);
 
 1220   cyl_neumannf(float __nu, float __x)
 
 1221   { return __detail::__cyl_neumann_n<float>(__nu, __x); }
 
 1224   cyl_neumannl(long double __nu, long double __x)
 
 1225   { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
 
 1227   ///  5.2.1.11  Cylindrical Neumann functions.
 
 1228   template<typename _Tpnu, typename _Tp>
 
 1229     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
 
 1230     cyl_neumann(_Tpnu __nu, _Tp __x)
 
 1232       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
 
 1233       return __detail::__cyl_neumann_n<__type>(__nu, __x);
 
 1237   ellint_1f(float __k, float __phi)
 
 1238   { return __detail::__ellint_1<float>(__k, __phi); }
 
 1241   ellint_1l(long double __k, long double __phi)
 
 1242   { return __detail::__ellint_1<long double>(__k, __phi); }
 
 1244   ///  5.2.1.12  Incomplete elliptic integrals of the first kind.
 
 1245   template<typename _Tp, typename _Tpp>
 
 1246     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
 
 1247     ellint_1(_Tp __k, _Tpp __phi)
 
 1249       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
 
 1250       return __detail::__ellint_1<__type>(__k, __phi);
 
 1254   ellint_2f(float __k, float __phi)
 
 1255   { return __detail::__ellint_2<float>(__k, __phi); }
 
 1258   ellint_2l(long double __k, long double __phi)
 
 1259   { return __detail::__ellint_2<long double>(__k, __phi); }
 
 1261   ///  5.2.1.13  Incomplete elliptic integrals of the second kind.
 
 1262   template<typename _Tp, typename _Tpp>
 
 1263     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
 
 1264     ellint_2(_Tp __k, _Tpp __phi)
 
 1266       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
 
 1267       return __detail::__ellint_2<__type>(__k, __phi);
 
 1271   ellint_3f(float __k, float __nu, float __phi)
 
 1272   { return __detail::__ellint_3<float>(__k, __nu, __phi); }
 
 1275   ellint_3l(long double __k, long double __nu, long double __phi)
 
 1276   { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
 
 1278   ///  5.2.1.14  Incomplete elliptic integrals of the third kind.
 
 1279   template<typename _Tp, typename _Tpn, typename _Tpp>
 
 1280     inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
 
 1281     ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
 
 1283       typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
 
 1284       return __detail::__ellint_3<__type>(__k, __nu, __phi);
 
 1289   { return __detail::__expint<float>(__x); }
 
 1292   expintl(long double __x)
 
 1293   { return __detail::__expint<long double>(__x); }
 
 1295   ///  5.2.1.15  Exponential integrals.
 
 1296   template<typename _Tp>
 
 1297     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1300       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1301       return __detail::__expint<__type>(__x);
 
 1305   hermitef(unsigned int __n, float __x)
 
 1306   { return __detail::__poly_hermite<float>(__n, __x); }
 
 1309   hermitel(unsigned int __n, long double __x)
 
 1310   { return __detail::__poly_hermite<long double>(__n, __x); }
 
 1312   ///  5.2.1.16  Hermite polynomials.
 
 1313   template<typename _Tp>
 
 1314     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1315     hermite(unsigned int __n, _Tp __x)
 
 1317       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1318       return __detail::__poly_hermite<__type>(__n, __x);
 
 1322   hypergf(float __a, float __b, float __c, float __x)
 
 1323   { return __detail::__hyperg<float>(__a, __b, __c, __x); }
 
 1326   hypergl(long double __a, long double __b, long double __c, long double __x)
 
 1327   { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
 
 1329   ///  5.2.1.17  Hypergeometric functions.
 
 1330   template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
 
 1331     inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
 
 1332     hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
 
 1334       typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
 
 1335       return __detail::__hyperg<__type>(__a, __b, __c, __x);
 
 1339   laguerref(unsigned int __n, float __x)
 
 1340   { return __detail::__laguerre<float>(__n, __x); }
 
 1343   laguerrel(unsigned int __n, long double __x)
 
 1344   { return __detail::__laguerre<long double>(__n, __x); }
 
 1346   ///  5.2.1.18  Laguerre polynomials.
 
 1347   template<typename _Tp>
 
 1348     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1349     laguerre(unsigned int __n, _Tp __x)
 
 1351       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1352       return __detail::__laguerre<__type>(__n, __x);
 
 1356   legendref(unsigned int __n, float __x)
 
 1357   { return __detail::__poly_legendre_p<float>(__n, __x); }
 
 1360   legendrel(unsigned int __n, long double __x)
 
 1361   { return __detail::__poly_legendre_p<long double>(__n, __x); }
 
 1363   ///  5.2.1.19  Legendre polynomials.
 
 1364   template<typename _Tp>
 
 1365     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1366     legendre(unsigned int __n, _Tp __x)
 
 1368       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1369       return __detail::__poly_legendre_p<__type>(__n, __x);
 
 1373   riemann_zetaf(float __x)
 
 1374   { return __detail::__riemann_zeta<float>(__x); }
 
 1377   riemann_zetal(long double __x)
 
 1378   { return __detail::__riemann_zeta<long double>(__x); }
 
 1380   ///  5.2.1.20  Riemann zeta function.
 
 1381   template<typename _Tp>
 
 1382     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1383     riemann_zeta(_Tp __x)
 
 1385       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1386       return __detail::__riemann_zeta<__type>(__x);
 
 1390   sph_besself(unsigned int __n, float __x)
 
 1391   { return __detail::__sph_bessel<float>(__n, __x); }
 
 1394   sph_bessell(unsigned int __n, long double __x)
 
 1395   { return __detail::__sph_bessel<long double>(__n, __x); }
 
 1397   ///  5.2.1.21  Spherical Bessel functions.
 
 1398   template<typename _Tp>
 
 1399     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1400     sph_bessel(unsigned int __n, _Tp __x)
 
 1402       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1403       return __detail::__sph_bessel<__type>(__n, __x);
 
 1407   sph_legendref(unsigned int __l, unsigned int __m, float __theta)
 
 1408   { return __detail::__sph_legendre<float>(__l, __m, __theta); }
 
 1411   sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
 
 1412   { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
 
 1414   ///  5.2.1.22  Spherical associated Legendre functions.
 
 1415   template<typename _Tp>
 
 1416     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1417     sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
 
 1419       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1420       return __detail::__sph_legendre<__type>(__l, __m, __theta);
 
 1424   sph_neumannf(unsigned int __n, float __x)
 
 1425   { return __detail::__sph_neumann<float>(__n, __x); }
 
 1428   sph_neumannl(unsigned int __n, long double __x)
 
 1429   { return __detail::__sph_neumann<long double>(__n, __x); }
 
 1431   ///  5.2.1.23  Spherical Neumann functions.
 
 1432   template<typename _Tp>
 
 1433     inline typename __gnu_cxx::__promote<_Tp>::__type
 
 1434     sph_neumann(unsigned int __n, _Tp __x)
 
 1436       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
 
 1437       return __detail::__sph_neumann<__type>(__n, __x);
 
 1440   /* @} */ // tr1_math_spec_func
 
 1441 _GLIBCXX_END_NAMESPACE_VERSION
 
 1445 #endif // _GLIBCXX_TR1_CMATH