libstdc++
cmath
Go to the documentation of this file.
00001 // TR1 cmath -*- C++ -*-
00002 
00003 // Copyright (C) 2006-2015 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 3, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file tr1/cmath
00026  *  This is a TR1 C++ Library header. 
00027  */
00028 
00029 #ifndef _GLIBCXX_TR1_CMATH
00030 #define _GLIBCXX_TR1_CMATH 1
00031 
00032 #pragma GCC system_header
00033 
00034 #include <cmath>
00035 
00036 #ifdef _GLIBCXX_USE_C99_MATH_TR1
00037 
00038 #undef acosh
00039 #undef acoshf
00040 #undef acoshl
00041 #undef asinh
00042 #undef asinhf
00043 #undef asinhl
00044 #undef atanh
00045 #undef atanhf
00046 #undef atanhl
00047 #undef cbrt
00048 #undef cbrtf
00049 #undef cbrtl
00050 #undef copysign
00051 #undef copysignf
00052 #undef copysignl
00053 #undef erf
00054 #undef erff
00055 #undef erfl
00056 #undef erfc
00057 #undef erfcf
00058 #undef erfcl
00059 #undef exp2
00060 #undef exp2f
00061 #undef exp2l
00062 #undef expm1
00063 #undef expm1f
00064 #undef expm1l
00065 #undef fdim
00066 #undef fdimf
00067 #undef fdiml
00068 #undef fma
00069 #undef fmaf
00070 #undef fmal
00071 #undef fmax
00072 #undef fmaxf
00073 #undef fmaxl
00074 #undef fmin
00075 #undef fminf
00076 #undef fminl
00077 #undef hypot
00078 #undef hypotf
00079 #undef hypotl
00080 #undef ilogb
00081 #undef ilogbf
00082 #undef ilogbl
00083 #undef lgamma
00084 #undef lgammaf
00085 #undef lgammal
00086 #undef llrint
00087 #undef llrintf
00088 #undef llrintl
00089 #undef llround
00090 #undef llroundf
00091 #undef llroundl
00092 #undef log1p
00093 #undef log1pf
00094 #undef log1pl
00095 #undef log2
00096 #undef log2f
00097 #undef log2l
00098 #undef logb
00099 #undef logbf
00100 #undef logbl
00101 #undef lrint
00102 #undef lrintf
00103 #undef lrintl
00104 #undef lround
00105 #undef lroundf
00106 #undef lroundl
00107 #undef nan
00108 #undef nanf
00109 #undef nanl
00110 #undef nearbyint
00111 #undef nearbyintf
00112 #undef nearbyintl
00113 #undef nextafter
00114 #undef nextafterf
00115 #undef nextafterl
00116 #undef nexttoward
00117 #undef nexttowardf
00118 #undef nexttowardl
00119 #undef remainder
00120 #undef remainderf
00121 #undef remainderl
00122 #undef remquo
00123 #undef remquof
00124 #undef remquol
00125 #undef rint
00126 #undef rintf
00127 #undef rintl
00128 #undef round
00129 #undef roundf
00130 #undef roundl
00131 #undef scalbln
00132 #undef scalblnf
00133 #undef scalblnl
00134 #undef scalbn
00135 #undef scalbnf
00136 #undef scalbnl
00137 #undef tgamma
00138 #undef tgammaf
00139 #undef tgammal
00140 #undef trunc
00141 #undef truncf
00142 #undef truncl
00143 
00144 #endif
00145 
00146 namespace std _GLIBCXX_VISIBILITY(default)
00147 {
00148 namespace tr1
00149 {
00150 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00151 
00152 #if _GLIBCXX_USE_C99_MATH_TR1
00153 
00154   // types
00155   using ::double_t;
00156   using ::float_t;
00157 
00158   // functions
00159   using ::acosh;
00160   using ::acoshf;
00161   using ::acoshl;
00162 
00163   using ::asinh;
00164   using ::asinhf;
00165   using ::asinhl;
00166 
00167   using ::atanh;
00168   using ::atanhf;
00169   using ::atanhl;
00170 
00171   using ::cbrt;
00172   using ::cbrtf;
00173   using ::cbrtl;
00174 
00175   using ::copysign;
00176   using ::copysignf;
00177   using ::copysignl;
00178 
00179   using ::erf;
00180   using ::erff;
00181   using ::erfl;
00182 
00183   using ::erfc;
00184   using ::erfcf;
00185   using ::erfcl;
00186 
00187   using ::exp2;
00188   using ::exp2f;
00189   using ::exp2l;
00190 
00191   using ::expm1;
00192   using ::expm1f;
00193   using ::expm1l;
00194 
00195   using ::fdim;
00196   using ::fdimf;
00197   using ::fdiml;
00198 
00199   using ::fma;
00200   using ::fmaf;
00201   using ::fmal;
00202 
00203   using ::fmax;
00204   using ::fmaxf;
00205   using ::fmaxl;
00206 
00207   using ::fmin;
00208   using ::fminf;
00209   using ::fminl;
00210 
00211   using ::hypot;
00212   using ::hypotf;
00213   using ::hypotl;
00214 
00215   using ::ilogb;
00216   using ::ilogbf;
00217   using ::ilogbl;
00218 
00219   using ::lgamma;
00220   using ::lgammaf;
00221   using ::lgammal;
00222 
00223   using ::llrint;
00224   using ::llrintf;
00225   using ::llrintl;
00226 
00227   using ::llround;
00228   using ::llroundf;
00229   using ::llroundl;
00230 
00231   using ::log1p;
00232   using ::log1pf;
00233   using ::log1pl;
00234 
00235   using ::log2;
00236   using ::log2f;
00237   using ::log2l;
00238 
00239   using ::logb;
00240   using ::logbf;
00241   using ::logbl;
00242 
00243   using ::lrint;
00244   using ::lrintf;
00245   using ::lrintl;
00246 
00247   using ::lround;
00248   using ::lroundf;
00249   using ::lroundl;
00250 
00251   using ::nan;
00252   using ::nanf;
00253   using ::nanl;
00254 
00255   using ::nearbyint;
00256   using ::nearbyintf;
00257   using ::nearbyintl;
00258 
00259   using ::nextafter;
00260   using ::nextafterf;
00261   using ::nextafterl;
00262 
00263   using ::nexttoward;
00264   using ::nexttowardf;
00265   using ::nexttowardl;
00266 
00267   using ::remainder;
00268   using ::remainderf;
00269   using ::remainderl;
00270 
00271   using ::remquo;
00272   using ::remquof;
00273   using ::remquol;
00274 
00275   using ::rint;
00276   using ::rintf;
00277   using ::rintl;
00278 
00279   using ::round;
00280   using ::roundf;
00281   using ::roundl;
00282 
00283   using ::scalbln;
00284   using ::scalblnf;
00285   using ::scalblnl;
00286 
00287   using ::scalbn;
00288   using ::scalbnf;
00289   using ::scalbnl;
00290 
00291   using ::tgamma;
00292   using ::tgammaf;
00293   using ::tgammal;
00294 
00295   using ::trunc;
00296   using ::truncf;
00297   using ::truncl;
00298 
00299 #endif
00300 
00301 #if _GLIBCXX_USE_C99_MATH
00302 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00303 
00304   /// Function template definitions [8.16.3].
00305   template<typename _Tp>
00306     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00307                                            int>::__type
00308     fpclassify(_Tp __f)
00309     {
00310       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00311       return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
00312                                   FP_SUBNORMAL, FP_ZERO, __type(__f));
00313     }
00314 
00315   template<typename _Tp>
00316     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00317                                            int>::__type
00318     isfinite(_Tp __f)
00319     {
00320       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00321       return __builtin_isfinite(__type(__f));
00322     }
00323 
00324   template<typename _Tp>
00325     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00326                                            int>::__type
00327     isinf(_Tp __f)
00328     {
00329       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00330       return __builtin_isinf(__type(__f));
00331     }
00332 
00333   template<typename _Tp>
00334     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00335                                            int>::__type
00336     isnan(_Tp __f)
00337     {
00338       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00339       return __builtin_isnan(__type(__f));
00340     }
00341 
00342   template<typename _Tp>
00343     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00344                                            int>::__type
00345     isnormal(_Tp __f)
00346     {
00347       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00348       return __builtin_isnormal(__type(__f));
00349     }
00350 
00351   template<typename _Tp>
00352     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00353                                            int>::__type
00354     signbit(_Tp __f)
00355     {
00356       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00357       return __builtin_signbit(__type(__f));
00358     }
00359 
00360   template<typename _Tp>
00361     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00362                                            int>::__type
00363     isgreater(_Tp __f1, _Tp __f2)
00364     {
00365       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00366       return __builtin_isgreater(__type(__f1), __type(__f2));
00367     }
00368 
00369   template<typename _Tp>
00370     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00371                                            int>::__type
00372     isgreaterequal(_Tp __f1, _Tp __f2)
00373     {
00374       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00375       return __builtin_isgreaterequal(__type(__f1), __type(__f2));
00376     }
00377 
00378   template<typename _Tp>
00379     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00380                                            int>::__type
00381     isless(_Tp __f1, _Tp __f2)
00382     {
00383       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00384       return __builtin_isless(__type(__f1), __type(__f2));
00385     }
00386 
00387   template<typename _Tp>
00388     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00389                                            int>::__type
00390     islessequal(_Tp __f1, _Tp __f2)
00391     {
00392       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00393       return __builtin_islessequal(__type(__f1), __type(__f2));
00394     }
00395 
00396   template<typename _Tp>
00397     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00398                                            int>::__type
00399     islessgreater(_Tp __f1, _Tp __f2)
00400     {
00401       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00402       return __builtin_islessgreater(__type(__f1), __type(__f2));
00403     }
00404 
00405   template<typename _Tp>
00406     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00407                                            int>::__type
00408     isunordered(_Tp __f1, _Tp __f2)
00409     {
00410       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00411       return __builtin_isunordered(__type(__f1), __type(__f2));
00412     }
00413 
00414 #endif
00415 #endif
00416 
00417 #if _GLIBCXX_USE_C99_MATH_TR1
00418 
00419   /// Additional overloads [8.16.4].
00420   using std::acos;
00421 
00422 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00423   inline float
00424   acosh(float __x)
00425   { return __builtin_acoshf(__x); }
00426 
00427   inline long double
00428   acosh(long double __x)
00429   { return __builtin_acoshl(__x); }
00430 #endif
00431 
00432   template<typename _Tp>
00433     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00434                                            double>::__type
00435     acosh(_Tp __x)
00436     { return __builtin_acosh(__x); }
00437 
00438   using std::asin;
00439 
00440 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00441   inline float
00442   asinh(float __x)
00443   { return __builtin_asinhf(__x); }
00444 
00445   inline long double
00446   asinh(long double __x)
00447   { return __builtin_asinhl(__x); }
00448 #endif
00449 
00450   template<typename _Tp>
00451     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00452                                            double>::__type
00453     asinh(_Tp __x)
00454     { return __builtin_asinh(__x); }
00455 
00456   using std::atan;
00457   using std::atan2;
00458 
00459 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00460   inline float
00461   atanh(float __x)
00462   { return __builtin_atanhf(__x); }
00463 
00464   inline long double
00465   atanh(long double __x)
00466   { return __builtin_atanhl(__x); }
00467 #endif
00468 
00469   template<typename _Tp>
00470     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00471                                            double>::__type
00472     atanh(_Tp __x)
00473     { return __builtin_atanh(__x); }
00474 
00475 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00476   inline float
00477   cbrt(float __x)
00478   { return __builtin_cbrtf(__x); }
00479 
00480   inline long double
00481   cbrt(long double __x)
00482   { return __builtin_cbrtl(__x); }
00483 #endif
00484 
00485   template<typename _Tp>
00486     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00487                                            double>::__type
00488     cbrt(_Tp __x)
00489     { return __builtin_cbrt(__x); }
00490 
00491   using std::ceil;
00492 
00493 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00494   inline float
00495   copysign(float __x, float __y)
00496   { return __builtin_copysignf(__x, __y); }
00497 
00498   inline long double
00499   copysign(long double __x, long double __y)
00500   { return __builtin_copysignl(__x, __y); }
00501 #endif
00502 
00503   template<typename _Tp, typename _Up>
00504     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00505     copysign(_Tp __x, _Up __y)
00506     {
00507       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00508       return copysign(__type(__x), __type(__y));
00509     }
00510 
00511   using std::cos;
00512   using std::cosh;  
00513 
00514 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00515   inline float
00516   erf(float __x)
00517   { return __builtin_erff(__x); }
00518 
00519   inline long double
00520   erf(long double __x)
00521   { return __builtin_erfl(__x); }
00522 #endif
00523 
00524   template<typename _Tp>
00525     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00526                                            double>::__type
00527     erf(_Tp __x)
00528     { return __builtin_erf(__x); }
00529 
00530 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00531   inline float
00532   erfc(float __x)
00533   { return __builtin_erfcf(__x); }
00534 
00535   inline long double
00536   erfc(long double __x)
00537   { return __builtin_erfcl(__x); }
00538 #endif
00539 
00540   template<typename _Tp>
00541     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00542                                            double>::__type
00543     erfc(_Tp __x)
00544     { return __builtin_erfc(__x); }
00545 
00546   using std::exp;
00547 
00548 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00549   inline float
00550   exp2(float __x)
00551   { return __builtin_exp2f(__x); }
00552 
00553   inline long double
00554   exp2(long double __x)
00555   { return __builtin_exp2l(__x); }
00556 #endif
00557 
00558   template<typename _Tp>
00559     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00560                                            double>::__type
00561     exp2(_Tp __x)
00562     { return __builtin_exp2(__x); }
00563 
00564 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00565   inline float
00566   expm1(float __x)
00567   { return __builtin_expm1f(__x); }
00568 
00569   inline long double
00570   expm1(long double __x)
00571   { return __builtin_expm1l(__x); }
00572 #endif
00573 
00574   template<typename _Tp>
00575     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00576                                            double>::__type
00577     expm1(_Tp __x)
00578     { return __builtin_expm1(__x); }
00579 
00580   // Note: we deal with fabs in a special way, because an using std::fabs
00581   // would bring in also the overloads for complex types, which in C++0x
00582   // mode have a different return type.
00583   // With __CORRECT_ISO_CPP_MATH_H_PROTO, math.h imports std::fabs in the
00584   // global namespace after the declarations of the float / double / long
00585   // double overloads but before the std::complex overloads.
00586   using ::fabs;
00587 
00588 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
00589 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00590   inline float
00591   fabs(float __x)
00592   { return __builtin_fabsf(__x); }
00593 
00594   inline long double
00595   fabs(long double __x)
00596   { return __builtin_fabsl(__x); }
00597 #endif
00598 
00599   template<typename _Tp>
00600     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00601                                            double>::__type
00602     fabs(_Tp __x)
00603     { return __builtin_fabs(__x); }
00604 #endif
00605 
00606 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00607   inline float
00608   fdim(float __x, float __y)
00609   { return __builtin_fdimf(__x, __y); }
00610 
00611   inline long double
00612   fdim(long double __x, long double __y)
00613   { return __builtin_fdiml(__x, __y); }
00614 #endif
00615 
00616   template<typename _Tp, typename _Up>
00617     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00618     fdim(_Tp __x, _Up __y)
00619     {
00620       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00621       return fdim(__type(__x), __type(__y));
00622     }
00623 
00624   using std::floor;
00625 
00626 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00627   inline float
00628   fma(float __x, float __y, float __z)
00629   { return __builtin_fmaf(__x, __y, __z); }
00630 
00631   inline long double
00632   fma(long double __x, long double __y, long double __z)
00633   { return __builtin_fmal(__x, __y, __z); }
00634 #endif
00635 
00636   template<typename _Tp, typename _Up, typename _Vp>
00637     inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
00638     fma(_Tp __x, _Up __y, _Vp __z)
00639     {
00640       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
00641       return fma(__type(__x), __type(__y), __type(__z));
00642     }
00643 
00644 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00645   inline float
00646   fmax(float __x, float __y)
00647   { return __builtin_fmaxf(__x, __y); }
00648 
00649   inline long double
00650   fmax(long double __x, long double __y)
00651   { return __builtin_fmaxl(__x, __y); }
00652 #endif
00653 
00654   template<typename _Tp, typename _Up>
00655     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00656     fmax(_Tp __x, _Up __y)
00657     {
00658       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00659       return fmax(__type(__x), __type(__y));
00660     }
00661 
00662 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00663   inline float
00664   fmin(float __x, float __y)
00665   { return __builtin_fminf(__x, __y); }
00666 
00667   inline long double
00668   fmin(long double __x, long double __y)
00669   { return __builtin_fminl(__x, __y); }
00670 #endif
00671 
00672   template<typename _Tp, typename _Up>
00673     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00674     fmin(_Tp __x, _Up __y)
00675     {
00676       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00677       return fmin(__type(__x), __type(__y));
00678     }
00679 
00680   using std::fmod;
00681   using std::frexp;
00682 
00683 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00684   inline float
00685   hypot(float __x, float __y)
00686   { return __builtin_hypotf(__x, __y); }
00687 
00688   inline long double
00689   hypot(long double __x, long double __y)
00690   { return __builtin_hypotl(__x, __y); }
00691 #endif
00692 
00693   template<typename _Tp, typename _Up>
00694     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00695     hypot(_Tp __y, _Up __x)
00696     {
00697       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00698       return hypot(__type(__y), __type(__x));
00699     }
00700 
00701 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00702   inline int
00703   ilogb(float __x)
00704   { return __builtin_ilogbf(__x); }
00705 
00706   inline int
00707   ilogb(long double __x)
00708   { return __builtin_ilogbl(__x); }
00709 #endif
00710 
00711   template<typename _Tp>
00712     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00713                                            int>::__type
00714     ilogb(_Tp __x)
00715     { return __builtin_ilogb(__x); }
00716 
00717   using std::ldexp;
00718 
00719 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00720   inline float
00721   lgamma(float __x)
00722   { return __builtin_lgammaf(__x); }
00723 
00724   inline long double
00725   lgamma(long double __x)
00726   { return __builtin_lgammal(__x); }
00727 #endif
00728 
00729   template<typename _Tp>
00730     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00731                                            double>::__type
00732     lgamma(_Tp __x)
00733     { return __builtin_lgamma(__x); }
00734 
00735 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00736   inline long long
00737   llrint(float __x)
00738   { return __builtin_llrintf(__x); }
00739 
00740   inline long long
00741   llrint(long double __x)
00742   { return __builtin_llrintl(__x); }
00743 #endif
00744 
00745   template<typename _Tp>
00746     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00747                                            long long>::__type
00748     llrint(_Tp __x)
00749     { return __builtin_llrint(__x); }
00750 
00751 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00752   inline long long
00753   llround(float __x)
00754   { return __builtin_llroundf(__x); }
00755 
00756   inline long long
00757   llround(long double __x)
00758   { return __builtin_llroundl(__x); }
00759 #endif
00760 
00761   template<typename _Tp>
00762     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00763                                            long long>::__type
00764     llround(_Tp __x)
00765     { return __builtin_llround(__x); }
00766 
00767   using std::log;
00768   using std::log10;
00769 
00770 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00771   inline float
00772   log1p(float __x)
00773   { return __builtin_log1pf(__x); }
00774 
00775   inline long double
00776   log1p(long double __x)
00777   { return __builtin_log1pl(__x); }
00778 #endif
00779 
00780   template<typename _Tp>
00781     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00782                                            double>::__type
00783     log1p(_Tp __x)
00784     { return __builtin_log1p(__x); }
00785 
00786   // DR 568.
00787 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00788   inline float
00789   log2(float __x)
00790   { return __builtin_log2f(__x); }
00791 
00792   inline long double
00793   log2(long double __x)
00794   { return __builtin_log2l(__x); }
00795 #endif
00796 
00797   template<typename _Tp>
00798     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00799                                            double>::__type
00800     log2(_Tp __x)
00801     { return __builtin_log2(__x); }
00802 
00803 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00804   inline float
00805   logb(float __x)
00806   { return __builtin_logbf(__x); }
00807 
00808   inline long double
00809   logb(long double __x)
00810   { return __builtin_logbl(__x); }
00811 #endif
00812 
00813   template<typename _Tp>
00814     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00815                                            double>::__type
00816     logb(_Tp __x)
00817     {
00818       return __builtin_logb(__x);
00819     }
00820 
00821 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00822   inline long
00823   lrint(float __x)
00824   { return __builtin_lrintf(__x); }
00825 
00826   inline long
00827   lrint(long double __x)
00828   { return __builtin_lrintl(__x); }
00829 #endif
00830 
00831   template<typename _Tp>
00832     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00833                                            long>::__type
00834     lrint(_Tp __x)
00835     { return __builtin_lrint(__x); }
00836 
00837 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00838   inline long
00839   lround(float __x)
00840   { return __builtin_lroundf(__x); }
00841 
00842   inline long
00843   lround(long double __x)
00844   { return __builtin_lroundl(__x); }
00845 #endif
00846 
00847   template<typename _Tp>
00848     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00849                                            long>::__type
00850     lround(_Tp __x)
00851     { return __builtin_lround(__x); }
00852 
00853 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00854   inline float
00855   nearbyint(float __x)
00856   { return __builtin_nearbyintf(__x); }
00857 
00858   inline long double
00859   nearbyint(long double __x)
00860   { return __builtin_nearbyintl(__x); }
00861 #endif
00862 
00863   template<typename _Tp>
00864     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00865                                            double>::__type
00866     nearbyint(_Tp __x)
00867     { return __builtin_nearbyint(__x); }
00868 
00869 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00870   inline float
00871   nextafter(float __x, float __y)
00872   { return __builtin_nextafterf(__x, __y); }
00873 
00874   inline long double
00875   nextafter(long double __x, long double __y)
00876   { return __builtin_nextafterl(__x, __y); }
00877 #endif
00878 
00879   template<typename _Tp, typename _Up>
00880     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00881     nextafter(_Tp __x, _Up __y)
00882     {
00883       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00884       return nextafter(__type(__x), __type(__y));
00885     }
00886 
00887 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00888   inline float
00889   nexttoward(float __x, long double __y)
00890   { return __builtin_nexttowardf(__x, __y); }
00891 
00892   inline long double
00893   nexttoward(long double __x, long double __y)
00894   { return __builtin_nexttowardl(__x, __y); }
00895 #endif
00896 
00897   template<typename _Tp>
00898     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00899                                            double>::__type
00900     nexttoward(_Tp __x, long double __y)
00901     { return __builtin_nexttoward(__x, __y); }
00902 
00903 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00904   inline float
00905   remainder(float __x, float __y)
00906   { return __builtin_remainderf(__x, __y); }
00907 
00908   inline long double
00909   remainder(long double __x, long double __y)
00910   { return __builtin_remainderl(__x, __y); }
00911 #endif
00912 
00913   template<typename _Tp, typename _Up>
00914     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00915     remainder(_Tp __x, _Up __y)
00916     {
00917       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00918       return remainder(__type(__x), __type(__y));
00919     }
00920 
00921 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00922   inline float
00923   remquo(float __x, float __y, int* __pquo)
00924   { return __builtin_remquof(__x, __y, __pquo); }
00925 
00926   inline long double
00927   remquo(long double __x, long double __y, int* __pquo)
00928   { return __builtin_remquol(__x, __y, __pquo); }
00929 #endif
00930 
00931   template<typename _Tp, typename _Up>
00932     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00933     remquo(_Tp __x, _Up __y, int* __pquo)
00934     {
00935       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00936       return remquo(__type(__x), __type(__y), __pquo);
00937     }
00938 
00939 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00940   inline float
00941   rint(float __x)
00942   { return __builtin_rintf(__x); }
00943 
00944   inline long double
00945   rint(long double __x)
00946   { return __builtin_rintl(__x); }
00947 #endif
00948 
00949   template<typename _Tp>
00950     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00951                                            double>::__type
00952     rint(_Tp __x)
00953     { return __builtin_rint(__x); }
00954 
00955 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00956   inline float
00957   round(float __x)
00958   { return __builtin_roundf(__x); }
00959 
00960   inline long double
00961   round(long double __x)
00962   { return __builtin_roundl(__x); }
00963 #endif
00964 
00965   template<typename _Tp>
00966     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00967                                            double>::__type
00968     round(_Tp __x)
00969     { return __builtin_round(__x); }
00970 
00971 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00972   inline float
00973   scalbln(float __x, long __ex)
00974   { return __builtin_scalblnf(__x, __ex); }
00975 
00976   inline long double
00977   scalbln(long double __x, long __ex)
00978   { return __builtin_scalblnl(__x, __ex); }
00979 #endif
00980 
00981   template<typename _Tp>
00982     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00983                                            double>::__type
00984     scalbln(_Tp __x, long __ex)
00985     { return __builtin_scalbln(__x, __ex); }
00986  
00987 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
00988   inline float
00989   scalbn(float __x, int __ex)
00990   { return __builtin_scalbnf(__x, __ex); }
00991 
00992   inline long double
00993   scalbn(long double __x, int __ex)
00994   { return __builtin_scalbnl(__x, __ex); }
00995 #endif
00996 
00997   template<typename _Tp>
00998     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00999                                            double>::__type
01000     scalbn(_Tp __x, int __ex)
01001     { return __builtin_scalbn(__x, __ex); }
01002 
01003   using std::sin;
01004   using std::sinh;
01005   using std::sqrt;
01006   using std::tan;
01007   using std::tanh;
01008 
01009 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
01010   inline float
01011   tgamma(float __x)
01012   { return __builtin_tgammaf(__x); }
01013 
01014   inline long double
01015   tgamma(long double __x)
01016   { return __builtin_tgammal(__x); }
01017 #endif
01018 
01019   template<typename _Tp>
01020     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01021                                            double>::__type
01022     tgamma(_Tp __x)
01023     { return __builtin_tgamma(__x); }
01024  
01025 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
01026   inline float
01027   trunc(float __x)
01028   { return __builtin_truncf(__x); }
01029 
01030   inline long double
01031   trunc(long double __x)
01032   { return __builtin_truncl(__x); }
01033 #endif
01034 
01035   template<typename _Tp>
01036     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01037                                            double>::__type
01038     trunc(_Tp __x)
01039     { return __builtin_trunc(__x); }
01040 
01041 #endif
01042 _GLIBCXX_END_NAMESPACE_VERSION
01043 }
01044 }
01045 
01046 namespace std _GLIBCXX_VISIBILITY(default)
01047 {
01048 namespace tr1
01049 {
01050 _GLIBCXX_BEGIN_NAMESPACE_VERSION
01051 
01052   // DR 550. What should the return type of pow(float,int) be?
01053   // NB: C++0x and TR1 != C++03.
01054 
01055   // The std::tr1::pow(double, double) overload cannot be provided
01056   // here, because it would clash with ::pow(double,double) declared
01057   // in <math.h>, if <tr1/math.h> is included at the same time (raised
01058   // by the fix of PR c++/54537). It is not possible either to use the
01059   // using-declaration 'using ::pow;' here, because if the user code
01060   // has a 'using std::pow;', it would bring the pow(*,int) averloads
01061   // in the tr1 namespace, which is undesirable. Consequently, the
01062   // solution is to forward std::tr1::pow(double,double) to
01063   // std::pow(double,double) via the templatized version below. See
01064   // the discussion about this issue here:
01065   // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
01066 
01067 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
01068   inline float
01069   pow(float __x, float __y)
01070   { return std::pow(__x, __y); }
01071 
01072   inline long double
01073   pow(long double __x, long double __y)
01074   { return std::pow(__x, __y); }
01075 #endif
01076 
01077   template<typename _Tp, typename _Up>
01078     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01079     pow(_Tp __x, _Up __y)
01080     {
01081       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01082       return std::pow(__type(__x), __type(__y));
01083     }
01084 
01085 _GLIBCXX_END_NAMESPACE_VERSION
01086 }
01087 }
01088 
01089 #include <bits/stl_algobase.h>
01090 #include <limits>
01091 #include <tr1/type_traits>
01092 
01093 #include <tr1/gamma.tcc>
01094 #include <tr1/bessel_function.tcc>
01095 #include <tr1/beta_function.tcc>
01096 #include <tr1/ell_integral.tcc>
01097 #include <tr1/exp_integral.tcc>
01098 #include <tr1/hypergeometric.tcc>
01099 #include <tr1/legendre_function.tcc>
01100 #include <tr1/modified_bessel_func.tcc>
01101 #include <tr1/poly_hermite.tcc>
01102 #include <tr1/poly_laguerre.tcc>
01103 #include <tr1/riemann_zeta.tcc>
01104 
01105 namespace std _GLIBCXX_VISIBILITY(default)
01106 {
01107 namespace tr1
01108 {
01109 _GLIBCXX_BEGIN_NAMESPACE_VERSION
01110 
01111   /**
01112    * @defgroup tr1_math_spec_func Mathematical Special Functions
01113    * @ingroup numerics
01114    *
01115    * A collection of advanced mathematical special functions.
01116    * @{
01117    */
01118 
01119   inline float
01120   assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
01121   { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
01122 
01123   inline long double
01124   assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
01125   {
01126     return __detail::__assoc_laguerre<long double>(__n, __m, __x);
01127   }
01128 
01129   ///  5.2.1.1  Associated Laguerre polynomials.
01130   template<typename _Tp>
01131     inline typename __gnu_cxx::__promote<_Tp>::__type
01132     assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
01133     {
01134       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01135       return __detail::__assoc_laguerre<__type>(__n, __m, __x);
01136     }
01137 
01138   inline float
01139   assoc_legendref(unsigned int __l, unsigned int __m, float __x)
01140   { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
01141 
01142   inline long double
01143   assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
01144   { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
01145 
01146   ///  5.2.1.2  Associated Legendre functions.
01147   template<typename _Tp>
01148     inline typename __gnu_cxx::__promote<_Tp>::__type
01149     assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
01150     {
01151       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01152       return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
01153     }
01154 
01155   inline float
01156   betaf(float __x, float __y)
01157   { return __detail::__beta<float>(__x, __y); }
01158 
01159   inline long double
01160   betal(long double __x, long double __y)
01161   { return __detail::__beta<long double>(__x, __y); }
01162 
01163   ///  5.2.1.3  Beta functions.
01164   template<typename _Tpx, typename _Tpy>
01165     inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
01166     beta(_Tpx __x, _Tpy __y)
01167     {
01168       typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
01169       return __detail::__beta<__type>(__x, __y);
01170     }
01171 
01172   inline float
01173   comp_ellint_1f(float __k)
01174   { return __detail::__comp_ellint_1<float>(__k); }
01175 
01176   inline long double
01177   comp_ellint_1l(long double __k)
01178   { return __detail::__comp_ellint_1<long double>(__k); }
01179 
01180   ///  5.2.1.4  Complete elliptic integrals of the first kind.
01181   template<typename _Tp>
01182     inline typename __gnu_cxx::__promote<_Tp>::__type
01183     comp_ellint_1(_Tp __k)
01184     {
01185       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01186       return __detail::__comp_ellint_1<__type>(__k);
01187     }
01188 
01189   inline float
01190   comp_ellint_2f(float __k)
01191   { return __detail::__comp_ellint_2<float>(__k); }
01192 
01193   inline long double
01194   comp_ellint_2l(long double __k)
01195   { return __detail::__comp_ellint_2<long double>(__k); }
01196 
01197   ///  5.2.1.5  Complete elliptic integrals of the second kind.
01198   template<typename _Tp>
01199     inline typename __gnu_cxx::__promote<_Tp>::__type
01200     comp_ellint_2(_Tp __k)
01201     {
01202       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01203       return __detail::__comp_ellint_2<__type>(__k);
01204     }
01205 
01206   inline float
01207   comp_ellint_3f(float __k, float __nu)
01208   { return __detail::__comp_ellint_3<float>(__k, __nu); }
01209 
01210   inline long double
01211   comp_ellint_3l(long double __k, long double __nu)
01212   { return __detail::__comp_ellint_3<long double>(__k, __nu); }
01213 
01214   ///  5.2.1.6  Complete elliptic integrals of the third kind.
01215   template<typename _Tp, typename _Tpn>
01216     inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
01217     comp_ellint_3(_Tp __k, _Tpn __nu)
01218     {
01219       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
01220       return __detail::__comp_ellint_3<__type>(__k, __nu);
01221     }
01222 
01223   inline float
01224   conf_hypergf(float __a, float __c, float __x)
01225   { return __detail::__conf_hyperg<float>(__a, __c, __x); }
01226 
01227   inline long double
01228   conf_hypergl(long double __a, long double __c, long double __x)
01229   { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
01230 
01231   ///  5.2.1.7  Confluent hypergeometric functions.
01232   template<typename _Tpa, typename _Tpc, typename _Tp>
01233     inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
01234     conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
01235     {
01236       typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
01237       return __detail::__conf_hyperg<__type>(__a, __c, __x);
01238     }
01239 
01240   inline float
01241   cyl_bessel_if(float __nu, float __x)
01242   { return __detail::__cyl_bessel_i<float>(__nu, __x); }
01243 
01244   inline long double
01245   cyl_bessel_il(long double __nu, long double __x)
01246   { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
01247 
01248   ///  5.2.1.8  Regular modified cylindrical Bessel functions.
01249   template<typename _Tpnu, typename _Tp>
01250     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
01251     cyl_bessel_i(_Tpnu __nu, _Tp __x)
01252     {
01253       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
01254       return __detail::__cyl_bessel_i<__type>(__nu, __x);
01255     }
01256 
01257   inline float
01258   cyl_bessel_jf(float __nu, float __x)
01259   { return __detail::__cyl_bessel_j<float>(__nu, __x); }
01260 
01261   inline long double
01262   cyl_bessel_jl(long double __nu, long double __x)
01263   { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
01264 
01265   ///  5.2.1.9  Cylindrical Bessel functions (of the first kind).
01266   template<typename _Tpnu, typename _Tp>
01267     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
01268     cyl_bessel_j(_Tpnu __nu, _Tp __x)
01269     {
01270       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
01271       return __detail::__cyl_bessel_j<__type>(__nu, __x);
01272     }
01273 
01274   inline float
01275   cyl_bessel_kf(float __nu, float __x)
01276   { return __detail::__cyl_bessel_k<float>(__nu, __x); }
01277 
01278   inline long double
01279   cyl_bessel_kl(long double __nu, long double __x)
01280   { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
01281 
01282   ///  5.2.1.10  Irregular modified cylindrical Bessel functions.
01283   template<typename _Tpnu, typename _Tp>
01284     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
01285     cyl_bessel_k(_Tpnu __nu, _Tp __x)
01286     {
01287       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
01288       return __detail::__cyl_bessel_k<__type>(__nu, __x);
01289     }
01290 
01291   inline float
01292   cyl_neumannf(float __nu, float __x)
01293   { return __detail::__cyl_neumann_n<float>(__nu, __x); }
01294 
01295   inline long double
01296   cyl_neumannl(long double __nu, long double __x)
01297   { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
01298 
01299   ///  5.2.1.11  Cylindrical Neumann functions.
01300   template<typename _Tpnu, typename _Tp>
01301     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
01302     cyl_neumann(_Tpnu __nu, _Tp __x)
01303     {
01304       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
01305       return __detail::__cyl_neumann_n<__type>(__nu, __x);
01306     }
01307 
01308   inline float
01309   ellint_1f(float __k, float __phi)
01310   { return __detail::__ellint_1<float>(__k, __phi); }
01311 
01312   inline long double
01313   ellint_1l(long double __k, long double __phi)
01314   { return __detail::__ellint_1<long double>(__k, __phi); }
01315 
01316   ///  5.2.1.12  Incomplete elliptic integrals of the first kind.
01317   template<typename _Tp, typename _Tpp>
01318     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
01319     ellint_1(_Tp __k, _Tpp __phi)
01320     {
01321       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
01322       return __detail::__ellint_1<__type>(__k, __phi);
01323     }
01324 
01325   inline float
01326   ellint_2f(float __k, float __phi)
01327   { return __detail::__ellint_2<float>(__k, __phi); }
01328 
01329   inline long double
01330   ellint_2l(long double __k, long double __phi)
01331   { return __detail::__ellint_2<long double>(__k, __phi); }
01332 
01333   ///  5.2.1.13  Incomplete elliptic integrals of the second kind.
01334   template<typename _Tp, typename _Tpp>
01335     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
01336     ellint_2(_Tp __k, _Tpp __phi)
01337     {
01338       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
01339       return __detail::__ellint_2<__type>(__k, __phi);
01340     }
01341 
01342   inline float
01343   ellint_3f(float __k, float __nu, float __phi)
01344   { return __detail::__ellint_3<float>(__k, __nu, __phi); }
01345 
01346   inline long double
01347   ellint_3l(long double __k, long double __nu, long double __phi)
01348   { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
01349 
01350   ///  5.2.1.14  Incomplete elliptic integrals of the third kind.
01351   template<typename _Tp, typename _Tpn, typename _Tpp>
01352     inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
01353     ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
01354     {
01355       typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
01356       return __detail::__ellint_3<__type>(__k, __nu, __phi);
01357     }
01358 
01359   inline float
01360   expintf(float __x)
01361   { return __detail::__expint<float>(__x); }
01362 
01363   inline long double
01364   expintl(long double __x)
01365   { return __detail::__expint<long double>(__x); }
01366 
01367   ///  5.2.1.15  Exponential integrals.
01368   template<typename _Tp>
01369     inline typename __gnu_cxx::__promote<_Tp>::__type
01370     expint(_Tp __x)
01371     {
01372       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01373       return __detail::__expint<__type>(__x);
01374     }
01375 
01376   inline float
01377   hermitef(unsigned int __n, float __x)
01378   { return __detail::__poly_hermite<float>(__n, __x); }
01379 
01380   inline long double
01381   hermitel(unsigned int __n, long double __x)
01382   { return __detail::__poly_hermite<long double>(__n, __x); }
01383 
01384   ///  5.2.1.16  Hermite polynomials.
01385   template<typename _Tp>
01386     inline typename __gnu_cxx::__promote<_Tp>::__type
01387     hermite(unsigned int __n, _Tp __x)
01388     {
01389       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01390       return __detail::__poly_hermite<__type>(__n, __x);
01391     }
01392 
01393   inline float
01394   hypergf(float __a, float __b, float __c, float __x)
01395   { return __detail::__hyperg<float>(__a, __b, __c, __x); }
01396 
01397   inline long double
01398   hypergl(long double __a, long double __b, long double __c, long double __x)
01399   { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
01400 
01401   ///  5.2.1.17  Hypergeometric functions.
01402   template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
01403     inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
01404     hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
01405     {
01406       typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
01407       return __detail::__hyperg<__type>(__a, __b, __c, __x);
01408     }
01409 
01410   inline float
01411   laguerref(unsigned int __n, float __x)
01412   { return __detail::__laguerre<float>(__n, __x); }
01413 
01414   inline long double
01415   laguerrel(unsigned int __n, long double __x)
01416   { return __detail::__laguerre<long double>(__n, __x); }
01417 
01418   ///  5.2.1.18  Laguerre polynomials.
01419   template<typename _Tp>
01420     inline typename __gnu_cxx::__promote<_Tp>::__type
01421     laguerre(unsigned int __n, _Tp __x)
01422     {
01423       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01424       return __detail::__laguerre<__type>(__n, __x);
01425     }
01426 
01427   inline float
01428   legendref(unsigned int __n, float __x)
01429   { return __detail::__poly_legendre_p<float>(__n, __x); }
01430 
01431   inline long double
01432   legendrel(unsigned int __n, long double __x)
01433   { return __detail::__poly_legendre_p<long double>(__n, __x); }
01434 
01435   ///  5.2.1.19  Legendre polynomials.
01436   template<typename _Tp>
01437     inline typename __gnu_cxx::__promote<_Tp>::__type
01438     legendre(unsigned int __n, _Tp __x)
01439     {
01440       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01441       return __detail::__poly_legendre_p<__type>(__n, __x);
01442     }
01443 
01444   inline float
01445   riemann_zetaf(float __x)
01446   { return __detail::__riemann_zeta<float>(__x); }
01447 
01448   inline long double
01449   riemann_zetal(long double __x)
01450   { return __detail::__riemann_zeta<long double>(__x); }
01451 
01452   ///  5.2.1.20  Riemann zeta function.
01453   template<typename _Tp>
01454     inline typename __gnu_cxx::__promote<_Tp>::__type
01455     riemann_zeta(_Tp __x)
01456     {
01457       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01458       return __detail::__riemann_zeta<__type>(__x);
01459     }
01460 
01461   inline float
01462   sph_besself(unsigned int __n, float __x)
01463   { return __detail::__sph_bessel<float>(__n, __x); }
01464 
01465   inline long double
01466   sph_bessell(unsigned int __n, long double __x)
01467   { return __detail::__sph_bessel<long double>(__n, __x); }
01468 
01469   ///  5.2.1.21  Spherical Bessel functions.
01470   template<typename _Tp>
01471     inline typename __gnu_cxx::__promote<_Tp>::__type
01472     sph_bessel(unsigned int __n, _Tp __x)
01473     {
01474       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01475       return __detail::__sph_bessel<__type>(__n, __x);
01476     }
01477 
01478   inline float
01479   sph_legendref(unsigned int __l, unsigned int __m, float __theta)
01480   { return __detail::__sph_legendre<float>(__l, __m, __theta); }
01481 
01482   inline long double
01483   sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
01484   { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
01485 
01486   ///  5.2.1.22  Spherical associated Legendre functions.
01487   template<typename _Tp>
01488     inline typename __gnu_cxx::__promote<_Tp>::__type
01489     sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
01490     {
01491       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01492       return __detail::__sph_legendre<__type>(__l, __m, __theta);
01493     }
01494 
01495   inline float
01496   sph_neumannf(unsigned int __n, float __x)
01497   { return __detail::__sph_neumann<float>(__n, __x); }
01498 
01499   inline long double
01500   sph_neumannl(unsigned int __n, long double __x)
01501   { return __detail::__sph_neumann<long double>(__n, __x); }
01502 
01503   ///  5.2.1.23  Spherical Neumann functions.
01504   template<typename _Tp>
01505     inline typename __gnu_cxx::__promote<_Tp>::__type
01506     sph_neumann(unsigned int __n, _Tp __x)
01507     {
01508       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
01509       return __detail::__sph_neumann<__type>(__n, __x);
01510     }
01511 
01512   /* @} */ // tr1_math_spec_func
01513 _GLIBCXX_END_NAMESPACE_VERSION
01514 }
01515 }
01516 
01517 #endif // _GLIBCXX_TR1_CMATH