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