libstdc++
|
00001 // TR1 cmath -*- C++ -*- 00002 00003 // Copyright (C) 2006-2013 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 // DR 550. What should the return type of pow(float,int) be? 00850 // NB: C++0x and TR1 != C++03. 00851 // using std::pow; 00852 00853 inline float 00854 remainder(float __x, float __y) 00855 { return __builtin_remainderf(__x, __y); } 00856 00857 inline long double 00858 remainder(long double __x, long double __y) 00859 { return __builtin_remainderl(__x, __y); } 00860 00861 template<typename _Tp, typename _Up> 00862 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 00863 remainder(_Tp __x, _Up __y) 00864 { 00865 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00866 return remainder(__type(__x), __type(__y)); 00867 } 00868 00869 inline float 00870 remquo(float __x, float __y, int* __pquo) 00871 { return __builtin_remquof(__x, __y, __pquo); } 00872 00873 inline long double 00874 remquo(long double __x, long double __y, int* __pquo) 00875 { return __builtin_remquol(__x, __y, __pquo); } 00876 00877 template<typename _Tp, typename _Up> 00878 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 00879 remquo(_Tp __x, _Up __y, int* __pquo) 00880 { 00881 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 00882 return remquo(__type(__x), __type(__y), __pquo); 00883 } 00884 00885 inline float 00886 rint(float __x) 00887 { return __builtin_rintf(__x); } 00888 00889 inline long double 00890 rint(long double __x) 00891 { return __builtin_rintl(__x); } 00892 00893 template<typename _Tp> 00894 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00895 double>::__type 00896 rint(_Tp __x) 00897 { return __builtin_rint(__x); } 00898 00899 inline float 00900 round(float __x) 00901 { return __builtin_roundf(__x); } 00902 00903 inline long double 00904 round(long double __x) 00905 { return __builtin_roundl(__x); } 00906 00907 template<typename _Tp> 00908 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00909 double>::__type 00910 round(_Tp __x) 00911 { return __builtin_round(__x); } 00912 00913 inline float 00914 scalbln(float __x, long __ex) 00915 { return __builtin_scalblnf(__x, __ex); } 00916 00917 inline long double 00918 scalbln(long double __x, long __ex) 00919 { return __builtin_scalblnl(__x, __ex); } 00920 00921 template<typename _Tp> 00922 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00923 double>::__type 00924 scalbln(_Tp __x, long __ex) 00925 { return __builtin_scalbln(__x, __ex); } 00926 00927 inline float 00928 scalbn(float __x, int __ex) 00929 { return __builtin_scalbnf(__x, __ex); } 00930 00931 inline long double 00932 scalbn(long double __x, int __ex) 00933 { return __builtin_scalbnl(__x, __ex); } 00934 00935 template<typename _Tp> 00936 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00937 double>::__type 00938 scalbn(_Tp __x, int __ex) 00939 { return __builtin_scalbn(__x, __ex); } 00940 00941 using std::sin; 00942 using std::sinh; 00943 using std::sqrt; 00944 using std::tan; 00945 using std::tanh; 00946 00947 inline float 00948 tgamma(float __x) 00949 { return __builtin_tgammaf(__x); } 00950 00951 inline long double 00952 tgamma(long double __x) 00953 { return __builtin_tgammal(__x); } 00954 00955 template<typename _Tp> 00956 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00957 double>::__type 00958 tgamma(_Tp __x) 00959 { return __builtin_tgamma(__x); } 00960 00961 inline float 00962 trunc(float __x) 00963 { return __builtin_truncf(__x); } 00964 00965 inline long double 00966 trunc(long double __x) 00967 { return __builtin_truncl(__x); } 00968 00969 template<typename _Tp> 00970 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 00971 double>::__type 00972 trunc(_Tp __x) 00973 { return __builtin_trunc(__x); } 00974 00975 #endif 00976 _GLIBCXX_END_NAMESPACE_VERSION 00977 } 00978 } 00979 00980 namespace std _GLIBCXX_VISIBILITY(default) 00981 { 00982 namespace tr1 00983 { 00984 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00985 00986 // DR 550. What should the return type of pow(float,int) be? 00987 // NB: C++0x and TR1 != C++03. 00988 inline double 00989 pow(double __x, double __y) 00990 { return std::pow(__x, __y); } 00991 00992 inline float 00993 pow(float __x, float __y) 00994 { return std::pow(__x, __y); } 00995 00996 inline long double 00997 pow(long double __x, long double __y) 00998 { return std::pow(__x, __y); } 00999 01000 template<typename _Tp, typename _Up> 01001 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 01002 pow(_Tp __x, _Up __y) 01003 { 01004 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 01005 return std::pow(__type(__x), __type(__y)); 01006 } 01007 01008 _GLIBCXX_END_NAMESPACE_VERSION 01009 } 01010 } 01011 01012 #include <bits/stl_algobase.h> 01013 #include <limits> 01014 #include <tr1/type_traits> 01015 01016 #include <tr1/gamma.tcc> 01017 #include <tr1/bessel_function.tcc> 01018 #include <tr1/beta_function.tcc> 01019 #include <tr1/ell_integral.tcc> 01020 #include <tr1/exp_integral.tcc> 01021 #include <tr1/hypergeometric.tcc> 01022 #include <tr1/legendre_function.tcc> 01023 #include <tr1/modified_bessel_func.tcc> 01024 #include <tr1/poly_hermite.tcc> 01025 #include <tr1/poly_laguerre.tcc> 01026 #include <tr1/riemann_zeta.tcc> 01027 01028 namespace std _GLIBCXX_VISIBILITY(default) 01029 { 01030 namespace tr1 01031 { 01032 _GLIBCXX_BEGIN_NAMESPACE_VERSION 01033 01034 /** 01035 * @defgroup tr1_math_spec_func Mathematical Special Functions 01036 * @ingroup numerics 01037 * 01038 * A collection of advanced mathematical special functions. 01039 * @{ 01040 */ 01041 01042 inline float 01043 assoc_laguerref(unsigned int __n, unsigned int __m, float __x) 01044 { return __detail::__assoc_laguerre<float>(__n, __m, __x); } 01045 01046 inline long double 01047 assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x) 01048 { 01049 return __detail::__assoc_laguerre<long double>(__n, __m, __x); 01050 } 01051 01052 /// 5.2.1.1 Associated Laguerre polynomials. 01053 template<typename _Tp> 01054 inline typename __gnu_cxx::__promote<_Tp>::__type 01055 assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x) 01056 { 01057 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01058 return __detail::__assoc_laguerre<__type>(__n, __m, __x); 01059 } 01060 01061 inline float 01062 assoc_legendref(unsigned int __l, unsigned int __m, float __x) 01063 { return __detail::__assoc_legendre_p<float>(__l, __m, __x); } 01064 01065 inline long double 01066 assoc_legendrel(unsigned int __l, unsigned int __m, long double __x) 01067 { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); } 01068 01069 /// 5.2.1.2 Associated Legendre functions. 01070 template<typename _Tp> 01071 inline typename __gnu_cxx::__promote<_Tp>::__type 01072 assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x) 01073 { 01074 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01075 return __detail::__assoc_legendre_p<__type>(__l, __m, __x); 01076 } 01077 01078 inline float 01079 betaf(float __x, float __y) 01080 { return __detail::__beta<float>(__x, __y); } 01081 01082 inline long double 01083 betal(long double __x, long double __y) 01084 { return __detail::__beta<long double>(__x, __y); } 01085 01086 /// 5.2.1.3 Beta functions. 01087 template<typename _Tpx, typename _Tpy> 01088 inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type 01089 beta(_Tpx __x, _Tpy __y) 01090 { 01091 typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type; 01092 return __detail::__beta<__type>(__x, __y); 01093 } 01094 01095 inline float 01096 comp_ellint_1f(float __k) 01097 { return __detail::__comp_ellint_1<float>(__k); } 01098 01099 inline long double 01100 comp_ellint_1l(long double __k) 01101 { return __detail::__comp_ellint_1<long double>(__k); } 01102 01103 /// 5.2.1.4 Complete elliptic integrals of the first kind. 01104 template<typename _Tp> 01105 inline typename __gnu_cxx::__promote<_Tp>::__type 01106 comp_ellint_1(_Tp __k) 01107 { 01108 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01109 return __detail::__comp_ellint_1<__type>(__k); 01110 } 01111 01112 inline float 01113 comp_ellint_2f(float __k) 01114 { return __detail::__comp_ellint_2<float>(__k); } 01115 01116 inline long double 01117 comp_ellint_2l(long double __k) 01118 { return __detail::__comp_ellint_2<long double>(__k); } 01119 01120 /// 5.2.1.5 Complete elliptic integrals of the second kind. 01121 template<typename _Tp> 01122 inline typename __gnu_cxx::__promote<_Tp>::__type 01123 comp_ellint_2(_Tp __k) 01124 { 01125 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01126 return __detail::__comp_ellint_2<__type>(__k); 01127 } 01128 01129 inline float 01130 comp_ellint_3f(float __k, float __nu) 01131 { return __detail::__comp_ellint_3<float>(__k, __nu); } 01132 01133 inline long double 01134 comp_ellint_3l(long double __k, long double __nu) 01135 { return __detail::__comp_ellint_3<long double>(__k, __nu); } 01136 01137 /// 5.2.1.6 Complete elliptic integrals of the third kind. 01138 template<typename _Tp, typename _Tpn> 01139 inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type 01140 comp_ellint_3(_Tp __k, _Tpn __nu) 01141 { 01142 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type; 01143 return __detail::__comp_ellint_3<__type>(__k, __nu); 01144 } 01145 01146 inline float 01147 conf_hypergf(float __a, float __c, float __x) 01148 { return __detail::__conf_hyperg<float>(__a, __c, __x); } 01149 01150 inline long double 01151 conf_hypergl(long double __a, long double __c, long double __x) 01152 { return __detail::__conf_hyperg<long double>(__a, __c, __x); } 01153 01154 /// 5.2.1.7 Confluent hypergeometric functions. 01155 template<typename _Tpa, typename _Tpc, typename _Tp> 01156 inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type 01157 conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x) 01158 { 01159 typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type; 01160 return __detail::__conf_hyperg<__type>(__a, __c, __x); 01161 } 01162 01163 inline float 01164 cyl_bessel_if(float __nu, float __x) 01165 { return __detail::__cyl_bessel_i<float>(__nu, __x); } 01166 01167 inline long double 01168 cyl_bessel_il(long double __nu, long double __x) 01169 { return __detail::__cyl_bessel_i<long double>(__nu, __x); } 01170 01171 /// 5.2.1.8 Regular modified cylindrical Bessel functions. 01172 template<typename _Tpnu, typename _Tp> 01173 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 01174 cyl_bessel_i(_Tpnu __nu, _Tp __x) 01175 { 01176 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 01177 return __detail::__cyl_bessel_i<__type>(__nu, __x); 01178 } 01179 01180 inline float 01181 cyl_bessel_jf(float __nu, float __x) 01182 { return __detail::__cyl_bessel_j<float>(__nu, __x); } 01183 01184 inline long double 01185 cyl_bessel_jl(long double __nu, long double __x) 01186 { return __detail::__cyl_bessel_j<long double>(__nu, __x); } 01187 01188 /// 5.2.1.9 Cylindrical Bessel functions (of the first kind). 01189 template<typename _Tpnu, typename _Tp> 01190 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 01191 cyl_bessel_j(_Tpnu __nu, _Tp __x) 01192 { 01193 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 01194 return __detail::__cyl_bessel_j<__type>(__nu, __x); 01195 } 01196 01197 inline float 01198 cyl_bessel_kf(float __nu, float __x) 01199 { return __detail::__cyl_bessel_k<float>(__nu, __x); } 01200 01201 inline long double 01202 cyl_bessel_kl(long double __nu, long double __x) 01203 { return __detail::__cyl_bessel_k<long double>(__nu, __x); } 01204 01205 /// 5.2.1.10 Irregular modified cylindrical Bessel functions. 01206 template<typename _Tpnu, typename _Tp> 01207 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 01208 cyl_bessel_k(_Tpnu __nu, _Tp __x) 01209 { 01210 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 01211 return __detail::__cyl_bessel_k<__type>(__nu, __x); 01212 } 01213 01214 inline float 01215 cyl_neumannf(float __nu, float __x) 01216 { return __detail::__cyl_neumann_n<float>(__nu, __x); } 01217 01218 inline long double 01219 cyl_neumannl(long double __nu, long double __x) 01220 { return __detail::__cyl_neumann_n<long double>(__nu, __x); } 01221 01222 /// 5.2.1.11 Cylindrical Neumann functions. 01223 template<typename _Tpnu, typename _Tp> 01224 inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 01225 cyl_neumann(_Tpnu __nu, _Tp __x) 01226 { 01227 typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 01228 return __detail::__cyl_neumann_n<__type>(__nu, __x); 01229 } 01230 01231 inline float 01232 ellint_1f(float __k, float __phi) 01233 { return __detail::__ellint_1<float>(__k, __phi); } 01234 01235 inline long double 01236 ellint_1l(long double __k, long double __phi) 01237 { return __detail::__ellint_1<long double>(__k, __phi); } 01238 01239 /// 5.2.1.12 Incomplete elliptic integrals of the first kind. 01240 template<typename _Tp, typename _Tpp> 01241 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type 01242 ellint_1(_Tp __k, _Tpp __phi) 01243 { 01244 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type; 01245 return __detail::__ellint_1<__type>(__k, __phi); 01246 } 01247 01248 inline float 01249 ellint_2f(float __k, float __phi) 01250 { return __detail::__ellint_2<float>(__k, __phi); } 01251 01252 inline long double 01253 ellint_2l(long double __k, long double __phi) 01254 { return __detail::__ellint_2<long double>(__k, __phi); } 01255 01256 /// 5.2.1.13 Incomplete elliptic integrals of the second kind. 01257 template<typename _Tp, typename _Tpp> 01258 inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type 01259 ellint_2(_Tp __k, _Tpp __phi) 01260 { 01261 typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type; 01262 return __detail::__ellint_2<__type>(__k, __phi); 01263 } 01264 01265 inline float 01266 ellint_3f(float __k, float __nu, float __phi) 01267 { return __detail::__ellint_3<float>(__k, __nu, __phi); } 01268 01269 inline long double 01270 ellint_3l(long double __k, long double __nu, long double __phi) 01271 { return __detail::__ellint_3<long double>(__k, __nu, __phi); } 01272 01273 /// 5.2.1.14 Incomplete elliptic integrals of the third kind. 01274 template<typename _Tp, typename _Tpn, typename _Tpp> 01275 inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type 01276 ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi) 01277 { 01278 typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type; 01279 return __detail::__ellint_3<__type>(__k, __nu, __phi); 01280 } 01281 01282 inline float 01283 expintf(float __x) 01284 { return __detail::__expint<float>(__x); } 01285 01286 inline long double 01287 expintl(long double __x) 01288 { return __detail::__expint<long double>(__x); } 01289 01290 /// 5.2.1.15 Exponential integrals. 01291 template<typename _Tp> 01292 inline typename __gnu_cxx::__promote<_Tp>::__type 01293 expint(_Tp __x) 01294 { 01295 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01296 return __detail::__expint<__type>(__x); 01297 } 01298 01299 inline float 01300 hermitef(unsigned int __n, float __x) 01301 { return __detail::__poly_hermite<float>(__n, __x); } 01302 01303 inline long double 01304 hermitel(unsigned int __n, long double __x) 01305 { return __detail::__poly_hermite<long double>(__n, __x); } 01306 01307 /// 5.2.1.16 Hermite polynomials. 01308 template<typename _Tp> 01309 inline typename __gnu_cxx::__promote<_Tp>::__type 01310 hermite(unsigned int __n, _Tp __x) 01311 { 01312 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01313 return __detail::__poly_hermite<__type>(__n, __x); 01314 } 01315 01316 inline float 01317 hypergf(float __a, float __b, float __c, float __x) 01318 { return __detail::__hyperg<float>(__a, __b, __c, __x); } 01319 01320 inline long double 01321 hypergl(long double __a, long double __b, long double __c, long double __x) 01322 { return __detail::__hyperg<long double>(__a, __b, __c, __x); } 01323 01324 /// 5.2.1.17 Hypergeometric functions. 01325 template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp> 01326 inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type 01327 hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x) 01328 { 01329 typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type; 01330 return __detail::__hyperg<__type>(__a, __b, __c, __x); 01331 } 01332 01333 inline float 01334 laguerref(unsigned int __n, float __x) 01335 { return __detail::__laguerre<float>(__n, __x); } 01336 01337 inline long double 01338 laguerrel(unsigned int __n, long double __x) 01339 { return __detail::__laguerre<long double>(__n, __x); } 01340 01341 /// 5.2.1.18 Laguerre polynomials. 01342 template<typename _Tp> 01343 inline typename __gnu_cxx::__promote<_Tp>::__type 01344 laguerre(unsigned int __n, _Tp __x) 01345 { 01346 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01347 return __detail::__laguerre<__type>(__n, __x); 01348 } 01349 01350 inline float 01351 legendref(unsigned int __n, float __x) 01352 { return __detail::__poly_legendre_p<float>(__n, __x); } 01353 01354 inline long double 01355 legendrel(unsigned int __n, long double __x) 01356 { return __detail::__poly_legendre_p<long double>(__n, __x); } 01357 01358 /// 5.2.1.19 Legendre polynomials. 01359 template<typename _Tp> 01360 inline typename __gnu_cxx::__promote<_Tp>::__type 01361 legendre(unsigned int __n, _Tp __x) 01362 { 01363 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01364 return __detail::__poly_legendre_p<__type>(__n, __x); 01365 } 01366 01367 inline float 01368 riemann_zetaf(float __x) 01369 { return __detail::__riemann_zeta<float>(__x); } 01370 01371 inline long double 01372 riemann_zetal(long double __x) 01373 { return __detail::__riemann_zeta<long double>(__x); } 01374 01375 /// 5.2.1.20 Riemann zeta function. 01376 template<typename _Tp> 01377 inline typename __gnu_cxx::__promote<_Tp>::__type 01378 riemann_zeta(_Tp __x) 01379 { 01380 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01381 return __detail::__riemann_zeta<__type>(__x); 01382 } 01383 01384 inline float 01385 sph_besself(unsigned int __n, float __x) 01386 { return __detail::__sph_bessel<float>(__n, __x); } 01387 01388 inline long double 01389 sph_bessell(unsigned int __n, long double __x) 01390 { return __detail::__sph_bessel<long double>(__n, __x); } 01391 01392 /// 5.2.1.21 Spherical Bessel functions. 01393 template<typename _Tp> 01394 inline typename __gnu_cxx::__promote<_Tp>::__type 01395 sph_bessel(unsigned int __n, _Tp __x) 01396 { 01397 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01398 return __detail::__sph_bessel<__type>(__n, __x); 01399 } 01400 01401 inline float 01402 sph_legendref(unsigned int __l, unsigned int __m, float __theta) 01403 { return __detail::__sph_legendre<float>(__l, __m, __theta); } 01404 01405 inline long double 01406 sph_legendrel(unsigned int __l, unsigned int __m, long double __theta) 01407 { return __detail::__sph_legendre<long double>(__l, __m, __theta); } 01408 01409 /// 5.2.1.22 Spherical associated Legendre functions. 01410 template<typename _Tp> 01411 inline typename __gnu_cxx::__promote<_Tp>::__type 01412 sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta) 01413 { 01414 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01415 return __detail::__sph_legendre<__type>(__l, __m, __theta); 01416 } 01417 01418 inline float 01419 sph_neumannf(unsigned int __n, float __x) 01420 { return __detail::__sph_neumann<float>(__n, __x); } 01421 01422 inline long double 01423 sph_neumannl(unsigned int __n, long double __x) 01424 { return __detail::__sph_neumann<long double>(__n, __x); } 01425 01426 /// 5.2.1.23 Spherical Neumann functions. 01427 template<typename _Tp> 01428 inline typename __gnu_cxx::__promote<_Tp>::__type 01429 sph_neumann(unsigned int __n, _Tp __x) 01430 { 01431 typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 01432 return __detail::__sph_neumann<__type>(__n, __x); 01433 } 01434 01435 /* @} */ // tr1_math_spec_func 01436 _GLIBCXX_END_NAMESPACE_VERSION 01437 } 01438 } 01439 01440 #endif // _GLIBCXX_TR1_CMATH