Home | History | Annotate | Download | only in tr1
      1 // TR1 cmath -*- C++ -*-
      2 
      3 // Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
      4 // Free Software Foundation, Inc.
      5 //
      6 // This file is part of the GNU ISO C++ Library.  This library is free
      7 // software; you can redistribute it and/or modify it under the
      8 // terms of the GNU General Public License as published by the
      9 // Free Software Foundation; either version 3, or (at your option)
     10 // any later version.
     11 
     12 // This library is distributed in the hope that it will be useful,
     13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 // GNU General Public License for more details.
     16 
     17 // Under Section 7 of GPL version 3, you are granted additional
     18 // permissions described in the GCC Runtime Library Exception, version
     19 // 3.1, as published by the Free Software Foundation.
     20 
     21 // You should have received a copy of the GNU General Public License and
     22 // a copy of the GCC Runtime Library Exception along with this program;
     23 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     24 // <http://www.gnu.org/licenses/>.
     25 
     26 /** @file tr1/cmath
     27  *  This is a TR1 C++ Library header. 
     28  */
     29 
     30 #ifndef _GLIBCXX_TR1_CMATH
     31 #define _GLIBCXX_TR1_CMATH 1
     32 
     33 #pragma GCC system_header
     34 
     35 #include <cmath>
     36 
     37 #ifdef _GLIBCXX_USE_C99_MATH_TR1
     38 
     39 #undef acosh
     40 #undef acoshf
     41 #undef acoshl
     42 #undef asinh
     43 #undef asinhf
     44 #undef asinhl
     45 #undef atanh
     46 #undef atanhf
     47 #undef atanhl
     48 #undef cbrt
     49 #undef cbrtf
     50 #undef cbrtl
     51 #undef copysign
     52 #undef copysignf
     53 #undef copysignl
     54 #undef erf
     55 #undef erff
     56 #undef erfl
     57 #undef erfc
     58 #undef erfcf
     59 #undef erfcl
     60 #undef exp2
     61 #undef exp2f
     62 #undef exp2l
     63 #undef expm1
     64 #undef expm1f
     65 #undef expm1l
     66 #undef fdim
     67 #undef fdimf
     68 #undef fdiml
     69 #undef fma
     70 #undef fmaf
     71 #undef fmal
     72 #undef fmax
     73 #undef fmaxf
     74 #undef fmaxl
     75 #undef fmin
     76 #undef fminf
     77 #undef fminl
     78 #undef hypot
     79 #undef hypotf
     80 #undef hypotl
     81 #undef ilogb
     82 #undef ilogbf
     83 #undef ilogbl
     84 #undef lgamma
     85 #undef lgammaf
     86 #undef lgammal
     87 #undef llrint
     88 #undef llrintf
     89 #undef llrintl
     90 #undef llround
     91 #undef llroundf
     92 #undef llroundl
     93 #undef log1p
     94 #undef log1pf
     95 #undef log1pl
     96 #undef log2
     97 #undef log2f
     98 #undef log2l
     99 #undef logb
    100 #undef logbf
    101 #undef logbl
    102 #undef lrint
    103 #undef lrintf
    104 #undef lrintl
    105 #undef lround
    106 #undef lroundf
    107 #undef lroundl
    108 #undef nan
    109 #undef nanf
    110 #undef nanl
    111 #undef nearbyint
    112 #undef nearbyintf
    113 #undef nearbyintl
    114 #undef nextafter
    115 #undef nextafterf
    116 #undef nextafterl
    117 #undef nexttoward
    118 #undef nexttowardf
    119 #undef nexttowardl
    120 #undef remainder
    121 #undef remainderf
    122 #undef remainderl
    123 #undef remquo
    124 #undef remquof
    125 #undef remquol
    126 #undef rint
    127 #undef rintf
    128 #undef rintl
    129 #undef round
    130 #undef roundf
    131 #undef roundl
    132 #undef scalbln
    133 #undef scalblnf
    134 #undef scalblnl
    135 #undef scalbn
    136 #undef scalbnf
    137 #undef scalbnl
    138 #undef tgamma
    139 #undef tgammaf
    140 #undef tgammal
    141 #undef trunc
    142 #undef truncf
    143 #undef truncl
    144 
    145 #endif
    146 
    147 namespace std _GLIBCXX_VISIBILITY(default)
    148 {
    149 namespace tr1
    150 {
    151 _GLIBCXX_BEGIN_NAMESPACE_VERSION
    152 
    153 #if _GLIBCXX_USE_C99_MATH_TR1
    154 
    155   // types
    156   using ::double_t;
    157   using ::float_t;
    158 
    159   // functions
    160   using ::acosh;
    161   using ::acoshf;
    162   using ::acoshl;
    163 
    164   using ::asinh;
    165   using ::asinhf;
    166   using ::asinhl;
    167 
    168   using ::atanh;
    169   using ::atanhf;
    170   using ::atanhl;
    171 
    172   using ::cbrt;
    173   using ::cbrtf;
    174   using ::cbrtl;
    175 
    176   using ::copysign;
    177   using ::copysignf;
    178   using ::copysignl;
    179 
    180   using ::erf;
    181   using ::erff;
    182   using ::erfl;
    183 
    184   using ::erfc;
    185   using ::erfcf;
    186   using ::erfcl;
    187 
    188   using ::exp2;
    189   using ::exp2f;
    190   using ::exp2l;
    191 
    192   using ::expm1;
    193   using ::expm1f;
    194   using ::expm1l;
    195 
    196   using ::fdim;
    197   using ::fdimf;
    198   using ::fdiml;
    199 
    200   using ::fma;
    201   using ::fmaf;
    202   using ::fmal;
    203 
    204   using ::fmax;
    205   using ::fmaxf;
    206   using ::fmaxl;
    207 
    208   using ::fmin;
    209   using ::fminf;
    210   using ::fminl;
    211 
    212   using ::hypot;
    213   using ::hypotf;
    214   using ::hypotl;
    215 
    216   using ::ilogb;
    217   using ::ilogbf;
    218   using ::ilogbl;
    219 
    220   using ::lgamma;
    221   using ::lgammaf;
    222   using ::lgammal;
    223 
    224   using ::llrint;
    225   using ::llrintf;
    226   using ::llrintl;
    227 
    228   using ::llround;
    229   using ::llroundf;
    230   using ::llroundl;
    231 
    232   using ::log1p;
    233   using ::log1pf;
    234   using ::log1pl;
    235 
    236   using ::log2;
    237   using ::log2f;
    238   using ::log2l;
    239 
    240   using ::logb;
    241   using ::logbf;
    242   using ::logbl;
    243 
    244   using ::lrint;
    245   using ::lrintf;
    246   using ::lrintl;
    247 
    248   using ::lround;
    249   using ::lroundf;
    250   using ::lroundl;
    251 
    252   using ::nan;
    253   using ::nanf;
    254   using ::nanl;
    255 
    256   using ::nearbyint;
    257   using ::nearbyintf;
    258   using ::nearbyintl;
    259 
    260   using ::nextafter;
    261   using ::nextafterf;
    262   using ::nextafterl;
    263 
    264   using ::nexttoward;
    265   using ::nexttowardf;
    266   using ::nexttowardl;
    267 
    268   using ::remainder;
    269   using ::remainderf;
    270   using ::remainderl;
    271 
    272   using ::remquo;
    273   using ::remquof;
    274   using ::remquol;
    275 
    276   using ::rint;
    277   using ::rintf;
    278   using ::rintl;
    279 
    280   using ::round;
    281   using ::roundf;
    282   using ::roundl;
    283 
    284   using ::scalbln;
    285   using ::scalblnf;
    286   using ::scalblnl;
    287 
    288   using ::scalbn;
    289   using ::scalbnf;
    290   using ::scalbnl;
    291 
    292   using ::tgamma;
    293   using ::tgammaf;
    294   using ::tgammal;
    295 
    296   using ::trunc;
    297   using ::truncf;
    298   using ::truncl;
    299 
    300 #endif
    301 
    302 #if _GLIBCXX_USE_C99_MATH
    303 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
    304 
    305   /// Function template definitions [8.16.3].
    306   template<typename _Tp>
    307     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    308 					   int>::__type
    309     fpclassify(_Tp __f)
    310     {
    311       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    312       return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
    313 				  FP_SUBNORMAL, FP_ZERO, __type(__f));
    314     }
    315 
    316   template<typename _Tp>
    317     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    318 					   int>::__type
    319     isfinite(_Tp __f)
    320     {
    321       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    322       return __builtin_isfinite(__type(__f));
    323     }
    324 
    325   template<typename _Tp>
    326     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    327 					   int>::__type
    328     isinf(_Tp __f)
    329     {
    330       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    331       return __builtin_isinf(__type(__f));
    332     }
    333 
    334   template<typename _Tp>
    335     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    336 					   int>::__type
    337     isnan(_Tp __f)
    338     {
    339       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    340       return __builtin_isnan(__type(__f));
    341     }
    342 
    343   template<typename _Tp>
    344     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    345 					   int>::__type
    346     isnormal(_Tp __f)
    347     {
    348       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    349       return __builtin_isnormal(__type(__f));
    350     }
    351 
    352   template<typename _Tp>
    353     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    354 					   int>::__type
    355     signbit(_Tp __f)
    356     {
    357       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    358       return __builtin_signbit(__type(__f));
    359     }
    360 
    361   template<typename _Tp>
    362     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    363 					   int>::__type
    364     isgreater(_Tp __f1, _Tp __f2)
    365     {
    366       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    367       return __builtin_isgreater(__type(__f1), __type(__f2));
    368     }
    369 
    370   template<typename _Tp>
    371     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    372 					   int>::__type
    373     isgreaterequal(_Tp __f1, _Tp __f2)
    374     {
    375       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    376       return __builtin_isgreaterequal(__type(__f1), __type(__f2));
    377     }
    378 
    379   template<typename _Tp>
    380     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    381 					   int>::__type
    382     isless(_Tp __f1, _Tp __f2)
    383     {
    384       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    385       return __builtin_isless(__type(__f1), __type(__f2));
    386     }
    387 
    388   template<typename _Tp>
    389     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    390 					   int>::__type
    391     islessequal(_Tp __f1, _Tp __f2)
    392     {
    393       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    394       return __builtin_islessequal(__type(__f1), __type(__f2));
    395     }
    396 
    397   template<typename _Tp>
    398     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    399 					   int>::__type
    400     islessgreater(_Tp __f1, _Tp __f2)
    401     {
    402       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    403       return __builtin_islessgreater(__type(__f1), __type(__f2));
    404     }
    405 
    406   template<typename _Tp>
    407     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
    408 					   int>::__type
    409     isunordered(_Tp __f1, _Tp __f2)
    410     {
    411       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
    412       return __builtin_isunordered(__type(__f1), __type(__f2));
    413     }
    414 
    415 #endif
    416 #endif
    417 
    418 #if _GLIBCXX_USE_C99_MATH_TR1
    419 
    420   /// Additional overloads [8.16.4].
    421   using std::acos;
    422 
    423   inline float
    424   acosh(float __x)
    425   { return __builtin_acoshf(__x); }
    426 
    427   inline long double
    428   acosh(long double __x)
    429   { return __builtin_acoshl(__x); }
    430 
    431   template<typename _Tp>
    432     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    433 					   double>::__type
    434     acosh(_Tp __x)
    435     { return __builtin_acosh(__x); }
    436 
    437   using std::asin;
    438 
    439   inline float
    440   asinh(float __x)
    441   { return __builtin_asinhf(__x); }
    442 
    443   inline long double
    444   asinh(long double __x)
    445   { return __builtin_asinhl(__x); }
    446 
    447   template<typename _Tp>
    448     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    449 					   double>::__type
    450     asinh(_Tp __x)
    451     { return __builtin_asinh(__x); }
    452 
    453   using std::atan;
    454   using std::atan2;
    455 
    456   inline float
    457   atanh(float __x)
    458   { return __builtin_atanhf(__x); }
    459 
    460   inline long double
    461   atanh(long double __x)
    462   { return __builtin_atanhl(__x); }
    463 
    464   template<typename _Tp>
    465     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    466 					   double>::__type
    467     atanh(_Tp __x)
    468     { return __builtin_atanh(__x); }
    469 
    470   inline float
    471   cbrt(float __x)
    472   { return __builtin_cbrtf(__x); }
    473 
    474   inline long double
    475   cbrt(long double __x)
    476   { return __builtin_cbrtl(__x); }
    477 
    478   template<typename _Tp>
    479     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    480 					   double>::__type
    481     cbrt(_Tp __x)
    482     { return __builtin_cbrt(__x); }
    483 
    484   using std::ceil;
    485 
    486   inline float
    487   copysign(float __x, float __y)
    488   { return __builtin_copysignf(__x, __y); }
    489 
    490   inline long double
    491   copysign(long double __x, long double __y)
    492   { return __builtin_copysignl(__x, __y); }
    493 
    494   template<typename _Tp, typename _Up>
    495     inline
    496     typename __gnu_cxx::__promote_2<
    497     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    498 				    && __is_arithmetic<_Up>::__value,
    499 				    _Tp>::__type, _Up>::__type
    500     copysign(_Tp __x, _Up __y)
    501     {
    502       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    503       return copysign(__type(__x), __type(__y));
    504     }
    505 
    506   using std::cos;
    507   using std::cosh;  
    508 
    509   inline float
    510   erf(float __x)
    511   { return __builtin_erff(__x); }
    512 
    513   inline long double
    514   erf(long double __x)
    515   { return __builtin_erfl(__x); }
    516 
    517   template<typename _Tp>
    518     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    519 					   double>::__type
    520     erf(_Tp __x)
    521     { return __builtin_erf(__x); }
    522 
    523   inline float
    524   erfc(float __x)
    525   { return __builtin_erfcf(__x); }
    526 
    527   inline long double
    528   erfc(long double __x)
    529   { return __builtin_erfcl(__x); }
    530 
    531   template<typename _Tp>
    532     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    533 					   double>::__type
    534     erfc(_Tp __x)
    535     { return __builtin_erfc(__x); }
    536 
    537   using std::exp;
    538 
    539   inline float
    540   exp2(float __x)
    541   { return __builtin_exp2f(__x); }
    542 
    543   inline long double
    544   exp2(long double __x)
    545   { return __builtin_exp2l(__x); }
    546 
    547   template<typename _Tp>
    548     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    549 					   double>::__type
    550     exp2(_Tp __x)
    551     { return __builtin_exp2(__x); }
    552 
    553   inline float
    554   expm1(float __x)
    555   { return __builtin_expm1f(__x); }
    556 
    557   inline long double
    558   expm1(long double __x)
    559   { return __builtin_expm1l(__x); }
    560 
    561   template<typename _Tp>
    562     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    563 					   double>::__type
    564     expm1(_Tp __x)
    565     { return __builtin_expm1(__x); }
    566 
    567   // Note: we deal with fabs in a special way, because an using std::fabs
    568   // would bring in also the overloads for complex types, which in C++0x
    569   // mode have a different return type.
    570   using ::fabs;
    571 
    572   inline float
    573   fabs(float __x)
    574   { return __builtin_fabsf(__x); }
    575 
    576   inline long double
    577   fabs(long double __x)
    578   { return __builtin_fabsl(__x); }
    579 
    580   template<typename _Tp>
    581     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    582 					   double>::__type
    583     fabs(_Tp __x)
    584     { return __builtin_fabs(__x); }
    585 
    586   inline float
    587   fdim(float __x, float __y)
    588   { return __builtin_fdimf(__x, __y); }
    589 
    590   inline long double
    591   fdim(long double __x, long double __y)
    592   { return __builtin_fdiml(__x, __y); }
    593 
    594   template<typename _Tp, typename _Up>
    595     inline
    596     typename __gnu_cxx::__promote_2<
    597     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    598 				    && __is_arithmetic<_Up>::__value,
    599 				    _Tp>::__type, _Up>::__type
    600     fdim(_Tp __x, _Up __y)
    601     {
    602       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    603       return fdim(__type(__x), __type(__y));
    604     }
    605 
    606   using std::floor;
    607 
    608   inline float
    609   fma(float __x, float __y, float __z)
    610   { return __builtin_fmaf(__x, __y, __z); }
    611 
    612   inline long double
    613   fma(long double __x, long double __y, long double __z)
    614   { return __builtin_fmal(__x, __y, __z); }
    615 
    616   template<typename _Tp, typename _Up, typename _Vp>
    617     inline
    618     typename __gnu_cxx::__promote_3<
    619     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    620 				    && __is_arithmetic<_Up>::__value
    621 				    && __is_arithmetic<_Vp>::__value,
    622 				    _Tp>::__type, _Up, _Vp>::__type
    623     fma(_Tp __x, _Up __y, _Vp __z)
    624     {
    625       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
    626       return fma(__type(__x), __type(__y), __type(__z));
    627     }
    628 
    629   inline float
    630   fmax(float __x, float __y)
    631   { return __builtin_fmaxf(__x, __y); }
    632 
    633   inline long double
    634   fmax(long double __x, long double __y)
    635   { return __builtin_fmaxl(__x, __y); }
    636 
    637   template<typename _Tp, typename _Up>
    638     inline
    639     typename __gnu_cxx::__promote_2<
    640     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    641 				    && __is_arithmetic<_Up>::__value,
    642 				    _Tp>::__type, _Up>::__type
    643     fmax(_Tp __x, _Up __y)
    644     {
    645       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    646       return fmax(__type(__x), __type(__y));
    647     }
    648 
    649   inline float
    650   fmin(float __x, float __y)
    651   { return __builtin_fminf(__x, __y); }
    652 
    653   inline long double
    654   fmin(long double __x, long double __y)
    655   { return __builtin_fminl(__x, __y); }
    656 
    657   template<typename _Tp, typename _Up>
    658     inline
    659     typename __gnu_cxx::__promote_2<
    660     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    661 				    && __is_arithmetic<_Up>::__value,
    662 				    _Tp>::__type, _Up>::__type
    663     fmin(_Tp __x, _Up __y)
    664     {
    665       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    666       return fmin(__type(__x), __type(__y));
    667     }
    668 
    669   using std::fmod;
    670   using std::frexp;
    671 
    672   inline float
    673   hypot(float __x, float __y)
    674   { return __builtin_hypotf(__x, __y); }
    675 
    676   inline long double
    677   hypot(long double __x, long double __y)
    678   { return __builtin_hypotl(__x, __y); }
    679 
    680   template<typename _Tp, typename _Up>
    681     inline
    682     typename __gnu_cxx::__promote_2<
    683     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    684 				    && __is_arithmetic<_Up>::__value,
    685 				    _Tp>::__type, _Up>::__type
    686     hypot(_Tp __y, _Up __x)
    687     {
    688       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    689       return hypot(__type(__y), __type(__x));
    690     }
    691 
    692   inline int
    693   ilogb(float __x)
    694   { return __builtin_ilogbf(__x); }
    695 
    696   inline int
    697   ilogb(long double __x)
    698   { return __builtin_ilogbl(__x); }
    699 
    700   template<typename _Tp>
    701     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    702 					   int>::__type
    703     ilogb(_Tp __x)
    704     { return __builtin_ilogb(__x); }
    705 
    706   using std::ldexp;
    707 
    708   inline float
    709   lgamma(float __x)
    710   { return __builtin_lgammaf(__x); }
    711 
    712   inline long double
    713   lgamma(long double __x)
    714   { return __builtin_lgammal(__x); }
    715 
    716   template<typename _Tp>
    717     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    718 					   double>::__type
    719     lgamma(_Tp __x)
    720     { return __builtin_lgamma(__x); }
    721 
    722   inline long long
    723   llrint(float __x)
    724   { return __builtin_llrintf(__x); }
    725 
    726   inline long long
    727   llrint(long double __x)
    728   { return __builtin_llrintl(__x); }
    729 
    730   template<typename _Tp>
    731     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    732 					   long long>::__type
    733     llrint(_Tp __x)
    734     { return __builtin_llrint(__x); }
    735 
    736   inline long long
    737   llround(float __x)
    738   { return __builtin_llroundf(__x); }
    739 
    740   inline long long
    741   llround(long double __x)
    742   { return __builtin_llroundl(__x); }
    743 
    744   template<typename _Tp>
    745     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    746 					   long long>::__type
    747     llround(_Tp __x)
    748     { return __builtin_llround(__x); }
    749 
    750   using std::log;
    751   using std::log10;
    752 
    753   inline float
    754   log1p(float __x)
    755   { return __builtin_log1pf(__x); }
    756 
    757   inline long double
    758   log1p(long double __x)
    759   { return __builtin_log1pl(__x); }
    760 
    761   template<typename _Tp>
    762     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    763 					   double>::__type
    764     log1p(_Tp __x)
    765     { return __builtin_log1p(__x); }
    766 
    767   // DR 568.
    768   inline float
    769   log2(float __x)
    770   { return __builtin_log2f(__x); }
    771 
    772   inline long double
    773   log2(long double __x)
    774   { return __builtin_log2l(__x); }
    775 
    776   template<typename _Tp>
    777     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    778 					   double>::__type
    779     log2(_Tp __x)
    780     { return __builtin_log2(__x); }
    781 
    782   inline float
    783   logb(float __x)
    784   { return __builtin_logbf(__x); }
    785 
    786   inline long double
    787   logb(long double __x)
    788   { return __builtin_logbl(__x); }
    789 
    790   template<typename _Tp>
    791     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    792 					   double>::__type
    793     logb(_Tp __x)
    794     {
    795       return __builtin_logb(__x);
    796     }
    797 
    798   inline long
    799   lrint(float __x)
    800   { return __builtin_lrintf(__x); }
    801 
    802   inline long
    803   lrint(long double __x)
    804   { return __builtin_lrintl(__x); }
    805 
    806   template<typename _Tp>
    807     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    808 					   long>::__type
    809     lrint(_Tp __x)
    810     { return __builtin_lrint(__x); }
    811 
    812   inline long
    813   lround(float __x)
    814   { return __builtin_lroundf(__x); }
    815 
    816   inline long
    817   lround(long double __x)
    818   { return __builtin_lroundl(__x); }
    819 
    820   template<typename _Tp>
    821     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    822 					   long>::__type
    823     lround(_Tp __x)
    824     { return __builtin_lround(__x); }
    825 
    826   inline float
    827   nearbyint(float __x)
    828   { return __builtin_nearbyintf(__x); }
    829 
    830   inline long double
    831   nearbyint(long double __x)
    832   { return __builtin_nearbyintl(__x); }
    833 
    834   template<typename _Tp>
    835     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    836 					   double>::__type
    837     nearbyint(_Tp __x)
    838     { return __builtin_nearbyint(__x); }
    839 
    840   inline float
    841   nextafter(float __x, float __y)
    842   { return __builtin_nextafterf(__x, __y); }
    843 
    844   inline long double
    845   nextafter(long double __x, long double __y)
    846   { return __builtin_nextafterl(__x, __y); }
    847 
    848   template<typename _Tp, typename _Up>
    849     inline
    850     typename __gnu_cxx::__promote_2<
    851     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    852 				    && __is_arithmetic<_Up>::__value,
    853 				    _Tp>::__type, _Up>::__type
    854     nextafter(_Tp __x, _Up __y)
    855     {
    856       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    857       return nextafter(__type(__x), __type(__y));
    858     }
    859 
    860   inline float
    861   nexttoward(float __x, long double __y)
    862   { return __builtin_nexttowardf(__x, __y); }
    863 
    864   inline long double
    865   nexttoward(long double __x, long double __y)
    866   { return __builtin_nexttowardl(__x, __y); }
    867 
    868   template<typename _Tp>
    869     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    870 					   double>::__type
    871     nexttoward(_Tp __x, long double __y)
    872     { return __builtin_nexttoward(__x, __y); }
    873 
    874   // DR 550. What should the return type of pow(float,int) be?
    875   // NB: C++0x and TR1 != C++03.
    876   //   using std::pow;
    877 
    878   inline float
    879   remainder(float __x, float __y)
    880   { return __builtin_remainderf(__x, __y); }
    881 
    882   inline long double
    883   remainder(long double __x, long double __y)
    884   { return __builtin_remainderl(__x, __y); }
    885 
    886   template<typename _Tp, typename _Up>
    887     inline
    888     typename __gnu_cxx::__promote_2<
    889     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    890 				    && __is_arithmetic<_Up>::__value,
    891 				    _Tp>::__type, _Up>::__type
    892     remainder(_Tp __x, _Up __y)
    893     {
    894       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    895       return remainder(__type(__x), __type(__y));
    896     }
    897 
    898   inline float
    899   remquo(float __x, float __y, int* __pquo)
    900   { return __builtin_remquof(__x, __y, __pquo); }
    901 
    902   inline long double
    903   remquo(long double __x, long double __y, int* __pquo)
    904   { return __builtin_remquol(__x, __y, __pquo); }
    905 
    906   template<typename _Tp, typename _Up>
    907     inline
    908     typename __gnu_cxx::__promote_2<
    909     typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
    910 				    && __is_arithmetic<_Up>::__value,
    911 				    _Tp>::__type, _Up>::__type
    912     remquo(_Tp __x, _Up __y, int* __pquo)
    913     {
    914       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
    915       return remquo(__type(__x), __type(__y), __pquo);
    916     }
    917 
    918   inline float
    919   rint(float __x)
    920   { return __builtin_rintf(__x); }
    921 
    922   inline long double
    923   rint(long double __x)
    924   { return __builtin_rintl(__x); }
    925 
    926   template<typename _Tp>
    927     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    928 					   double>::__type
    929     rint(_Tp __x)
    930     { return __builtin_rint(__x); }
    931 
    932   inline float
    933   round(float __x)
    934   { return __builtin_roundf(__x); }
    935 
    936   inline long double
    937   round(long double __x)
    938   { return __builtin_roundl(__x); }
    939 
    940   template<typename _Tp>
    941     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    942 					   double>::__type
    943     round(_Tp __x)
    944     { return __builtin_round(__x); }
    945 
    946   inline float
    947   scalbln(float __x, long __ex)
    948   { return __builtin_scalblnf(__x, __ex); }
    949 
    950   inline long double
    951   scalbln(long double __x, long __ex)
    952   { return __builtin_scalblnl(__x, __ex); }
    953 
    954   template<typename _Tp>
    955     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    956 					   double>::__type
    957     scalbln(_Tp __x, long __ex)
    958     { return __builtin_scalbln(__x, __ex); }
    959  
    960   inline float
    961   scalbn(float __x, int __ex)
    962   { return __builtin_scalbnf(__x, __ex); }
    963 
    964   inline long double
    965   scalbn(long double __x, int __ex)
    966   { return __builtin_scalbnl(__x, __ex); }
    967 
    968   template<typename _Tp>
    969     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    970 					   double>::__type
    971     scalbn(_Tp __x, int __ex)
    972     { return __builtin_scalbn(__x, __ex); }
    973 
    974   using std::sin;
    975   using std::sinh;
    976   using std::sqrt;
    977   using std::tan;
    978   using std::tanh;
    979 
    980   inline float
    981   tgamma(float __x)
    982   { return __builtin_tgammaf(__x); }
    983 
    984   inline long double
    985   tgamma(long double __x)
    986   { return __builtin_tgammal(__x); }
    987 
    988   template<typename _Tp>
    989     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
    990 					   double>::__type
    991     tgamma(_Tp __x)
    992     { return __builtin_tgamma(__x); }
    993  
    994   inline float
    995   trunc(float __x)
    996   { return __builtin_truncf(__x); }
    997 
    998   inline long double
    999   trunc(long double __x)
   1000   { return __builtin_truncl(__x); }
   1001 
   1002   template<typename _Tp>
   1003     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
   1004 					   double>::__type
   1005     trunc(_Tp __x)
   1006     { return __builtin_trunc(__x); }
   1007 
   1008 #endif
   1009 _GLIBCXX_END_NAMESPACE_VERSION
   1010 }
   1011 }
   1012 
   1013 namespace std _GLIBCXX_VISIBILITY(default)
   1014 {
   1015 namespace tr1
   1016 {
   1017 _GLIBCXX_BEGIN_NAMESPACE_VERSION
   1018 
   1019   // DR 550. What should the return type of pow(float,int) be?
   1020   // NB: C++0x and TR1 != C++03.
   1021   inline double
   1022   pow(double __x, double __y)
   1023   { return std::pow(__x, __y); }
   1024 
   1025   inline float
   1026   pow(float __x, float __y)
   1027   { return std::pow(__x, __y); }
   1028 
   1029   inline long double
   1030   pow(long double __x, long double __y)
   1031   { return std::pow(__x, __y); }
   1032 
   1033   template<typename _Tp, typename _Up>
   1034     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
   1035     pow(_Tp __x, _Up __y)
   1036     {
   1037       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
   1038       return std::pow(__type(__x), __type(__y));
   1039     }
   1040 
   1041 _GLIBCXX_END_NAMESPACE_VERSION
   1042 }
   1043 }
   1044 
   1045 #include <bits/stl_algobase.h>
   1046 #include <limits>
   1047 #include <tr1/type_traits>
   1048 
   1049 #include <tr1/gamma.tcc>
   1050 #include <tr1/bessel_function.tcc>
   1051 #include <tr1/beta_function.tcc>
   1052 #include <tr1/ell_integral.tcc>
   1053 #include <tr1/exp_integral.tcc>
   1054 #include <tr1/hypergeometric.tcc>
   1055 #include <tr1/legendre_function.tcc>
   1056 #include <tr1/modified_bessel_func.tcc>
   1057 #include <tr1/poly_hermite.tcc>
   1058 #include <tr1/poly_laguerre.tcc>
   1059 #include <tr1/riemann_zeta.tcc>
   1060 
   1061 namespace std _GLIBCXX_VISIBILITY(default)
   1062 {
   1063 namespace tr1
   1064 {
   1065 _GLIBCXX_BEGIN_NAMESPACE_VERSION
   1066 
   1067   /**
   1068    * @defgroup tr1_math_spec_func Mathematical Special Functions
   1069    * @ingroup numerics
   1070    *
   1071    * A collection of advanced mathematical special functions.
   1072    * @{
   1073    */
   1074 
   1075   inline float
   1076   assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
   1077   { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
   1078 
   1079   inline long double
   1080   assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
   1081   {
   1082     return __detail::__assoc_laguerre<long double>(__n, __m, __x);
   1083   }
   1084 
   1085   ///  5.2.1.1  Associated Laguerre polynomials.
   1086   template<typename _Tp>
   1087     inline typename __gnu_cxx::__promote<_Tp>::__type
   1088     assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
   1089     {
   1090       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1091       return __detail::__assoc_laguerre<__type>(__n, __m, __x);
   1092     }
   1093 
   1094   inline float
   1095   assoc_legendref(unsigned int __l, unsigned int __m, float __x)
   1096   { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
   1097 
   1098   inline long double
   1099   assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
   1100   { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
   1101 
   1102   ///  5.2.1.2  Associated Legendre functions.
   1103   template<typename _Tp>
   1104     inline typename __gnu_cxx::__promote<_Tp>::__type
   1105     assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
   1106     {
   1107       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1108       return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
   1109     }
   1110 
   1111   inline float
   1112   betaf(float __x, float __y)
   1113   { return __detail::__beta<float>(__x, __y); }
   1114 
   1115   inline long double
   1116   betal(long double __x, long double __y)
   1117   { return __detail::__beta<long double>(__x, __y); }
   1118 
   1119   ///  5.2.1.3  Beta functions.
   1120   template<typename _Tpx, typename _Tpy>
   1121     inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
   1122     beta(_Tpx __x, _Tpy __y)
   1123     {
   1124       typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
   1125       return __detail::__beta<__type>(__x, __y);
   1126     }
   1127 
   1128   inline float
   1129   comp_ellint_1f(float __k)
   1130   { return __detail::__comp_ellint_1<float>(__k); }
   1131 
   1132   inline long double
   1133   comp_ellint_1l(long double __k)
   1134   { return __detail::__comp_ellint_1<long double>(__k); }
   1135 
   1136   ///  5.2.1.4  Complete elliptic integrals of the first kind.
   1137   template<typename _Tp>
   1138     inline typename __gnu_cxx::__promote<_Tp>::__type
   1139     comp_ellint_1(_Tp __k)
   1140     {
   1141       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1142       return __detail::__comp_ellint_1<__type>(__k);
   1143     }
   1144 
   1145   inline float
   1146   comp_ellint_2f(float __k)
   1147   { return __detail::__comp_ellint_2<float>(__k); }
   1148 
   1149   inline long double
   1150   comp_ellint_2l(long double __k)
   1151   { return __detail::__comp_ellint_2<long double>(__k); }
   1152 
   1153   ///  5.2.1.5  Complete elliptic integrals of the second kind.
   1154   template<typename _Tp>
   1155     inline typename __gnu_cxx::__promote<_Tp>::__type
   1156     comp_ellint_2(_Tp __k)
   1157     {
   1158       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1159       return __detail::__comp_ellint_2<__type>(__k);
   1160     }
   1161 
   1162   inline float
   1163   comp_ellint_3f(float __k, float __nu)
   1164   { return __detail::__comp_ellint_3<float>(__k, __nu); }
   1165 
   1166   inline long double
   1167   comp_ellint_3l(long double __k, long double __nu)
   1168   { return __detail::__comp_ellint_3<long double>(__k, __nu); }
   1169 
   1170   ///  5.2.1.6  Complete elliptic integrals of the third kind.
   1171   template<typename _Tp, typename _Tpn>
   1172     inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
   1173     comp_ellint_3(_Tp __k, _Tpn __nu)
   1174     {
   1175       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
   1176       return __detail::__comp_ellint_3<__type>(__k, __nu);
   1177     }
   1178 
   1179   inline float
   1180   conf_hypergf(float __a, float __c, float __x)
   1181   { return __detail::__conf_hyperg<float>(__a, __c, __x); }
   1182 
   1183   inline long double
   1184   conf_hypergl(long double __a, long double __c, long double __x)
   1185   { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
   1186 
   1187   ///  5.2.1.7  Confluent hypergeometric functions.
   1188   template<typename _Tpa, typename _Tpc, typename _Tp>
   1189     inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
   1190     conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
   1191     {
   1192       typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
   1193       return __detail::__conf_hyperg<__type>(__a, __c, __x);
   1194     }
   1195 
   1196   inline float
   1197   cyl_bessel_if(float __nu, float __x)
   1198   { return __detail::__cyl_bessel_i<float>(__nu, __x); }
   1199 
   1200   inline long double
   1201   cyl_bessel_il(long double __nu, long double __x)
   1202   { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
   1203 
   1204   ///  5.2.1.8  Regular modified cylindrical Bessel functions.
   1205   template<typename _Tpnu, typename _Tp>
   1206     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
   1207     cyl_bessel_i(_Tpnu __nu, _Tp __x)
   1208     {
   1209       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
   1210       return __detail::__cyl_bessel_i<__type>(__nu, __x);
   1211     }
   1212 
   1213   inline float
   1214   cyl_bessel_jf(float __nu, float __x)
   1215   { return __detail::__cyl_bessel_j<float>(__nu, __x); }
   1216 
   1217   inline long double
   1218   cyl_bessel_jl(long double __nu, long double __x)
   1219   { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
   1220 
   1221   ///  5.2.1.9  Cylindrical Bessel functions (of the first kind).
   1222   template<typename _Tpnu, typename _Tp>
   1223     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
   1224     cyl_bessel_j(_Tpnu __nu, _Tp __x)
   1225     {
   1226       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
   1227       return __detail::__cyl_bessel_j<__type>(__nu, __x);
   1228     }
   1229 
   1230   inline float
   1231   cyl_bessel_kf(float __nu, float __x)
   1232   { return __detail::__cyl_bessel_k<float>(__nu, __x); }
   1233 
   1234   inline long double
   1235   cyl_bessel_kl(long double __nu, long double __x)
   1236   { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
   1237 
   1238   ///  5.2.1.10  Irregular modified cylindrical Bessel functions.
   1239   template<typename _Tpnu, typename _Tp>
   1240     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
   1241     cyl_bessel_k(_Tpnu __nu, _Tp __x)
   1242     {
   1243       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
   1244       return __detail::__cyl_bessel_k<__type>(__nu, __x);
   1245     }
   1246 
   1247   inline float
   1248   cyl_neumannf(float __nu, float __x)
   1249   { return __detail::__cyl_neumann_n<float>(__nu, __x); }
   1250 
   1251   inline long double
   1252   cyl_neumannl(long double __nu, long double __x)
   1253   { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
   1254 
   1255   ///  5.2.1.11  Cylindrical Neumann functions.
   1256   template<typename _Tpnu, typename _Tp>
   1257     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
   1258     cyl_neumann(_Tpnu __nu, _Tp __x)
   1259     {
   1260       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
   1261       return __detail::__cyl_neumann_n<__type>(__nu, __x);
   1262     }
   1263 
   1264   inline float
   1265   ellint_1f(float __k, float __phi)
   1266   { return __detail::__ellint_1<float>(__k, __phi); }
   1267 
   1268   inline long double
   1269   ellint_1l(long double __k, long double __phi)
   1270   { return __detail::__ellint_1<long double>(__k, __phi); }
   1271 
   1272   ///  5.2.1.12  Incomplete elliptic integrals of the first kind.
   1273   template<typename _Tp, typename _Tpp>
   1274     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
   1275     ellint_1(_Tp __k, _Tpp __phi)
   1276     {
   1277       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
   1278       return __detail::__ellint_1<__type>(__k, __phi);
   1279     }
   1280 
   1281   inline float
   1282   ellint_2f(float __k, float __phi)
   1283   { return __detail::__ellint_2<float>(__k, __phi); }
   1284 
   1285   inline long double
   1286   ellint_2l(long double __k, long double __phi)
   1287   { return __detail::__ellint_2<long double>(__k, __phi); }
   1288 
   1289   ///  5.2.1.13  Incomplete elliptic integrals of the second kind.
   1290   template<typename _Tp, typename _Tpp>
   1291     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
   1292     ellint_2(_Tp __k, _Tpp __phi)
   1293     {
   1294       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
   1295       return __detail::__ellint_2<__type>(__k, __phi);
   1296     }
   1297 
   1298   inline float
   1299   ellint_3f(float __k, float __nu, float __phi)
   1300   { return __detail::__ellint_3<float>(__k, __nu, __phi); }
   1301 
   1302   inline long double
   1303   ellint_3l(long double __k, long double __nu, long double __phi)
   1304   { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
   1305 
   1306   ///  5.2.1.14  Incomplete elliptic integrals of the third kind.
   1307   template<typename _Tp, typename _Tpn, typename _Tpp>
   1308     inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
   1309     ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
   1310     {
   1311       typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
   1312       return __detail::__ellint_3<__type>(__k, __nu, __phi);
   1313     }
   1314 
   1315   inline float
   1316   expintf(float __x)
   1317   { return __detail::__expint<float>(__x); }
   1318 
   1319   inline long double
   1320   expintl(long double __x)
   1321   { return __detail::__expint<long double>(__x); }
   1322 
   1323   ///  5.2.1.15  Exponential integrals.
   1324   template<typename _Tp>
   1325     inline typename __gnu_cxx::__promote<_Tp>::__type
   1326     expint(_Tp __x)
   1327     {
   1328       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1329       return __detail::__expint<__type>(__x);
   1330     }
   1331 
   1332   inline float
   1333   hermitef(unsigned int __n, float __x)
   1334   { return __detail::__poly_hermite<float>(__n, __x); }
   1335 
   1336   inline long double
   1337   hermitel(unsigned int __n, long double __x)
   1338   { return __detail::__poly_hermite<long double>(__n, __x); }
   1339 
   1340   ///  5.2.1.16  Hermite polynomials.
   1341   template<typename _Tp>
   1342     inline typename __gnu_cxx::__promote<_Tp>::__type
   1343     hermite(unsigned int __n, _Tp __x)
   1344     {
   1345       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1346       return __detail::__poly_hermite<__type>(__n, __x);
   1347     }
   1348 
   1349   inline float
   1350   hypergf(float __a, float __b, float __c, float __x)
   1351   { return __detail::__hyperg<float>(__a, __b, __c, __x); }
   1352 
   1353   inline long double
   1354   hypergl(long double __a, long double __b, long double __c, long double __x)
   1355   { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
   1356 
   1357   ///  5.2.1.17  Hypergeometric functions.
   1358   template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
   1359     inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
   1360     hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
   1361     {
   1362       typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
   1363       return __detail::__hyperg<__type>(__a, __b, __c, __x);
   1364     }
   1365 
   1366   inline float
   1367   laguerref(unsigned int __n, float __x)
   1368   { return __detail::__laguerre<float>(__n, __x); }
   1369 
   1370   inline long double
   1371   laguerrel(unsigned int __n, long double __x)
   1372   { return __detail::__laguerre<long double>(__n, __x); }
   1373 
   1374   ///  5.2.1.18  Laguerre polynomials.
   1375   template<typename _Tp>
   1376     inline typename __gnu_cxx::__promote<_Tp>::__type
   1377     laguerre(unsigned int __n, _Tp __x)
   1378     {
   1379       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1380       return __detail::__laguerre<__type>(__n, __x);
   1381     }
   1382 
   1383   inline float
   1384   legendref(unsigned int __n, float __x)
   1385   { return __detail::__poly_legendre_p<float>(__n, __x); }
   1386 
   1387   inline long double
   1388   legendrel(unsigned int __n, long double __x)
   1389   { return __detail::__poly_legendre_p<long double>(__n, __x); }
   1390 
   1391   ///  5.2.1.19  Legendre polynomials.
   1392   template<typename _Tp>
   1393     inline typename __gnu_cxx::__promote<_Tp>::__type
   1394     legendre(unsigned int __n, _Tp __x)
   1395     {
   1396       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1397       return __detail::__poly_legendre_p<__type>(__n, __x);
   1398     }
   1399 
   1400   inline float
   1401   riemann_zetaf(float __x)
   1402   { return __detail::__riemann_zeta<float>(__x); }
   1403 
   1404   inline long double
   1405   riemann_zetal(long double __x)
   1406   { return __detail::__riemann_zeta<long double>(__x); }
   1407 
   1408   ///  5.2.1.20  Riemann zeta function.
   1409   template<typename _Tp>
   1410     inline typename __gnu_cxx::__promote<_Tp>::__type
   1411     riemann_zeta(_Tp __x)
   1412     {
   1413       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1414       return __detail::__riemann_zeta<__type>(__x);
   1415     }
   1416 
   1417   inline float
   1418   sph_besself(unsigned int __n, float __x)
   1419   { return __detail::__sph_bessel<float>(__n, __x); }
   1420 
   1421   inline long double
   1422   sph_bessell(unsigned int __n, long double __x)
   1423   { return __detail::__sph_bessel<long double>(__n, __x); }
   1424 
   1425   ///  5.2.1.21  Spherical Bessel functions.
   1426   template<typename _Tp>
   1427     inline typename __gnu_cxx::__promote<_Tp>::__type
   1428     sph_bessel(unsigned int __n, _Tp __x)
   1429     {
   1430       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1431       return __detail::__sph_bessel<__type>(__n, __x);
   1432     }
   1433 
   1434   inline float
   1435   sph_legendref(unsigned int __l, unsigned int __m, float __theta)
   1436   { return __detail::__sph_legendre<float>(__l, __m, __theta); }
   1437 
   1438   inline long double
   1439   sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
   1440   { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
   1441 
   1442   ///  5.2.1.22  Spherical associated Legendre functions.
   1443   template<typename _Tp>
   1444     inline typename __gnu_cxx::__promote<_Tp>::__type
   1445     sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
   1446     {
   1447       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1448       return __detail::__sph_legendre<__type>(__l, __m, __theta);
   1449     }
   1450 
   1451   inline float
   1452   sph_neumannf(unsigned int __n, float __x)
   1453   { return __detail::__sph_neumann<float>(__n, __x); }
   1454 
   1455   inline long double
   1456   sph_neumannl(unsigned int __n, long double __x)
   1457   { return __detail::__sph_neumann<long double>(__n, __x); }
   1458 
   1459   ///  5.2.1.23  Spherical Neumann functions.
   1460   template<typename _Tp>
   1461     inline typename __gnu_cxx::__promote<_Tp>::__type
   1462     sph_neumann(unsigned int __n, _Tp __x)
   1463     {
   1464       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
   1465       return __detail::__sph_neumann<__type>(__n, __x);
   1466     }
   1467 
   1468   /* @} */ // tr1_math_spec_func
   1469 _GLIBCXX_END_NAMESPACE_VERSION
   1470 }
   1471 }
   1472 
   1473 #endif // _GLIBCXX_TR1_CMATH
   1474