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