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