libstdc++
cmath
Go to the documentation of this file.
00001 // -*- C++ -*- C forwarding header.
00002 
00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
00004 // 2006, 2007, 2008, 2009, 2010, 2011
00005 // Free Software Foundation, Inc.
00006 //
00007 // This file is part of the GNU ISO C++ Library.  This library is free
00008 // software; you can redistribute it and/or modify it under the
00009 // terms of the GNU General Public License as published by the
00010 // Free Software Foundation; either version 3, or (at your option)
00011 // any later version.
00012 
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 
00018 // Under Section 7 of GPL version 3, you are granted additional
00019 // permissions described in the GCC Runtime Library Exception, version
00020 // 3.1, as published by the Free Software Foundation.
00021 
00022 // You should have received a copy of the GNU General Public License and
00023 // a copy of the GCC Runtime Library Exception along with this program;
00024 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00025 // <http://www.gnu.org/licenses/>.
00026 
00027 /** @file include/cmath
00028  *  This is a Standard C++ Library file.  You should @c \#include this file
00029  *  in your programs, rather than any of the @a *.h implementation files.
00030  *
00031  *  This is the C++ version of the Standard C Library header @c math.h,
00032  *  and its contents are (mostly) the same as that header, but are all
00033  *  contained in the namespace @c std (except for names which are defined
00034  *  as macros in C).
00035  */
00036 
00037 //
00038 // ISO C++ 14882: 26.5  C library
00039 //
00040 
00041 #pragma GCC system_header
00042 
00043 #include <bits/c++config.h>
00044 #include <bits/cpp_type_traits.h>
00045 #include <ext/type_traits.h>
00046 #include <math.h>
00047 
00048 #ifndef _GLIBCXX_CMATH
00049 #define _GLIBCXX_CMATH 1
00050 
00051 // Get rid of those macros defined in <math.h> in lieu of real functions.
00052 #undef abs
00053 #undef div
00054 #undef acos
00055 #undef asin
00056 #undef atan
00057 #undef atan2
00058 #undef ceil
00059 #undef cos
00060 #undef cosh
00061 #undef exp
00062 #undef fabs
00063 #undef floor
00064 #undef fmod
00065 #undef frexp
00066 #undef ldexp
00067 #undef log
00068 #undef log10
00069 #undef modf
00070 #undef pow
00071 #undef sin
00072 #undef sinh
00073 #undef sqrt
00074 #undef tan
00075 #undef tanh
00076 
00077 namespace std _GLIBCXX_VISIBILITY(default)
00078 {
00079 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00080 
00081 #if !defined(__CORRECT_ISO_CPP_MATH_H_PROTO1) \
00082   && !defined(__CORRECT_ISO_CPP_MATH_H_PROTO2)
00083   inline _GLIBCXX_CONSTEXPR double
00084   abs(double __x)
00085   { return __builtin_fabs(__x); }
00086 #endif
00087 
00088 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00089   inline _GLIBCXX_CONSTEXPR float
00090   abs(float __x)
00091   { return __builtin_fabsf(__x); }
00092 
00093   inline _GLIBCXX_CONSTEXPR long double
00094   abs(long double __x)
00095   { return __builtin_fabsl(__x); }
00096 #endif
00097 
00098   template<typename _Tp>
00099     inline _GLIBCXX_CONSTEXPR
00100     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00101                                     double>::__type
00102     abs(_Tp __x)
00103     { return __builtin_fabs(__x); }
00104 
00105   using ::acos;
00106 
00107 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00108   inline _GLIBCXX_CONSTEXPR float
00109   acos(float __x)
00110   { return __builtin_acosf(__x); }
00111 
00112   inline _GLIBCXX_CONSTEXPR long double
00113   acos(long double __x)
00114   { return __builtin_acosl(__x); }
00115 #endif
00116 
00117   template<typename _Tp>
00118     inline _GLIBCXX_CONSTEXPR
00119     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00120                                     double>::__type
00121     acos(_Tp __x)
00122     { return __builtin_acos(__x); }
00123 
00124   using ::asin;
00125 
00126 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00127   inline _GLIBCXX_CONSTEXPR float
00128   asin(float __x)
00129   { return __builtin_asinf(__x); }
00130 
00131   inline _GLIBCXX_CONSTEXPR long double
00132   asin(long double __x)
00133   { return __builtin_asinl(__x); }
00134 #endif
00135 
00136   template<typename _Tp>
00137     inline _GLIBCXX_CONSTEXPR
00138     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00139                                     double>::__type
00140     asin(_Tp __x)
00141     { return __builtin_asin(__x); }
00142 
00143   using ::atan;
00144 
00145 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00146   inline _GLIBCXX_CONSTEXPR float
00147   atan(float __x)
00148   { return __builtin_atanf(__x); }
00149 
00150   inline _GLIBCXX_CONSTEXPR long double
00151   atan(long double __x)
00152   { return __builtin_atanl(__x); }
00153 #endif
00154 
00155   template<typename _Tp>
00156     inline _GLIBCXX_CONSTEXPR
00157     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00158                                     double>::__type
00159     atan(_Tp __x)
00160     { return __builtin_atan(__x); }
00161 
00162   using ::atan2;
00163 
00164 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00165   inline _GLIBCXX_CONSTEXPR float
00166   atan2(float __y, float __x)
00167   { return __builtin_atan2f(__y, __x); }
00168 
00169   inline _GLIBCXX_CONSTEXPR long double
00170   atan2(long double __y, long double __x)
00171   { return __builtin_atan2l(__y, __x); }
00172 #endif
00173 
00174   template<typename _Tp, typename _Up>
00175     inline _GLIBCXX_CONSTEXPR
00176     typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00177     atan2(_Tp __y, _Up __x)
00178     {
00179       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00180       return atan2(__type(__y), __type(__x));
00181     }
00182 
00183   using ::ceil;
00184 
00185 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00186   inline _GLIBCXX_CONSTEXPR float
00187   ceil(float __x)
00188   { return __builtin_ceilf(__x); }
00189 
00190   inline _GLIBCXX_CONSTEXPR long double
00191   ceil(long double __x)
00192   { return __builtin_ceill(__x); }
00193 #endif
00194 
00195   template<typename _Tp>
00196     inline _GLIBCXX_CONSTEXPR
00197     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00198                                     double>::__type
00199     ceil(_Tp __x)
00200     { return __builtin_ceil(__x); }
00201 
00202   using ::cos;
00203 
00204 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00205   inline _GLIBCXX_CONSTEXPR float
00206   cos(float __x)
00207   { return __builtin_cosf(__x); }
00208 
00209   inline _GLIBCXX_CONSTEXPR long double
00210   cos(long double __x)
00211   { return __builtin_cosl(__x); }
00212 #endif
00213 
00214   template<typename _Tp>
00215     inline _GLIBCXX_CONSTEXPR
00216     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00217                                     double>::__type
00218     cos(_Tp __x)
00219     { return __builtin_cos(__x); }
00220 
00221   using ::cosh;
00222 
00223 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00224   inline _GLIBCXX_CONSTEXPR float
00225   cosh(float __x)
00226   { return __builtin_coshf(__x); }
00227 
00228   inline _GLIBCXX_CONSTEXPR long double
00229   cosh(long double __x)
00230   { return __builtin_coshl(__x); }
00231 #endif
00232 
00233   template<typename _Tp>
00234     inline _GLIBCXX_CONSTEXPR
00235     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00236                                     double>::__type
00237     cosh(_Tp __x)
00238     { return __builtin_cosh(__x); }
00239 
00240   using ::exp;
00241 
00242 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00243   inline _GLIBCXX_CONSTEXPR float
00244   exp(float __x)
00245   { return __builtin_expf(__x); }
00246 
00247   inline _GLIBCXX_CONSTEXPR long double
00248   exp(long double __x)
00249   { return __builtin_expl(__x); }
00250 #endif
00251 
00252   template<typename _Tp>
00253     inline _GLIBCXX_CONSTEXPR
00254     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00255                                     double>::__type
00256     exp(_Tp __x)
00257     { return __builtin_exp(__x); }
00258 
00259   using ::fabs;
00260 
00261 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00262   inline _GLIBCXX_CONSTEXPR float
00263   fabs(float __x)
00264   { return __builtin_fabsf(__x); }
00265 
00266   inline _GLIBCXX_CONSTEXPR long double
00267   fabs(long double __x)
00268   { return __builtin_fabsl(__x); }
00269 #endif
00270 
00271   template<typename _Tp>
00272     inline _GLIBCXX_CONSTEXPR
00273     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00274                                     double>::__type
00275     fabs(_Tp __x)
00276     { return __builtin_fabs(__x); }
00277 
00278   using ::floor;
00279 
00280 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00281   inline _GLIBCXX_CONSTEXPR float
00282   floor(float __x)
00283   { return __builtin_floorf(__x); }
00284 
00285   inline _GLIBCXX_CONSTEXPR long double
00286   floor(long double __x)
00287   { return __builtin_floorl(__x); }
00288 #endif
00289 
00290   template<typename _Tp>
00291     inline _GLIBCXX_CONSTEXPR
00292     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00293                                     double>::__type
00294     floor(_Tp __x)
00295     { return __builtin_floor(__x); }
00296 
00297   using ::fmod;
00298 
00299 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00300   inline _GLIBCXX_CONSTEXPR float
00301   fmod(float __x, float __y)
00302   { return __builtin_fmodf(__x, __y); }
00303 
00304   inline _GLIBCXX_CONSTEXPR long double
00305   fmod(long double __x, long double __y)
00306   { return __builtin_fmodl(__x, __y); }
00307 #endif
00308 
00309   template<typename _Tp, typename _Up>
00310     inline _GLIBCXX_CONSTEXPR
00311     typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00312     fmod(_Tp __x, _Up __y)
00313     {
00314       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00315       return fmod(__type(__x), __type(__y));
00316     }
00317 
00318   using ::frexp;
00319 
00320 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00321   inline float
00322   frexp(float __x, int* __exp)
00323   { return __builtin_frexpf(__x, __exp); }
00324 
00325   inline long double
00326   frexp(long double __x, int* __exp)
00327   { return __builtin_frexpl(__x, __exp); }
00328 #endif
00329 
00330   template<typename _Tp>
00331     inline _GLIBCXX_CONSTEXPR
00332     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00333                                     double>::__type
00334     frexp(_Tp __x, int* __exp)
00335     { return __builtin_frexp(__x, __exp); }
00336 
00337   using ::ldexp;
00338 
00339 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00340   inline _GLIBCXX_CONSTEXPR float
00341   ldexp(float __x, int __exp)
00342   { return __builtin_ldexpf(__x, __exp); }
00343 
00344   inline _GLIBCXX_CONSTEXPR long double
00345   ldexp(long double __x, int __exp)
00346   { return __builtin_ldexpl(__x, __exp); }
00347 #endif
00348 
00349   template<typename _Tp>
00350     inline _GLIBCXX_CONSTEXPR
00351     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00352                                     double>::__type
00353     ldexp(_Tp __x, int __exp)
00354     { return __builtin_ldexp(__x, __exp); }
00355 
00356   using ::log;
00357 
00358 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00359   inline _GLIBCXX_CONSTEXPR float
00360   log(float __x)
00361   { return __builtin_logf(__x); }
00362 
00363   inline _GLIBCXX_CONSTEXPR long double
00364   log(long double __x)
00365   { return __builtin_logl(__x); }
00366 #endif
00367 
00368   template<typename _Tp>
00369     inline _GLIBCXX_CONSTEXPR
00370     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00371                                     double>::__type
00372     log(_Tp __x)
00373     { return __builtin_log(__x); }
00374 
00375   using ::log10;
00376 
00377 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00378   inline _GLIBCXX_CONSTEXPR float
00379   log10(float __x)
00380   { return __builtin_log10f(__x); }
00381 
00382   inline _GLIBCXX_CONSTEXPR long double
00383   log10(long double __x)
00384   { return __builtin_log10l(__x); }
00385 #endif
00386 
00387   template<typename _Tp>
00388     inline _GLIBCXX_CONSTEXPR
00389     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00390                                     double>::__type
00391     log10(_Tp __x)
00392     { return __builtin_log10(__x); }
00393 
00394   using ::modf;
00395 
00396 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00397   inline float
00398   modf(float __x, float* __iptr)
00399   { return __builtin_modff(__x, __iptr); }
00400 
00401   inline long double
00402   modf(long double __x, long double* __iptr)
00403   { return __builtin_modfl(__x, __iptr); }
00404 #endif
00405 
00406   using ::pow;
00407 
00408 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00409   inline _GLIBCXX_CONSTEXPR float
00410   pow(float __x, float __y)
00411   { return __builtin_powf(__x, __y); }
00412 
00413   inline _GLIBCXX_CONSTEXPR long double
00414   pow(long double __x, long double __y)
00415   { return __builtin_powl(__x, __y); }
00416 
00417 #ifndef __GXX_EXPERIMENTAL_CXX0X__
00418   // _GLIBCXX_RESOLVE_LIB_DEFECTS
00419   // DR 550. What should the return type of pow(float,int) be?
00420   inline double
00421   pow(double __x, int __i)
00422   { return __builtin_powi(__x, __i); }
00423 
00424   inline float
00425   pow(float __x, int __n)
00426   { return __builtin_powif(__x, __n); }
00427 
00428   inline long double
00429   pow(long double __x, int __n)
00430   { return __builtin_powil(__x, __n); }
00431 #endif
00432 #endif
00433 
00434   template<typename _Tp, typename _Up>
00435     inline _GLIBCXX_CONSTEXPR
00436     typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
00437     pow(_Tp __x, _Up __y)
00438     {
00439       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00440       return pow(__type(__x), __type(__y));
00441     }
00442 
00443   using ::sin;
00444 
00445 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00446   inline _GLIBCXX_CONSTEXPR float
00447   sin(float __x)
00448   { return __builtin_sinf(__x); }
00449 
00450   inline _GLIBCXX_CONSTEXPR long double
00451   sin(long double __x)
00452   { return __builtin_sinl(__x); }
00453 #endif
00454 
00455   template<typename _Tp>
00456     inline _GLIBCXX_CONSTEXPR
00457     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00458                                     double>::__type
00459     sin(_Tp __x)
00460     { return __builtin_sin(__x); }
00461 
00462   using ::sinh;
00463 
00464 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00465   inline _GLIBCXX_CONSTEXPR float
00466   sinh(float __x)
00467   { return __builtin_sinhf(__x); }
00468 
00469   inline _GLIBCXX_CONSTEXPR long double
00470   sinh(long double __x)
00471   { return __builtin_sinhl(__x); }
00472 #endif
00473 
00474   template<typename _Tp>
00475     inline _GLIBCXX_CONSTEXPR
00476     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00477                                     double>::__type
00478     sinh(_Tp __x)
00479     { return __builtin_sinh(__x); }
00480 
00481   using ::sqrt;
00482 
00483 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00484   inline _GLIBCXX_CONSTEXPR float
00485   sqrt(float __x)
00486   { return __builtin_sqrtf(__x); }
00487 
00488   inline _GLIBCXX_CONSTEXPR long double
00489   sqrt(long double __x)
00490   { return __builtin_sqrtl(__x); }
00491 #endif
00492 
00493   template<typename _Tp>
00494     inline _GLIBCXX_CONSTEXPR
00495     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00496                                     double>::__type
00497     sqrt(_Tp __x)
00498     { return __builtin_sqrt(__x); }
00499 
00500   using ::tan;
00501 
00502 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00503   inline _GLIBCXX_CONSTEXPR float
00504   tan(float __x)
00505   { return __builtin_tanf(__x); }
00506 
00507   inline _GLIBCXX_CONSTEXPR long double
00508   tan(long double __x)
00509   { return __builtin_tanl(__x); }
00510 #endif
00511 
00512   template<typename _Tp>
00513     inline _GLIBCXX_CONSTEXPR
00514     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00515                                     double>::__type
00516     tan(_Tp __x)
00517     { return __builtin_tan(__x); }
00518 
00519   using ::tanh;
00520 
00521 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO1
00522   inline _GLIBCXX_CONSTEXPR float
00523   tanh(float __x)
00524   { return __builtin_tanhf(__x); }
00525 
00526   inline _GLIBCXX_CONSTEXPR long double
00527   tanh(long double __x)
00528   { return __builtin_tanhl(__x); }
00529 #endif
00530 
00531   template<typename _Tp>
00532     inline _GLIBCXX_CONSTEXPR
00533     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
00534                                     double>::__type
00535     tanh(_Tp __x)
00536     { return __builtin_tanh(__x); }
00537 
00538 _GLIBCXX_END_NAMESPACE_VERSION
00539 } // namespace
00540 
00541 #if _GLIBCXX_USE_C99_MATH
00542 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00543 
00544 // These are possible macros imported from C99-land.
00545 #undef fpclassify
00546 #undef isfinite
00547 #undef isinf
00548 #undef isnan
00549 #undef isnormal
00550 #undef signbit
00551 #undef isgreater
00552 #undef isgreaterequal
00553 #undef isless
00554 #undef islessequal
00555 #undef islessgreater
00556 #undef isunordered
00557 
00558 namespace std _GLIBCXX_VISIBILITY(default)
00559 {
00560 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00561 
00562 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00563   constexpr int
00564   fpclassify(float __x)
00565   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
00566                 FP_SUBNORMAL, FP_ZERO, __x); }
00567 
00568   constexpr int
00569   fpclassify(double __x)
00570   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
00571                 FP_SUBNORMAL, FP_ZERO, __x); }
00572 
00573   constexpr int
00574   fpclassify(long double __x)
00575   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
00576                 FP_SUBNORMAL, FP_ZERO, __x); }
00577 
00578   template<typename _Tp>
00579     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00580                                               int>::__type
00581     fpclassify(_Tp __x)
00582     { return __x != 0 ? FP_NORMAL : FP_ZERO; }
00583 
00584   constexpr bool
00585   isfinite(float __x)
00586   { return __builtin_isfinite(__x); }
00587 
00588   constexpr bool
00589   isfinite(double __x)
00590   { return __builtin_isfinite(__x); }
00591 
00592   constexpr bool
00593   isfinite(long double __x)
00594   { return __builtin_isfinite(__x); }
00595 
00596   template<typename _Tp>
00597     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00598                                               bool>::__type
00599     isfinite(_Tp __x)
00600     { return true; }
00601 
00602   constexpr bool
00603   isinf(float __x)
00604   { return __builtin_isinf(__x); }
00605 
00606   constexpr bool
00607   isinf(double __x)
00608   { return __builtin_isinf(__x); }
00609 
00610   constexpr bool
00611   isinf(long double __x)
00612   { return __builtin_isinf(__x); }
00613 
00614   template<typename _Tp>
00615     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00616                                               bool>::__type
00617     isinf(_Tp __x)
00618     { return false; }
00619 
00620   constexpr bool
00621   isnan(float __x)
00622   { return __builtin_isnan(__x); }
00623 
00624   constexpr bool
00625   isnan(double __x)
00626   { return __builtin_isnan(__x); }
00627 
00628   constexpr bool
00629   isnan(long double __x)
00630   { return __builtin_isnan(__x); }
00631 
00632   template<typename _Tp>
00633     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00634                                               bool>::__type
00635     isnan(_Tp __x)
00636     { return false; }
00637 
00638   constexpr bool
00639   isnormal(float __x)
00640   { return __builtin_isnormal(__x); }
00641 
00642   constexpr bool
00643   isnormal(double __x)
00644   { return __builtin_isnormal(__x); }
00645 
00646   constexpr bool
00647   isnormal(long double __x)
00648   { return __builtin_isnormal(__x); }
00649 
00650   template<typename _Tp>
00651     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00652                                               bool>::__type
00653     isnormal(_Tp __x)
00654     { return __x != 0 ? true : false; }
00655 
00656   constexpr bool
00657   signbit(float __x)
00658   { return __builtin_signbit(__x); }
00659 
00660   constexpr bool
00661   signbit(double __x)
00662   { return __builtin_signbit(__x); }
00663 
00664   constexpr bool
00665   signbit(long double __x)
00666   { return __builtin_signbit(__x); }
00667 
00668   template<typename _Tp>
00669     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
00670                                               bool>::__type
00671     signbit(_Tp __x)
00672     { return __x < 0 ? true : false; }
00673 
00674   constexpr bool
00675   isgreater(float __x, float __y)
00676   { return __builtin_isgreater(__x, __y); }
00677 
00678   constexpr bool
00679   isgreater(double __x, double __y)
00680   { return __builtin_isgreater(__x, __y); }
00681 
00682   constexpr bool
00683   isgreater(long double __x, long double __y)
00684   { return __builtin_isgreater(__x, __y); }
00685 
00686   template<typename _Tp, typename _Up>
00687     constexpr typename
00688     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00689                 && __is_arithmetic<_Up>::__value), bool>::__type
00690     isgreater(_Tp __x, _Up __y)
00691     {
00692       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00693       return __builtin_isgreater(__type(__x), __type(__y));
00694     }
00695 
00696   constexpr bool
00697   isgreaterequal(float __x, float __y)
00698   { return __builtin_isgreaterequal(__x, __y); }
00699 
00700   constexpr bool
00701   isgreaterequal(double __x, double __y)
00702   { return __builtin_isgreaterequal(__x, __y); }
00703 
00704   constexpr bool
00705   isgreaterequal(long double __x, long double __y)
00706   { return __builtin_isgreaterequal(__x, __y); }
00707 
00708   template<typename _Tp, typename _Up>
00709     constexpr typename
00710     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00711                 && __is_arithmetic<_Up>::__value), bool>::__type
00712     isgreaterequal(_Tp __x, _Up __y)
00713     {
00714       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00715       return __builtin_isgreaterequal(__type(__x), __type(__y));
00716     }
00717 
00718   constexpr bool
00719   isless(float __x, float __y)
00720   { return __builtin_isless(__x, __y); }
00721 
00722   constexpr bool
00723   isless(double __x, double __y)
00724   { return __builtin_isless(__x, __y); }
00725 
00726   constexpr bool
00727   isless(long double __x, long double __y)
00728   { return __builtin_isless(__x, __y); }
00729 
00730   template<typename _Tp, typename _Up>
00731     constexpr typename
00732     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00733                 && __is_arithmetic<_Up>::__value), bool>::__type
00734     isless(_Tp __x, _Up __y)
00735     {
00736       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00737       return __builtin_isless(__type(__x), __type(__y));
00738     }
00739 
00740   constexpr bool
00741   islessequal(float __x, float __y)
00742   { return __builtin_islessequal(__x, __y); }
00743 
00744   constexpr bool
00745   islessequal(double __x, double __y)
00746   { return __builtin_islessequal(__x, __y); }
00747 
00748   constexpr bool
00749   islessequal(long double __x, long double __y)
00750   { return __builtin_islessequal(__x, __y); }
00751 
00752   template<typename _Tp, typename _Up>
00753     constexpr typename
00754     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00755                 && __is_arithmetic<_Up>::__value), bool>::__type
00756     islessequal(_Tp __x, _Up __y)
00757     {
00758       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00759       return __builtin_islessequal(__type(__x), __type(__y));
00760     }
00761 
00762   constexpr bool
00763   islessgreater(float __x, float __y)
00764   { return __builtin_islessgreater(__x, __y); }
00765 
00766   constexpr bool
00767   islessgreater(double __x, double __y)
00768   { return __builtin_islessgreater(__x, __y); }
00769 
00770   constexpr bool
00771   islessgreater(long double __x, long double __y)
00772   { return __builtin_islessgreater(__x, __y); }
00773 
00774   template<typename _Tp, typename _Up>
00775     constexpr typename
00776     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00777                 && __is_arithmetic<_Up>::__value), bool>::__type
00778     islessgreater(_Tp __x, _Up __y)
00779     {
00780       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00781       return __builtin_islessgreater(__type(__x), __type(__y));
00782     }
00783 
00784   constexpr bool
00785   isunordered(float __x, float __y)
00786   { return __builtin_isunordered(__x, __y); }
00787 
00788   constexpr bool
00789   isunordered(double __x, double __y)
00790   { return __builtin_isunordered(__x, __y); }
00791 
00792   constexpr bool
00793   isunordered(long double __x, long double __y)
00794   { return __builtin_isunordered(__x, __y); }
00795 
00796   template<typename _Tp, typename _Up>
00797     constexpr typename
00798     __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
00799                 && __is_arithmetic<_Up>::__value), bool>::__type
00800     isunordered(_Tp __x, _Up __y)
00801     {
00802       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00803       return __builtin_isunordered(__type(__x), __type(__y));
00804     }
00805 
00806 #else
00807 
00808   template<typename _Tp>
00809     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00810                        int>::__type
00811     fpclassify(_Tp __f)
00812     {
00813       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00814       return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
00815                   FP_SUBNORMAL, FP_ZERO, __type(__f));
00816     }
00817 
00818   template<typename _Tp>
00819     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00820                        int>::__type
00821     isfinite(_Tp __f)
00822     {
00823       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00824       return __builtin_isfinite(__type(__f));
00825     }
00826 
00827   template<typename _Tp>
00828     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00829                        int>::__type
00830     isinf(_Tp __f)
00831     {
00832       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00833       return __builtin_isinf(__type(__f));
00834     }
00835 
00836   template<typename _Tp>
00837     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00838                        int>::__type
00839     isnan(_Tp __f)
00840     {
00841       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00842       return __builtin_isnan(__type(__f));
00843     }
00844 
00845   template<typename _Tp>
00846     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00847                        int>::__type
00848     isnormal(_Tp __f)
00849     {
00850       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00851       return __builtin_isnormal(__type(__f));
00852     }
00853 
00854   template<typename _Tp>
00855     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00856                        int>::__type
00857     signbit(_Tp __f)
00858     {
00859       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00860       return __builtin_signbit(__type(__f));
00861     }
00862 
00863   template<typename _Tp>
00864     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00865                        int>::__type
00866     isgreater(_Tp __f1, _Tp __f2)
00867     {
00868       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00869       return __builtin_isgreater(__type(__f1), __type(__f2));
00870     }
00871 
00872   template<typename _Tp>
00873     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00874                        int>::__type
00875     isgreaterequal(_Tp __f1, _Tp __f2)
00876     {
00877       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00878       return __builtin_isgreaterequal(__type(__f1), __type(__f2));
00879     }
00880 
00881   template<typename _Tp>
00882     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00883                        int>::__type
00884     isless(_Tp __f1, _Tp __f2)
00885     {
00886       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00887       return __builtin_isless(__type(__f1), __type(__f2));
00888     }
00889 
00890   template<typename _Tp>
00891     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00892                        int>::__type
00893     islessequal(_Tp __f1, _Tp __f2)
00894     {
00895       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00896       return __builtin_islessequal(__type(__f1), __type(__f2));
00897     }
00898 
00899   template<typename _Tp>
00900     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00901                        int>::__type
00902     islessgreater(_Tp __f1, _Tp __f2)
00903     {
00904       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00905       return __builtin_islessgreater(__type(__f1), __type(__f2));
00906     }
00907 
00908   template<typename _Tp>
00909     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
00910                        int>::__type
00911     isunordered(_Tp __f1, _Tp __f2)
00912     {
00913       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
00914       return __builtin_isunordered(__type(__f1), __type(__f2));
00915     }
00916 
00917 #endif
00918 
00919 _GLIBCXX_END_NAMESPACE_VERSION
00920 } // namespace
00921 
00922 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
00923 #endif
00924 
00925 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00926 
00927 #ifdef _GLIBCXX_USE_C99_MATH_TR1
00928 
00929 #undef acosh
00930 #undef acoshf
00931 #undef acoshl
00932 #undef asinh
00933 #undef asinhf
00934 #undef asinhl
00935 #undef atanh
00936 #undef atanhf
00937 #undef atanhl
00938 #undef cbrt
00939 #undef cbrtf
00940 #undef cbrtl
00941 #undef copysign
00942 #undef copysignf
00943 #undef copysignl
00944 #undef erf
00945 #undef erff
00946 #undef erfl
00947 #undef erfc
00948 #undef erfcf
00949 #undef erfcl
00950 #undef exp2
00951 #undef exp2f
00952 #undef exp2l
00953 #undef expm1
00954 #undef expm1f
00955 #undef expm1l
00956 #undef fdim
00957 #undef fdimf
00958 #undef fdiml
00959 #undef fma
00960 #undef fmaf
00961 #undef fmal
00962 #undef fmax
00963 #undef fmaxf
00964 #undef fmaxl
00965 #undef fmin
00966 #undef fminf
00967 #undef fminl
00968 #undef hypot
00969 #undef hypotf
00970 #undef hypotl
00971 #undef ilogb
00972 #undef ilogbf
00973 #undef ilogbl
00974 #undef lgamma
00975 #undef lgammaf
00976 #undef lgammal
00977 #undef llrint
00978 #undef llrintf
00979 #undef llrintl
00980 #undef llround
00981 #undef llroundf
00982 #undef llroundl
00983 #undef log1p
00984 #undef log1pf
00985 #undef log1pl
00986 #undef log2
00987 #undef log2f
00988 #undef log2l
00989 #undef logb
00990 #undef logbf
00991 #undef logbl
00992 #undef lrint
00993 #undef lrintf
00994 #undef lrintl
00995 #undef lround
00996 #undef lroundf
00997 #undef lroundl
00998 #undef nan
00999 #undef nanf
01000 #undef nanl
01001 #undef nearbyint
01002 #undef nearbyintf
01003 #undef nearbyintl
01004 #undef nextafter
01005 #undef nextafterf
01006 #undef nextafterl
01007 #undef nexttoward
01008 #undef nexttowardf
01009 #undef nexttowardl
01010 #undef remainder
01011 #undef remainderf
01012 #undef remainderl
01013 #undef remquo
01014 #undef remquof
01015 #undef remquol
01016 #undef rint
01017 #undef rintf
01018 #undef rintl
01019 #undef round
01020 #undef roundf
01021 #undef roundl
01022 #undef scalbln
01023 #undef scalblnf
01024 #undef scalblnl
01025 #undef scalbn
01026 #undef scalbnf
01027 #undef scalbnl
01028 #undef tgamma
01029 #undef tgammaf
01030 #undef tgammal
01031 #undef trunc
01032 #undef truncf
01033 #undef truncl
01034 
01035 namespace std _GLIBCXX_VISIBILITY(default)
01036 {
01037 _GLIBCXX_BEGIN_NAMESPACE_VERSION
01038 
01039   // types
01040   using ::double_t;
01041   using ::float_t;
01042 
01043   // functions
01044   using ::acosh;
01045   using ::acoshf;
01046   using ::acoshl;
01047 
01048   using ::asinh;
01049   using ::asinhf;
01050   using ::asinhl;
01051 
01052   using ::atanh;
01053   using ::atanhf;
01054   using ::atanhl;
01055 
01056   using ::cbrt;
01057   using ::cbrtf;
01058   using ::cbrtl;
01059 
01060   using ::copysign;
01061   using ::copysignf;
01062   using ::copysignl;
01063 
01064   using ::erf;
01065   using ::erff;
01066   using ::erfl;
01067 
01068   using ::erfc;
01069   using ::erfcf;
01070   using ::erfcl;
01071 
01072   using ::exp2;
01073   using ::exp2f;
01074   using ::exp2l;
01075 
01076   using ::expm1;
01077   using ::expm1f;
01078   using ::expm1l;
01079 
01080   using ::fdim;
01081   using ::fdimf;
01082   using ::fdiml;
01083 
01084   using ::fma;
01085   using ::fmaf;
01086   using ::fmal;
01087 
01088   using ::fmax;
01089   using ::fmaxf;
01090   using ::fmaxl;
01091 
01092   using ::fmin;
01093   using ::fminf;
01094   using ::fminl;
01095 
01096   using ::hypot;
01097   using ::hypotf;
01098   using ::hypotl;
01099 
01100   using ::ilogb;
01101   using ::ilogbf;
01102   using ::ilogbl;
01103 
01104   using ::lgamma;
01105   using ::lgammaf;
01106   using ::lgammal;
01107 
01108   using ::llrint;
01109   using ::llrintf;
01110   using ::llrintl;
01111 
01112   using ::llround;
01113   using ::llroundf;
01114   using ::llroundl;
01115 
01116   using ::log1p;
01117   using ::log1pf;
01118   using ::log1pl;
01119 
01120   using ::log2;
01121   using ::log2f;
01122   using ::log2l;
01123 
01124   using ::logb;
01125   using ::logbf;
01126   using ::logbl;
01127 
01128   using ::lrint;
01129   using ::lrintf;
01130   using ::lrintl;
01131 
01132   using ::lround;
01133   using ::lroundf;
01134   using ::lroundl;
01135 
01136   using ::nan;
01137   using ::nanf;
01138   using ::nanl;
01139 
01140   using ::nearbyint;
01141   using ::nearbyintf;
01142   using ::nearbyintl;
01143 
01144   using ::nextafter;
01145   using ::nextafterf;
01146   using ::nextafterl;
01147 
01148   using ::nexttoward;
01149   using ::nexttowardf;
01150   using ::nexttowardl;
01151 
01152   using ::remainder;
01153   using ::remainderf;
01154   using ::remainderl;
01155 
01156   using ::remquo;
01157   using ::remquof;
01158   using ::remquol;
01159 
01160   using ::rint;
01161   using ::rintf;
01162   using ::rintl;
01163 
01164   using ::round;
01165   using ::roundf;
01166   using ::roundl;
01167 
01168   using ::scalbln;
01169   using ::scalblnf;
01170   using ::scalblnl;
01171 
01172   using ::scalbn;
01173   using ::scalbnf;
01174   using ::scalbnl;
01175 
01176   using ::tgamma;
01177   using ::tgammaf;
01178   using ::tgammal;
01179 
01180   using ::trunc;
01181   using ::truncf;
01182   using ::truncl;
01183 
01184   /// Additional overloads.
01185   constexpr float
01186   acosh(float __x)
01187   { return __builtin_acoshf(__x); }
01188 
01189   constexpr long double
01190   acosh(long double __x)
01191   { return __builtin_acoshl(__x); }
01192 
01193   template<typename _Tp>
01194     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01195                                               double>::__type
01196     acosh(_Tp __x)
01197     { return __builtin_acosh(__x); }
01198 
01199   constexpr float
01200   asinh(float __x)
01201   { return __builtin_asinhf(__x); }
01202 
01203   constexpr long double
01204   asinh(long double __x)
01205   { return __builtin_asinhl(__x); }
01206 
01207   template<typename _Tp>
01208     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01209                                               double>::__type
01210     asinh(_Tp __x)
01211     { return __builtin_asinh(__x); }
01212 
01213   constexpr float
01214   atanh(float __x)
01215   { return __builtin_atanhf(__x); }
01216 
01217   constexpr long double
01218   atanh(long double __x)
01219   { return __builtin_atanhl(__x); }
01220 
01221   template<typename _Tp>
01222     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01223                                               double>::__type
01224     atanh(_Tp __x)
01225     { return __builtin_atanh(__x); }
01226 
01227   constexpr float
01228   cbrt(float __x)
01229   { return __builtin_cbrtf(__x); }
01230 
01231   constexpr long double
01232   cbrt(long double __x)
01233   { return __builtin_cbrtl(__x); }
01234 
01235   template<typename _Tp>
01236     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01237                                               double>::__type
01238     cbrt(_Tp __x)
01239     { return __builtin_cbrt(__x); }
01240 
01241   constexpr float
01242   copysign(float __x, float __y)
01243   { return __builtin_copysignf(__x, __y); }
01244 
01245   constexpr long double
01246   copysign(long double __x, long double __y)
01247   { return __builtin_copysignl(__x, __y); }
01248 
01249   template<typename _Tp, typename _Up>
01250     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01251     copysign(_Tp __x, _Up __y)
01252     {
01253       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01254       return copysign(__type(__x), __type(__y));
01255     }
01256 
01257   constexpr float
01258   erf(float __x)
01259   { return __builtin_erff(__x); }
01260 
01261   constexpr long double
01262   erf(long double __x)
01263   { return __builtin_erfl(__x); }
01264 
01265   template<typename _Tp>
01266     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01267                                               double>::__type
01268     erf(_Tp __x)
01269     { return __builtin_erf(__x); }
01270 
01271   constexpr float
01272   erfc(float __x)
01273   { return __builtin_erfcf(__x); }
01274 
01275   constexpr long double
01276   erfc(long double __x)
01277   { return __builtin_erfcl(__x); }
01278 
01279   template<typename _Tp>
01280     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01281                                               double>::__type
01282     erfc(_Tp __x)
01283     { return __builtin_erfc(__x); }
01284 
01285   constexpr float
01286   exp2(float __x)
01287   { return __builtin_exp2f(__x); }
01288 
01289   constexpr long double
01290   exp2(long double __x)
01291   { return __builtin_exp2l(__x); }
01292 
01293   template<typename _Tp>
01294     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01295                                               double>::__type
01296     exp2(_Tp __x)
01297     { return __builtin_exp2(__x); }
01298 
01299   constexpr float
01300   expm1(float __x)
01301   { return __builtin_expm1f(__x); }
01302 
01303   constexpr long double
01304   expm1(long double __x)
01305   { return __builtin_expm1l(__x); }
01306 
01307   template<typename _Tp>
01308     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01309                                               double>::__type
01310     expm1(_Tp __x)
01311     { return __builtin_expm1(__x); }
01312 
01313   constexpr float
01314   fdim(float __x, float __y)
01315   { return __builtin_fdimf(__x, __y); }
01316 
01317   constexpr long double
01318   fdim(long double __x, long double __y)
01319   { return __builtin_fdiml(__x, __y); }
01320 
01321   template<typename _Tp, typename _Up>
01322     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01323     fdim(_Tp __x, _Up __y)
01324     {
01325       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01326       return fdim(__type(__x), __type(__y));
01327     }
01328 
01329   constexpr float
01330   fma(float __x, float __y, float __z)
01331   { return __builtin_fmaf(__x, __y, __z); }
01332 
01333   constexpr long double
01334   fma(long double __x, long double __y, long double __z)
01335   { return __builtin_fmal(__x, __y, __z); }
01336 
01337   template<typename _Tp, typename _Up, typename _Vp>
01338     constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
01339     fma(_Tp __x, _Up __y, _Vp __z)
01340     {
01341       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
01342       return fma(__type(__x), __type(__y), __type(__z));
01343     }
01344 
01345   constexpr float
01346   fmax(float __x, float __y)
01347   { return __builtin_fmaxf(__x, __y); }
01348 
01349   constexpr long double
01350   fmax(long double __x, long double __y)
01351   { return __builtin_fmaxl(__x, __y); }
01352 
01353   template<typename _Tp, typename _Up>
01354     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01355     fmax(_Tp __x, _Up __y)
01356     {
01357       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01358       return fmax(__type(__x), __type(__y));
01359     }
01360 
01361   constexpr float
01362   fmin(float __x, float __y)
01363   { return __builtin_fminf(__x, __y); }
01364 
01365   constexpr long double
01366   fmin(long double __x, long double __y)
01367   { return __builtin_fminl(__x, __y); }
01368 
01369   template<typename _Tp, typename _Up>
01370     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01371     fmin(_Tp __x, _Up __y)
01372     {
01373       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01374       return fmin(__type(__x), __type(__y));
01375     }
01376 
01377   constexpr float
01378   hypot(float __x, float __y)
01379   { return __builtin_hypotf(__x, __y); }
01380 
01381   constexpr long double
01382   hypot(long double __x, long double __y)
01383   { return __builtin_hypotl(__x, __y); }
01384 
01385   template<typename _Tp, typename _Up>
01386     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01387     hypot(_Tp __x, _Up __y)
01388     {
01389       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01390       return hypot(__type(__x), __type(__y));
01391     }
01392 
01393   constexpr int
01394   ilogb(float __x)
01395   { return __builtin_ilogbf(__x); }
01396 
01397   constexpr int
01398   ilogb(long double __x)
01399   { return __builtin_ilogbl(__x); }
01400 
01401   template<typename _Tp>
01402     constexpr
01403     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01404                                     int>::__type
01405     ilogb(_Tp __x)
01406     { return __builtin_ilogb(__x); }
01407 
01408   constexpr float
01409   lgamma(float __x)
01410   { return __builtin_lgammaf(__x); }
01411 
01412   constexpr long double
01413   lgamma(long double __x)
01414   { return __builtin_lgammal(__x); }
01415 
01416   template<typename _Tp>
01417     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01418                                               double>::__type
01419     lgamma(_Tp __x)
01420     { return __builtin_lgamma(__x); }
01421 
01422   constexpr long long
01423   llrint(float __x)
01424   { return __builtin_llrintf(__x); }
01425 
01426   constexpr long long
01427   llrint(long double __x)
01428   { return __builtin_llrintl(__x); }
01429 
01430   template<typename _Tp>
01431     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01432                                               long long>::__type
01433     llrint(_Tp __x)
01434     { return __builtin_llrint(__x); }
01435 
01436   constexpr long long
01437   llround(float __x)
01438   { return __builtin_llroundf(__x); }
01439 
01440   constexpr long long
01441   llround(long double __x)
01442   { return __builtin_llroundl(__x); }
01443 
01444   template<typename _Tp>
01445     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01446                                               long long>::__type
01447     llround(_Tp __x)
01448     { return __builtin_llround(__x); }
01449 
01450   constexpr float
01451   log1p(float __x)
01452   { return __builtin_log1pf(__x); }
01453 
01454   constexpr long double
01455   log1p(long double __x)
01456   { return __builtin_log1pl(__x); }
01457 
01458   template<typename _Tp>
01459     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01460                                               double>::__type
01461     log1p(_Tp __x)
01462     { return __builtin_log1p(__x); }
01463 
01464   // DR 568.
01465   constexpr float
01466   log2(float __x)
01467   { return __builtin_log2f(__x); }
01468 
01469   constexpr long double
01470   log2(long double __x)
01471   { return __builtin_log2l(__x); }
01472 
01473   template<typename _Tp>
01474     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01475                                               double>::__type
01476     log2(_Tp __x)
01477     { return __builtin_log2(__x); }
01478 
01479   constexpr float
01480   logb(float __x)
01481   { return __builtin_logbf(__x); }
01482 
01483   constexpr long double
01484   logb(long double __x)
01485   { return __builtin_logbl(__x); }
01486 
01487   template<typename _Tp>
01488     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01489                                               double>::__type
01490     logb(_Tp __x)
01491     { return __builtin_logb(__x); }
01492 
01493   constexpr long
01494   lrint(float __x)
01495   { return __builtin_lrintf(__x); }
01496 
01497   constexpr long
01498   lrint(long double __x)
01499   { return __builtin_lrintl(__x); }
01500 
01501   template<typename _Tp>
01502     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01503                                               long>::__type
01504     lrint(_Tp __x)
01505     { return __builtin_lrint(__x); }
01506 
01507   constexpr long
01508   lround(float __x)
01509   { return __builtin_lroundf(__x); }
01510 
01511   constexpr long
01512   lround(long double __x)
01513   { return __builtin_lroundl(__x); }
01514 
01515   template<typename _Tp>
01516     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01517                                               long>::__type
01518     lround(_Tp __x)
01519     { return __builtin_lround(__x); }
01520 
01521   constexpr float
01522   nearbyint(float __x)
01523   { return __builtin_nearbyintf(__x); }
01524 
01525   constexpr long double
01526   nearbyint(long double __x)
01527   { return __builtin_nearbyintl(__x); }
01528 
01529   template<typename _Tp>
01530     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01531                                               double>::__type
01532     nearbyint(_Tp __x)
01533     { return __builtin_nearbyint(__x); }
01534 
01535   constexpr float
01536   nextafter(float __x, float __y)
01537   { return __builtin_nextafterf(__x, __y); }
01538 
01539   constexpr long double
01540   nextafter(long double __x, long double __y)
01541   { return __builtin_nextafterl(__x, __y); }
01542 
01543   template<typename _Tp, typename _Up>
01544     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01545     nextafter(_Tp __x, _Up __y)
01546     {
01547       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01548       return nextafter(__type(__x), __type(__y));
01549     }
01550 
01551   constexpr float
01552   nexttoward(float __x, long double __y)
01553   { return __builtin_nexttowardf(__x, __y); }
01554 
01555   constexpr long double
01556   nexttoward(long double __x, long double __y)
01557   { return __builtin_nexttowardl(__x, __y); }
01558 
01559   template<typename _Tp>
01560     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01561                                               double>::__type
01562     nexttoward(_Tp __x, long double __y)
01563     { return __builtin_nexttoward(__x, __y); }
01564 
01565   constexpr float
01566   remainder(float __x, float __y)
01567   { return __builtin_remainderf(__x, __y); }
01568 
01569   constexpr long double
01570   remainder(long double __x, long double __y)
01571   { return __builtin_remainderl(__x, __y); }
01572 
01573   template<typename _Tp, typename _Up>
01574     constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01575     remainder(_Tp __x, _Up __y)
01576     {
01577       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01578       return remainder(__type(__x), __type(__y));
01579     }
01580 
01581   inline float
01582   remquo(float __x, float __y, int* __pquo)
01583   { return __builtin_remquof(__x, __y, __pquo); }
01584 
01585   inline long double
01586   remquo(long double __x, long double __y, int* __pquo)
01587   { return __builtin_remquol(__x, __y, __pquo); }
01588 
01589   template<typename _Tp, typename _Up>
01590     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
01591     remquo(_Tp __x, _Up __y, int* __pquo)
01592     {
01593       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
01594       return remquo(__type(__x), __type(__y), __pquo);
01595     }
01596 
01597   constexpr float
01598   rint(float __x)
01599   { return __builtin_rintf(__x); }
01600 
01601   constexpr long double
01602   rint(long double __x)
01603   { return __builtin_rintl(__x); }
01604 
01605   template<typename _Tp>
01606     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01607                                               double>::__type
01608     rint(_Tp __x)
01609     { return __builtin_rint(__x); }
01610 
01611   constexpr float
01612   round(float __x)
01613   { return __builtin_roundf(__x); }
01614 
01615   constexpr long double
01616   round(long double __x)
01617   { return __builtin_roundl(__x); }
01618 
01619   template<typename _Tp>
01620     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01621                                               double>::__type
01622     round(_Tp __x)
01623     { return __builtin_round(__x); }
01624 
01625   constexpr float
01626   scalbln(float __x, long __ex)
01627   { return __builtin_scalblnf(__x, __ex); }
01628 
01629   constexpr long double
01630   scalbln(long double __x, long __ex)
01631   { return __builtin_scalblnl(__x, __ex); }
01632 
01633   template<typename _Tp>
01634     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01635                                               double>::__type
01636     scalbln(_Tp __x, long __ex)
01637     { return __builtin_scalbln(__x, __ex); }
01638  
01639   constexpr float
01640   scalbn(float __x, int __ex)
01641   { return __builtin_scalbnf(__x, __ex); }
01642 
01643   constexpr long double
01644   scalbn(long double __x, int __ex)
01645   { return __builtin_scalbnl(__x, __ex); }
01646 
01647   template<typename _Tp>
01648     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01649                                               double>::__type
01650     scalbn(_Tp __x, int __ex)
01651     { return __builtin_scalbn(__x, __ex); }
01652 
01653   constexpr float
01654   tgamma(float __x)
01655   { return __builtin_tgammaf(__x); }
01656 
01657   constexpr long double
01658   tgamma(long double __x)
01659   { return __builtin_tgammal(__x); }
01660 
01661   template<typename _Tp>
01662     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01663                                               double>::__type
01664     tgamma(_Tp __x)
01665     { return __builtin_tgamma(__x); }
01666  
01667   constexpr float
01668   trunc(float __x)
01669   { return __builtin_truncf(__x); }
01670 
01671   constexpr long double
01672   trunc(long double __x)
01673   { return __builtin_truncl(__x); }
01674 
01675   template<typename _Tp>
01676     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
01677                                               double>::__type
01678     trunc(_Tp __x)
01679     { return __builtin_trunc(__x); }
01680 
01681 _GLIBCXX_END_NAMESPACE_VERSION
01682 } // namespace
01683 
01684 #endif // _GLIBCXX_USE_C99_MATH_TR1
01685 
01686 #endif // __GXX_EXPERIMENTAL_CXX0X__
01687 
01688 #endif