1 1.1 mrg // TR1 cmath -*- C++ -*- 2 1.1 mrg 3 1.1.1.14 mrg // Copyright (C) 2006-2024 Free Software Foundation, Inc. 4 1.1 mrg // 5 1.1 mrg // This file is part of the GNU ISO C++ Library. This library is free 6 1.1 mrg // software; you can redistribute it and/or modify it under the 7 1.1 mrg // terms of the GNU General Public License as published by the 8 1.1 mrg // Free Software Foundation; either version 3, or (at your option) 9 1.1 mrg // any later version. 10 1.1 mrg 11 1.1 mrg // This library is distributed in the hope that it will be useful, 12 1.1 mrg // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 1.1 mrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 1.1 mrg // GNU General Public License for more details. 15 1.1 mrg 16 1.1 mrg // Under Section 7 of GPL version 3, you are granted additional 17 1.1 mrg // permissions described in the GCC Runtime Library Exception, version 18 1.1 mrg // 3.1, as published by the Free Software Foundation. 19 1.1 mrg 20 1.1 mrg // You should have received a copy of the GNU General Public License and 21 1.1 mrg // a copy of the GCC Runtime Library Exception along with this program; 22 1.1 mrg // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23 1.1 mrg // <http://www.gnu.org/licenses/>. 24 1.1 mrg 25 1.1 mrg /** @file tr1/cmath 26 1.1 mrg * This is a TR1 C++ Library header. 27 1.1 mrg */ 28 1.1 mrg 29 1.1 mrg #ifndef _GLIBCXX_TR1_CMATH 30 1.1 mrg #define _GLIBCXX_TR1_CMATH 1 31 1.1 mrg 32 1.1 mrg #pragma GCC system_header 33 1.1 mrg 34 1.1.1.14 mrg #include <bits/requires_hosted.h> // TR1 35 1.1.1.14 mrg 36 1.1.1.2 mrg #include <cmath> 37 1.1.1.2 mrg 38 1.1.1.2 mrg #ifdef _GLIBCXX_USE_C99_MATH_TR1 39 1.1.1.2 mrg 40 1.1.1.2 mrg #undef acosh 41 1.1.1.2 mrg #undef acoshf 42 1.1.1.2 mrg #undef acoshl 43 1.1.1.2 mrg #undef asinh 44 1.1.1.2 mrg #undef asinhf 45 1.1.1.2 mrg #undef asinhl 46 1.1.1.2 mrg #undef atanh 47 1.1.1.2 mrg #undef atanhf 48 1.1.1.2 mrg #undef atanhl 49 1.1.1.2 mrg #undef cbrt 50 1.1.1.2 mrg #undef cbrtf 51 1.1.1.2 mrg #undef cbrtl 52 1.1.1.2 mrg #undef copysign 53 1.1.1.2 mrg #undef copysignf 54 1.1.1.2 mrg #undef copysignl 55 1.1.1.2 mrg #undef erf 56 1.1.1.2 mrg #undef erff 57 1.1.1.2 mrg #undef erfl 58 1.1.1.2 mrg #undef erfc 59 1.1.1.2 mrg #undef erfcf 60 1.1.1.2 mrg #undef erfcl 61 1.1.1.2 mrg #undef exp2 62 1.1.1.2 mrg #undef exp2f 63 1.1.1.2 mrg #undef exp2l 64 1.1.1.2 mrg #undef expm1 65 1.1.1.2 mrg #undef expm1f 66 1.1.1.2 mrg #undef expm1l 67 1.1.1.2 mrg #undef fdim 68 1.1.1.2 mrg #undef fdimf 69 1.1.1.2 mrg #undef fdiml 70 1.1.1.2 mrg #undef fma 71 1.1.1.2 mrg #undef fmaf 72 1.1.1.2 mrg #undef fmal 73 1.1.1.2 mrg #undef fmax 74 1.1.1.2 mrg #undef fmaxf 75 1.1.1.2 mrg #undef fmaxl 76 1.1.1.2 mrg #undef fmin 77 1.1.1.2 mrg #undef fminf 78 1.1.1.2 mrg #undef fminl 79 1.1.1.2 mrg #undef hypot 80 1.1.1.2 mrg #undef hypotf 81 1.1.1.2 mrg #undef hypotl 82 1.1.1.2 mrg #undef ilogb 83 1.1.1.2 mrg #undef ilogbf 84 1.1.1.2 mrg #undef ilogbl 85 1.1.1.2 mrg #undef lgamma 86 1.1.1.2 mrg #undef lgammaf 87 1.1.1.2 mrg #undef lgammal 88 1.1.1.2 mrg #undef llrint 89 1.1.1.2 mrg #undef llrintf 90 1.1.1.2 mrg #undef llrintl 91 1.1.1.2 mrg #undef llround 92 1.1.1.2 mrg #undef llroundf 93 1.1.1.2 mrg #undef llroundl 94 1.1.1.2 mrg #undef log1p 95 1.1.1.2 mrg #undef log1pf 96 1.1.1.2 mrg #undef log1pl 97 1.1.1.2 mrg #undef log2 98 1.1.1.2 mrg #undef log2f 99 1.1.1.2 mrg #undef log2l 100 1.1.1.2 mrg #undef logb 101 1.1.1.2 mrg #undef logbf 102 1.1.1.2 mrg #undef logbl 103 1.1.1.2 mrg #undef lrint 104 1.1.1.2 mrg #undef lrintf 105 1.1.1.2 mrg #undef lrintl 106 1.1.1.2 mrg #undef lround 107 1.1.1.2 mrg #undef lroundf 108 1.1.1.2 mrg #undef lroundl 109 1.1.1.2 mrg #undef nan 110 1.1.1.2 mrg #undef nanf 111 1.1.1.2 mrg #undef nanl 112 1.1.1.2 mrg #undef nearbyint 113 1.1.1.2 mrg #undef nearbyintf 114 1.1.1.2 mrg #undef nearbyintl 115 1.1.1.2 mrg #undef nextafter 116 1.1.1.2 mrg #undef nextafterf 117 1.1.1.2 mrg #undef nextafterl 118 1.1.1.2 mrg #undef nexttoward 119 1.1.1.2 mrg #undef nexttowardf 120 1.1.1.2 mrg #undef nexttowardl 121 1.1.1.2 mrg #undef remainder 122 1.1.1.2 mrg #undef remainderf 123 1.1.1.2 mrg #undef remainderl 124 1.1.1.2 mrg #undef remquo 125 1.1.1.2 mrg #undef remquof 126 1.1.1.2 mrg #undef remquol 127 1.1.1.2 mrg #undef rint 128 1.1.1.2 mrg #undef rintf 129 1.1.1.2 mrg #undef rintl 130 1.1.1.2 mrg #undef round 131 1.1.1.2 mrg #undef roundf 132 1.1.1.2 mrg #undef roundl 133 1.1.1.2 mrg #undef scalbln 134 1.1.1.2 mrg #undef scalblnf 135 1.1.1.2 mrg #undef scalblnl 136 1.1.1.2 mrg #undef scalbn 137 1.1.1.2 mrg #undef scalbnf 138 1.1.1.2 mrg #undef scalbnl 139 1.1.1.2 mrg #undef tgamma 140 1.1.1.2 mrg #undef tgammaf 141 1.1.1.2 mrg #undef tgammal 142 1.1.1.2 mrg #undef trunc 143 1.1.1.2 mrg #undef truncf 144 1.1.1.2 mrg #undef truncl 145 1.1.1.2 mrg 146 1.1 mrg #endif 147 1.1 mrg 148 1.1.1.2 mrg namespace std _GLIBCXX_VISIBILITY(default) 149 1.1.1.2 mrg { 150 1.1.1.8 mrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 151 1.1.1.8 mrg 152 1.1.1.9 mrg namespace tr1 153 1.1.1.9 mrg { 154 1.1.1.2 mrg #if _GLIBCXX_USE_C99_MATH_TR1 155 1.1.1.2 mrg 156 1.1.1.5 mrg // Using declarations to bring names from libc's <math.h> into std::tr1. 157 1.1.1.5 mrg 158 1.1.1.2 mrg // types 159 1.1.1.2 mrg using ::double_t; 160 1.1.1.2 mrg using ::float_t; 161 1.1.1.2 mrg 162 1.1.1.2 mrg // functions 163 1.1.1.2 mrg using ::acosh; 164 1.1.1.2 mrg using ::acoshf; 165 1.1.1.2 mrg using ::acoshl; 166 1.1.1.2 mrg 167 1.1.1.2 mrg using ::asinh; 168 1.1.1.2 mrg using ::asinhf; 169 1.1.1.2 mrg using ::asinhl; 170 1.1.1.2 mrg 171 1.1.1.2 mrg using ::atanh; 172 1.1.1.2 mrg using ::atanhf; 173 1.1.1.2 mrg using ::atanhl; 174 1.1.1.2 mrg 175 1.1.1.2 mrg using ::cbrt; 176 1.1.1.2 mrg using ::cbrtf; 177 1.1.1.2 mrg using ::cbrtl; 178 1.1.1.2 mrg 179 1.1.1.2 mrg using ::copysign; 180 1.1.1.2 mrg using ::copysignf; 181 1.1.1.2 mrg using ::copysignl; 182 1.1.1.2 mrg 183 1.1.1.2 mrg using ::erf; 184 1.1.1.2 mrg using ::erff; 185 1.1.1.2 mrg using ::erfl; 186 1.1.1.2 mrg 187 1.1.1.2 mrg using ::erfc; 188 1.1.1.2 mrg using ::erfcf; 189 1.1.1.2 mrg using ::erfcl; 190 1.1.1.2 mrg 191 1.1.1.2 mrg using ::exp2; 192 1.1.1.2 mrg using ::exp2f; 193 1.1.1.2 mrg using ::exp2l; 194 1.1.1.2 mrg 195 1.1.1.2 mrg using ::expm1; 196 1.1.1.2 mrg using ::expm1f; 197 1.1.1.2 mrg using ::expm1l; 198 1.1.1.2 mrg 199 1.1.1.2 mrg using ::fdim; 200 1.1.1.2 mrg using ::fdimf; 201 1.1.1.2 mrg using ::fdiml; 202 1.1.1.2 mrg 203 1.1.1.2 mrg using ::fma; 204 1.1.1.2 mrg using ::fmaf; 205 1.1.1.2 mrg using ::fmal; 206 1.1.1.2 mrg 207 1.1.1.2 mrg using ::fmax; 208 1.1.1.2 mrg using ::fmaxf; 209 1.1.1.2 mrg using ::fmaxl; 210 1.1.1.2 mrg 211 1.1.1.2 mrg using ::fmin; 212 1.1.1.2 mrg using ::fminf; 213 1.1.1.2 mrg using ::fminl; 214 1.1.1.2 mrg 215 1.1.1.2 mrg using ::hypot; 216 1.1.1.2 mrg using ::hypotf; 217 1.1.1.2 mrg using ::hypotl; 218 1.1.1.2 mrg 219 1.1.1.2 mrg using ::ilogb; 220 1.1.1.2 mrg using ::ilogbf; 221 1.1.1.2 mrg using ::ilogbl; 222 1.1.1.2 mrg 223 1.1.1.2 mrg using ::lgamma; 224 1.1.1.2 mrg using ::lgammaf; 225 1.1.1.2 mrg using ::lgammal; 226 1.1.1.2 mrg 227 1.1.1.2 mrg using ::llrint; 228 1.1.1.2 mrg using ::llrintf; 229 1.1.1.2 mrg using ::llrintl; 230 1.1.1.2 mrg 231 1.1.1.2 mrg using ::llround; 232 1.1.1.2 mrg using ::llroundf; 233 1.1.1.2 mrg using ::llroundl; 234 1.1.1.2 mrg 235 1.1.1.2 mrg using ::log1p; 236 1.1.1.2 mrg using ::log1pf; 237 1.1.1.2 mrg using ::log1pl; 238 1.1.1.2 mrg 239 1.1.1.2 mrg using ::log2; 240 1.1.1.2 mrg using ::log2f; 241 1.1.1.2 mrg using ::log2l; 242 1.1.1.2 mrg 243 1.1.1.2 mrg using ::logb; 244 1.1.1.2 mrg using ::logbf; 245 1.1.1.2 mrg using ::logbl; 246 1.1.1.2 mrg 247 1.1.1.2 mrg using ::lrint; 248 1.1.1.2 mrg using ::lrintf; 249 1.1.1.2 mrg using ::lrintl; 250 1.1.1.2 mrg 251 1.1.1.2 mrg using ::lround; 252 1.1.1.2 mrg using ::lroundf; 253 1.1.1.2 mrg using ::lroundl; 254 1.1.1.2 mrg 255 1.1.1.2 mrg using ::nan; 256 1.1.1.2 mrg using ::nanf; 257 1.1.1.2 mrg using ::nanl; 258 1.1.1.2 mrg 259 1.1.1.2 mrg using ::nearbyint; 260 1.1.1.2 mrg using ::nearbyintf; 261 1.1.1.2 mrg using ::nearbyintl; 262 1.1.1.2 mrg 263 1.1.1.2 mrg using ::nextafter; 264 1.1.1.2 mrg using ::nextafterf; 265 1.1.1.2 mrg using ::nextafterl; 266 1.1.1.2 mrg 267 1.1.1.2 mrg using ::nexttoward; 268 1.1.1.2 mrg using ::nexttowardf; 269 1.1.1.2 mrg using ::nexttowardl; 270 1.1.1.2 mrg 271 1.1.1.2 mrg using ::remainder; 272 1.1.1.2 mrg using ::remainderf; 273 1.1.1.2 mrg using ::remainderl; 274 1.1.1.2 mrg 275 1.1.1.2 mrg using ::remquo; 276 1.1.1.2 mrg using ::remquof; 277 1.1.1.2 mrg using ::remquol; 278 1.1.1.2 mrg 279 1.1.1.2 mrg using ::rint; 280 1.1.1.2 mrg using ::rintf; 281 1.1.1.2 mrg using ::rintl; 282 1.1.1.2 mrg 283 1.1.1.2 mrg using ::round; 284 1.1.1.2 mrg using ::roundf; 285 1.1.1.2 mrg using ::roundl; 286 1.1.1.2 mrg 287 1.1.1.2 mrg using ::scalbln; 288 1.1.1.2 mrg using ::scalblnf; 289 1.1.1.2 mrg using ::scalblnl; 290 1.1.1.2 mrg 291 1.1.1.2 mrg using ::scalbn; 292 1.1.1.2 mrg using ::scalbnf; 293 1.1.1.2 mrg using ::scalbnl; 294 1.1.1.2 mrg 295 1.1.1.2 mrg using ::tgamma; 296 1.1.1.2 mrg using ::tgammaf; 297 1.1.1.2 mrg using ::tgammal; 298 1.1.1.2 mrg 299 1.1.1.2 mrg using ::trunc; 300 1.1.1.2 mrg using ::truncf; 301 1.1.1.2 mrg using ::truncl; 302 1.1.1.2 mrg 303 1.1.1.2 mrg #endif 304 1.1.1.2 mrg 305 1.1.1.2 mrg #if _GLIBCXX_USE_C99_MATH 306 1.1.1.2 mrg #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 307 1.1.1.2 mrg 308 1.1.1.2 mrg /// Function template definitions [8.16.3]. 309 1.1.1.2 mrg template<typename _Tp> 310 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 311 1.1.1.2 mrg int>::__type 312 1.1.1.2 mrg fpclassify(_Tp __f) 313 1.1.1.2 mrg { 314 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 315 1.1.1.2 mrg return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, 316 1.1.1.2 mrg FP_SUBNORMAL, FP_ZERO, __type(__f)); 317 1.1.1.2 mrg } 318 1.1.1.2 mrg 319 1.1.1.2 mrg template<typename _Tp> 320 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 321 1.1.1.2 mrg int>::__type 322 1.1.1.2 mrg isfinite(_Tp __f) 323 1.1.1.2 mrg { 324 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 325 1.1.1.2 mrg return __builtin_isfinite(__type(__f)); 326 1.1.1.2 mrg } 327 1.1.1.2 mrg 328 1.1.1.2 mrg template<typename _Tp> 329 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 330 1.1.1.2 mrg int>::__type 331 1.1.1.2 mrg isinf(_Tp __f) 332 1.1.1.2 mrg { 333 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 334 1.1.1.2 mrg return __builtin_isinf(__type(__f)); 335 1.1.1.2 mrg } 336 1.1.1.2 mrg 337 1.1.1.2 mrg template<typename _Tp> 338 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 339 1.1.1.2 mrg int>::__type 340 1.1.1.2 mrg isnan(_Tp __f) 341 1.1.1.2 mrg { 342 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 343 1.1.1.2 mrg return __builtin_isnan(__type(__f)); 344 1.1.1.2 mrg } 345 1.1.1.2 mrg 346 1.1.1.2 mrg template<typename _Tp> 347 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 348 1.1.1.2 mrg int>::__type 349 1.1.1.2 mrg isnormal(_Tp __f) 350 1.1.1.2 mrg { 351 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 352 1.1.1.2 mrg return __builtin_isnormal(__type(__f)); 353 1.1.1.2 mrg } 354 1.1.1.2 mrg 355 1.1.1.2 mrg template<typename _Tp> 356 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 357 1.1.1.2 mrg int>::__type 358 1.1.1.2 mrg signbit(_Tp __f) 359 1.1.1.2 mrg { 360 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 361 1.1.1.2 mrg return __builtin_signbit(__type(__f)); 362 1.1.1.2 mrg } 363 1.1.1.2 mrg 364 1.1.1.2 mrg template<typename _Tp> 365 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 366 1.1.1.2 mrg int>::__type 367 1.1.1.2 mrg isgreater(_Tp __f1, _Tp __f2) 368 1.1.1.2 mrg { 369 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 370 1.1.1.2 mrg return __builtin_isgreater(__type(__f1), __type(__f2)); 371 1.1.1.2 mrg } 372 1.1.1.2 mrg 373 1.1.1.2 mrg template<typename _Tp> 374 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 375 1.1.1.2 mrg int>::__type 376 1.1.1.2 mrg isgreaterequal(_Tp __f1, _Tp __f2) 377 1.1.1.2 mrg { 378 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 379 1.1.1.2 mrg return __builtin_isgreaterequal(__type(__f1), __type(__f2)); 380 1.1.1.2 mrg } 381 1.1.1.2 mrg 382 1.1.1.2 mrg template<typename _Tp> 383 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 384 1.1.1.2 mrg int>::__type 385 1.1.1.2 mrg isless(_Tp __f1, _Tp __f2) 386 1.1.1.2 mrg { 387 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 388 1.1.1.2 mrg return __builtin_isless(__type(__f1), __type(__f2)); 389 1.1.1.2 mrg } 390 1.1.1.2 mrg 391 1.1.1.2 mrg template<typename _Tp> 392 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 393 1.1.1.2 mrg int>::__type 394 1.1.1.2 mrg islessequal(_Tp __f1, _Tp __f2) 395 1.1.1.2 mrg { 396 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 397 1.1.1.2 mrg return __builtin_islessequal(__type(__f1), __type(__f2)); 398 1.1.1.2 mrg } 399 1.1.1.2 mrg 400 1.1.1.2 mrg template<typename _Tp> 401 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 402 1.1.1.2 mrg int>::__type 403 1.1.1.2 mrg islessgreater(_Tp __f1, _Tp __f2) 404 1.1.1.2 mrg { 405 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 406 1.1.1.2 mrg return __builtin_islessgreater(__type(__f1), __type(__f2)); 407 1.1.1.2 mrg } 408 1.1.1.2 mrg 409 1.1.1.2 mrg template<typename _Tp> 410 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, 411 1.1.1.2 mrg int>::__type 412 1.1.1.2 mrg isunordered(_Tp __f1, _Tp __f2) 413 1.1.1.2 mrg { 414 1.1.1.2 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 415 1.1.1.2 mrg return __builtin_isunordered(__type(__f1), __type(__f2)); 416 1.1.1.2 mrg } 417 1.1.1.2 mrg 418 1.1.1.2 mrg #endif 419 1.1.1.2 mrg #endif 420 1.1.1.2 mrg 421 1.1.1.2 mrg #if _GLIBCXX_USE_C99_MATH_TR1 422 1.1.1.2 mrg 423 1.1.1.5 mrg /** Additional overloads [8.16.4]. 424 1.1.1.5 mrg * @{ 425 1.1.1.5 mrg */ 426 1.1.1.5 mrg 427 1.1.1.5 mrg // For functions defined in C++03 the additional overloads are already 428 1.1.1.5 mrg // declared in <cmath> so we can just re-declare them in std::tr1. 429 1.1.1.5 mrg 430 1.1.1.2 mrg using std::acos; 431 1.1.1.5 mrg using std::asin; 432 1.1.1.5 mrg using std::atan; 433 1.1.1.5 mrg using std::atan2; 434 1.1.1.5 mrg using std::ceil; 435 1.1.1.5 mrg using std::cos; 436 1.1.1.5 mrg using std::cosh; 437 1.1.1.5 mrg using std::exp; 438 1.1.1.5 mrg using std::floor; 439 1.1.1.5 mrg using std::fmod; 440 1.1.1.5 mrg using std::frexp; 441 1.1.1.5 mrg using std::ldexp; 442 1.1.1.5 mrg using std::log; 443 1.1.1.5 mrg using std::log10; 444 1.1.1.5 mrg using std::sin; 445 1.1.1.5 mrg using std::sinh; 446 1.1.1.5 mrg using std::sqrt; 447 1.1.1.5 mrg using std::tan; 448 1.1.1.5 mrg using std::tanh; 449 1.1.1.5 mrg 450 1.1.1.5 mrg #if __cplusplus >= 201103L 451 1.1.1.5 mrg 452 1.1.1.5 mrg // Since C++11, <cmath> defines additional overloads for these functions 453 1.1.1.5 mrg // in namespace std. 454 1.1.1.5 mrg 455 1.1.1.5 mrg using std::acosh; 456 1.1.1.5 mrg using std::asinh; 457 1.1.1.5 mrg using std::atanh; 458 1.1.1.5 mrg using std::cbrt; 459 1.1.1.5 mrg using std::copysign; 460 1.1.1.5 mrg using std::erf; 461 1.1.1.5 mrg using std::erfc; 462 1.1.1.5 mrg using std::exp2; 463 1.1.1.5 mrg using std::expm1; 464 1.1.1.5 mrg using std::fdim; 465 1.1.1.5 mrg using std::fma; 466 1.1.1.5 mrg using std::fmax; 467 1.1.1.5 mrg using std::fmin; 468 1.1.1.5 mrg using std::hypot; 469 1.1.1.5 mrg using std::ilogb; 470 1.1.1.5 mrg using std::lgamma; 471 1.1.1.5 mrg using std::llrint; 472 1.1.1.5 mrg using std::llround; 473 1.1.1.5 mrg using std::log1p; 474 1.1.1.5 mrg using std::log2; 475 1.1.1.5 mrg using std::logb; 476 1.1.1.5 mrg using std::lrint; 477 1.1.1.5 mrg using std::lround; 478 1.1.1.5 mrg using std::nan; 479 1.1.1.5 mrg using std::nearbyint; 480 1.1.1.5 mrg using std::nextafter; 481 1.1.1.5 mrg using std::nexttoward; 482 1.1.1.5 mrg using std::remainder; 483 1.1.1.5 mrg using std::remquo; 484 1.1.1.5 mrg using std::rint; 485 1.1.1.5 mrg using std::round; 486 1.1.1.5 mrg using std::scalbln; 487 1.1.1.5 mrg using std::scalbn; 488 1.1.1.5 mrg using std::tgamma; 489 1.1.1.5 mrg using std::trunc; 490 1.1.1.2 mrg 491 1.1.1.5 mrg #else // __cplusplus < 201103L 492 1.1.1.5 mrg 493 1.1.1.5 mrg // In C++03 we need to provide the additional overloads. 494 1.1.1.5 mrg 495 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 496 1.1.1.2 mrg inline float 497 1.1.1.2 mrg acosh(float __x) 498 1.1.1.2 mrg { return __builtin_acoshf(__x); } 499 1.1.1.2 mrg 500 1.1.1.2 mrg inline long double 501 1.1.1.2 mrg acosh(long double __x) 502 1.1.1.2 mrg { return __builtin_acoshl(__x); } 503 1.1.1.3 mrg #endif 504 1.1.1.2 mrg 505 1.1.1.2 mrg template<typename _Tp> 506 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 507 1.1.1.2 mrg double>::__type 508 1.1.1.2 mrg acosh(_Tp __x) 509 1.1.1.2 mrg { return __builtin_acosh(__x); } 510 1.1.1.2 mrg 511 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 512 1.1.1.2 mrg inline float 513 1.1.1.2 mrg asinh(float __x) 514 1.1.1.2 mrg { return __builtin_asinhf(__x); } 515 1.1.1.2 mrg 516 1.1.1.2 mrg inline long double 517 1.1.1.2 mrg asinh(long double __x) 518 1.1.1.2 mrg { return __builtin_asinhl(__x); } 519 1.1.1.3 mrg #endif 520 1.1.1.2 mrg 521 1.1.1.2 mrg template<typename _Tp> 522 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 523 1.1.1.2 mrg double>::__type 524 1.1.1.2 mrg asinh(_Tp __x) 525 1.1.1.2 mrg { return __builtin_asinh(__x); } 526 1.1.1.2 mrg 527 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 528 1.1.1.2 mrg inline float 529 1.1.1.2 mrg atanh(float __x) 530 1.1.1.2 mrg { return __builtin_atanhf(__x); } 531 1.1.1.2 mrg 532 1.1.1.2 mrg inline long double 533 1.1.1.2 mrg atanh(long double __x) 534 1.1.1.2 mrg { return __builtin_atanhl(__x); } 535 1.1.1.3 mrg #endif 536 1.1.1.2 mrg 537 1.1.1.2 mrg template<typename _Tp> 538 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 539 1.1.1.2 mrg double>::__type 540 1.1.1.2 mrg atanh(_Tp __x) 541 1.1.1.2 mrg { return __builtin_atanh(__x); } 542 1.1.1.2 mrg 543 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 544 1.1.1.2 mrg inline float 545 1.1.1.2 mrg cbrt(float __x) 546 1.1.1.2 mrg { return __builtin_cbrtf(__x); } 547 1.1.1.2 mrg 548 1.1.1.2 mrg inline long double 549 1.1.1.2 mrg cbrt(long double __x) 550 1.1.1.2 mrg { return __builtin_cbrtl(__x); } 551 1.1.1.3 mrg #endif 552 1.1.1.2 mrg 553 1.1.1.2 mrg template<typename _Tp> 554 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 555 1.1.1.2 mrg double>::__type 556 1.1.1.2 mrg cbrt(_Tp __x) 557 1.1.1.2 mrg { return __builtin_cbrt(__x); } 558 1.1.1.2 mrg 559 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 560 1.1.1.2 mrg inline float 561 1.1.1.2 mrg copysign(float __x, float __y) 562 1.1.1.2 mrg { return __builtin_copysignf(__x, __y); } 563 1.1.1.2 mrg 564 1.1.1.2 mrg inline long double 565 1.1.1.2 mrg copysign(long double __x, long double __y) 566 1.1.1.2 mrg { return __builtin_copysignl(__x, __y); } 567 1.1.1.3 mrg #endif 568 1.1.1.2 mrg 569 1.1.1.2 mrg template<typename _Tp, typename _Up> 570 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 571 1.1.1.2 mrg copysign(_Tp __x, _Up __y) 572 1.1.1.2 mrg { 573 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 574 1.1.1.2 mrg return copysign(__type(__x), __type(__y)); 575 1.1.1.2 mrg } 576 1.1.1.2 mrg 577 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 578 1.1.1.2 mrg inline float 579 1.1.1.2 mrg erf(float __x) 580 1.1.1.2 mrg { return __builtin_erff(__x); } 581 1.1.1.2 mrg 582 1.1.1.2 mrg inline long double 583 1.1.1.2 mrg erf(long double __x) 584 1.1.1.2 mrg { return __builtin_erfl(__x); } 585 1.1.1.3 mrg #endif 586 1.1.1.2 mrg 587 1.1.1.2 mrg template<typename _Tp> 588 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 589 1.1.1.2 mrg double>::__type 590 1.1.1.2 mrg erf(_Tp __x) 591 1.1.1.2 mrg { return __builtin_erf(__x); } 592 1.1.1.2 mrg 593 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 594 1.1.1.2 mrg inline float 595 1.1.1.2 mrg erfc(float __x) 596 1.1.1.2 mrg { return __builtin_erfcf(__x); } 597 1.1.1.2 mrg 598 1.1.1.2 mrg inline long double 599 1.1.1.2 mrg erfc(long double __x) 600 1.1.1.2 mrg { return __builtin_erfcl(__x); } 601 1.1.1.3 mrg #endif 602 1.1.1.2 mrg 603 1.1.1.2 mrg template<typename _Tp> 604 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 605 1.1.1.2 mrg double>::__type 606 1.1.1.2 mrg erfc(_Tp __x) 607 1.1.1.2 mrg { return __builtin_erfc(__x); } 608 1.1.1.2 mrg 609 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 610 1.1.1.2 mrg inline float 611 1.1.1.2 mrg exp2(float __x) 612 1.1.1.2 mrg { return __builtin_exp2f(__x); } 613 1.1.1.2 mrg 614 1.1.1.2 mrg inline long double 615 1.1.1.2 mrg exp2(long double __x) 616 1.1.1.2 mrg { return __builtin_exp2l(__x); } 617 1.1.1.3 mrg #endif 618 1.1.1.2 mrg 619 1.1.1.2 mrg template<typename _Tp> 620 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 621 1.1.1.2 mrg double>::__type 622 1.1.1.2 mrg exp2(_Tp __x) 623 1.1.1.2 mrg { return __builtin_exp2(__x); } 624 1.1.1.2 mrg 625 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 626 1.1.1.2 mrg inline float 627 1.1.1.2 mrg expm1(float __x) 628 1.1.1.2 mrg { return __builtin_expm1f(__x); } 629 1.1.1.2 mrg 630 1.1.1.2 mrg inline long double 631 1.1.1.2 mrg expm1(long double __x) 632 1.1.1.2 mrg { return __builtin_expm1l(__x); } 633 1.1.1.3 mrg #endif 634 1.1.1.2 mrg 635 1.1.1.2 mrg template<typename _Tp> 636 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 637 1.1.1.2 mrg double>::__type 638 1.1.1.2 mrg expm1(_Tp __x) 639 1.1.1.2 mrg { return __builtin_expm1(__x); } 640 1.1.1.2 mrg 641 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 642 1.1.1.2 mrg inline float 643 1.1.1.2 mrg fdim(float __x, float __y) 644 1.1.1.2 mrg { return __builtin_fdimf(__x, __y); } 645 1.1.1.2 mrg 646 1.1.1.2 mrg inline long double 647 1.1.1.2 mrg fdim(long double __x, long double __y) 648 1.1.1.2 mrg { return __builtin_fdiml(__x, __y); } 649 1.1.1.3 mrg #endif 650 1.1.1.2 mrg 651 1.1.1.2 mrg template<typename _Tp, typename _Up> 652 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 653 1.1.1.2 mrg fdim(_Tp __x, _Up __y) 654 1.1.1.2 mrg { 655 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 656 1.1.1.2 mrg return fdim(__type(__x), __type(__y)); 657 1.1.1.2 mrg } 658 1.1.1.2 mrg 659 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 660 1.1.1.2 mrg inline float 661 1.1.1.2 mrg fma(float __x, float __y, float __z) 662 1.1.1.2 mrg { return __builtin_fmaf(__x, __y, __z); } 663 1.1.1.2 mrg 664 1.1.1.2 mrg inline long double 665 1.1.1.2 mrg fma(long double __x, long double __y, long double __z) 666 1.1.1.2 mrg { return __builtin_fmal(__x, __y, __z); } 667 1.1.1.3 mrg #endif 668 1.1.1.2 mrg 669 1.1.1.2 mrg template<typename _Tp, typename _Up, typename _Vp> 670 1.1.1.2 mrg inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type 671 1.1.1.2 mrg fma(_Tp __x, _Up __y, _Vp __z) 672 1.1.1.2 mrg { 673 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; 674 1.1.1.2 mrg return fma(__type(__x), __type(__y), __type(__z)); 675 1.1.1.2 mrg } 676 1.1.1.2 mrg 677 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 678 1.1.1.2 mrg inline float 679 1.1.1.2 mrg fmax(float __x, float __y) 680 1.1.1.2 mrg { return __builtin_fmaxf(__x, __y); } 681 1.1.1.2 mrg 682 1.1.1.2 mrg inline long double 683 1.1.1.2 mrg fmax(long double __x, long double __y) 684 1.1.1.2 mrg { return __builtin_fmaxl(__x, __y); } 685 1.1.1.3 mrg #endif 686 1.1.1.2 mrg 687 1.1.1.2 mrg template<typename _Tp, typename _Up> 688 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 689 1.1.1.2 mrg fmax(_Tp __x, _Up __y) 690 1.1.1.2 mrg { 691 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 692 1.1.1.2 mrg return fmax(__type(__x), __type(__y)); 693 1.1.1.2 mrg } 694 1.1.1.2 mrg 695 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 696 1.1.1.2 mrg inline float 697 1.1.1.2 mrg fmin(float __x, float __y) 698 1.1.1.2 mrg { return __builtin_fminf(__x, __y); } 699 1.1.1.2 mrg 700 1.1.1.2 mrg inline long double 701 1.1.1.2 mrg fmin(long double __x, long double __y) 702 1.1.1.2 mrg { return __builtin_fminl(__x, __y); } 703 1.1.1.3 mrg #endif 704 1.1.1.2 mrg 705 1.1.1.2 mrg template<typename _Tp, typename _Up> 706 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 707 1.1.1.2 mrg fmin(_Tp __x, _Up __y) 708 1.1.1.2 mrg { 709 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 710 1.1.1.2 mrg return fmin(__type(__x), __type(__y)); 711 1.1.1.2 mrg } 712 1.1.1.2 mrg 713 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 714 1.1.1.2 mrg inline float 715 1.1.1.2 mrg hypot(float __x, float __y) 716 1.1.1.2 mrg { return __builtin_hypotf(__x, __y); } 717 1.1.1.2 mrg 718 1.1.1.2 mrg inline long double 719 1.1.1.2 mrg hypot(long double __x, long double __y) 720 1.1.1.2 mrg { return __builtin_hypotl(__x, __y); } 721 1.1.1.3 mrg #endif 722 1.1.1.2 mrg 723 1.1.1.2 mrg template<typename _Tp, typename _Up> 724 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 725 1.1.1.2 mrg hypot(_Tp __y, _Up __x) 726 1.1.1.2 mrg { 727 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 728 1.1.1.2 mrg return hypot(__type(__y), __type(__x)); 729 1.1.1.2 mrg } 730 1.1.1.2 mrg 731 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 732 1.1.1.2 mrg inline int 733 1.1.1.2 mrg ilogb(float __x) 734 1.1.1.2 mrg { return __builtin_ilogbf(__x); } 735 1.1.1.2 mrg 736 1.1.1.2 mrg inline int 737 1.1.1.2 mrg ilogb(long double __x) 738 1.1.1.2 mrg { return __builtin_ilogbl(__x); } 739 1.1.1.3 mrg #endif 740 1.1.1.2 mrg 741 1.1.1.2 mrg template<typename _Tp> 742 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 743 1.1.1.2 mrg int>::__type 744 1.1.1.2 mrg ilogb(_Tp __x) 745 1.1.1.2 mrg { return __builtin_ilogb(__x); } 746 1.1.1.2 mrg 747 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 748 1.1.1.2 mrg inline float 749 1.1.1.2 mrg lgamma(float __x) 750 1.1.1.2 mrg { return __builtin_lgammaf(__x); } 751 1.1.1.2 mrg 752 1.1.1.2 mrg inline long double 753 1.1.1.2 mrg lgamma(long double __x) 754 1.1.1.2 mrg { return __builtin_lgammal(__x); } 755 1.1.1.3 mrg #endif 756 1.1.1.2 mrg 757 1.1.1.2 mrg template<typename _Tp> 758 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 759 1.1.1.2 mrg double>::__type 760 1.1.1.2 mrg lgamma(_Tp __x) 761 1.1.1.2 mrg { return __builtin_lgamma(__x); } 762 1.1.1.2 mrg 763 1.1.1.14 mrg #pragma GCC diagnostic push 764 1.1.1.14 mrg #pragma GCC diagnostic ignored "-Wlong-long" 765 1.1.1.14 mrg 766 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 767 1.1.1.2 mrg inline long long 768 1.1.1.2 mrg llrint(float __x) 769 1.1.1.2 mrg { return __builtin_llrintf(__x); } 770 1.1.1.2 mrg 771 1.1.1.2 mrg inline long long 772 1.1.1.2 mrg llrint(long double __x) 773 1.1.1.2 mrg { return __builtin_llrintl(__x); } 774 1.1.1.3 mrg #endif 775 1.1.1.2 mrg 776 1.1.1.2 mrg template<typename _Tp> 777 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 778 1.1.1.2 mrg long long>::__type 779 1.1.1.2 mrg llrint(_Tp __x) 780 1.1.1.2 mrg { return __builtin_llrint(__x); } 781 1.1.1.2 mrg 782 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 783 1.1.1.2 mrg inline long long 784 1.1.1.2 mrg llround(float __x) 785 1.1.1.2 mrg { return __builtin_llroundf(__x); } 786 1.1.1.2 mrg 787 1.1.1.2 mrg inline long long 788 1.1.1.2 mrg llround(long double __x) 789 1.1.1.2 mrg { return __builtin_llroundl(__x); } 790 1.1.1.3 mrg #endif 791 1.1.1.2 mrg 792 1.1.1.2 mrg template<typename _Tp> 793 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 794 1.1.1.2 mrg long long>::__type 795 1.1.1.2 mrg llround(_Tp __x) 796 1.1.1.2 mrg { return __builtin_llround(__x); } 797 1.1.1.14 mrg #pragma GCC diagnostic pop 798 1.1.1.2 mrg 799 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 800 1.1.1.2 mrg inline float 801 1.1.1.2 mrg log1p(float __x) 802 1.1.1.2 mrg { return __builtin_log1pf(__x); } 803 1.1.1.2 mrg 804 1.1.1.2 mrg inline long double 805 1.1.1.2 mrg log1p(long double __x) 806 1.1.1.2 mrg { return __builtin_log1pl(__x); } 807 1.1.1.3 mrg #endif 808 1.1.1.2 mrg 809 1.1.1.2 mrg template<typename _Tp> 810 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 811 1.1.1.2 mrg double>::__type 812 1.1.1.2 mrg log1p(_Tp __x) 813 1.1.1.2 mrg { return __builtin_log1p(__x); } 814 1.1.1.2 mrg 815 1.1.1.2 mrg // DR 568. 816 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 817 1.1.1.2 mrg inline float 818 1.1.1.2 mrg log2(float __x) 819 1.1.1.2 mrg { return __builtin_log2f(__x); } 820 1.1.1.2 mrg 821 1.1.1.2 mrg inline long double 822 1.1.1.2 mrg log2(long double __x) 823 1.1.1.2 mrg { return __builtin_log2l(__x); } 824 1.1.1.3 mrg #endif 825 1.1.1.2 mrg 826 1.1.1.2 mrg template<typename _Tp> 827 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 828 1.1.1.2 mrg double>::__type 829 1.1.1.2 mrg log2(_Tp __x) 830 1.1.1.2 mrg { return __builtin_log2(__x); } 831 1.1.1.2 mrg 832 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 833 1.1.1.2 mrg inline float 834 1.1.1.2 mrg logb(float __x) 835 1.1.1.2 mrg { return __builtin_logbf(__x); } 836 1.1.1.2 mrg 837 1.1.1.2 mrg inline long double 838 1.1.1.2 mrg logb(long double __x) 839 1.1.1.2 mrg { return __builtin_logbl(__x); } 840 1.1.1.3 mrg #endif 841 1.1.1.2 mrg 842 1.1.1.2 mrg template<typename _Tp> 843 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 844 1.1.1.2 mrg double>::__type 845 1.1.1.2 mrg logb(_Tp __x) 846 1.1.1.2 mrg { 847 1.1.1.2 mrg return __builtin_logb(__x); 848 1.1.1.2 mrg } 849 1.1.1.2 mrg 850 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 851 1.1.1.2 mrg inline long 852 1.1.1.2 mrg lrint(float __x) 853 1.1.1.2 mrg { return __builtin_lrintf(__x); } 854 1.1.1.2 mrg 855 1.1.1.2 mrg inline long 856 1.1.1.2 mrg lrint(long double __x) 857 1.1.1.2 mrg { return __builtin_lrintl(__x); } 858 1.1.1.3 mrg #endif 859 1.1.1.2 mrg 860 1.1.1.2 mrg template<typename _Tp> 861 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 862 1.1.1.2 mrg long>::__type 863 1.1.1.2 mrg lrint(_Tp __x) 864 1.1.1.2 mrg { return __builtin_lrint(__x); } 865 1.1.1.2 mrg 866 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 867 1.1.1.2 mrg inline long 868 1.1.1.2 mrg lround(float __x) 869 1.1.1.2 mrg { return __builtin_lroundf(__x); } 870 1.1.1.2 mrg 871 1.1.1.2 mrg inline long 872 1.1.1.2 mrg lround(long double __x) 873 1.1.1.2 mrg { return __builtin_lroundl(__x); } 874 1.1.1.3 mrg #endif 875 1.1.1.2 mrg 876 1.1.1.2 mrg template<typename _Tp> 877 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 878 1.1.1.2 mrg long>::__type 879 1.1.1.2 mrg lround(_Tp __x) 880 1.1.1.2 mrg { return __builtin_lround(__x); } 881 1.1.1.2 mrg 882 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 883 1.1.1.2 mrg inline float 884 1.1.1.2 mrg nearbyint(float __x) 885 1.1.1.2 mrg { return __builtin_nearbyintf(__x); } 886 1.1.1.2 mrg 887 1.1.1.2 mrg inline long double 888 1.1.1.2 mrg nearbyint(long double __x) 889 1.1.1.2 mrg { return __builtin_nearbyintl(__x); } 890 1.1.1.3 mrg #endif 891 1.1.1.2 mrg 892 1.1.1.2 mrg template<typename _Tp> 893 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 894 1.1.1.2 mrg double>::__type 895 1.1.1.2 mrg nearbyint(_Tp __x) 896 1.1.1.2 mrg { return __builtin_nearbyint(__x); } 897 1.1.1.2 mrg 898 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 899 1.1.1.2 mrg inline float 900 1.1.1.2 mrg nextafter(float __x, float __y) 901 1.1.1.2 mrg { return __builtin_nextafterf(__x, __y); } 902 1.1.1.2 mrg 903 1.1.1.2 mrg inline long double 904 1.1.1.2 mrg nextafter(long double __x, long double __y) 905 1.1.1.2 mrg { return __builtin_nextafterl(__x, __y); } 906 1.1.1.3 mrg #endif 907 1.1.1.2 mrg 908 1.1.1.2 mrg template<typename _Tp, typename _Up> 909 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 910 1.1.1.2 mrg nextafter(_Tp __x, _Up __y) 911 1.1.1.2 mrg { 912 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 913 1.1.1.2 mrg return nextafter(__type(__x), __type(__y)); 914 1.1.1.2 mrg } 915 1.1.1.2 mrg 916 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 917 1.1.1.2 mrg inline float 918 1.1.1.2 mrg nexttoward(float __x, long double __y) 919 1.1.1.2 mrg { return __builtin_nexttowardf(__x, __y); } 920 1.1.1.2 mrg 921 1.1.1.2 mrg inline long double 922 1.1.1.2 mrg nexttoward(long double __x, long double __y) 923 1.1.1.2 mrg { return __builtin_nexttowardl(__x, __y); } 924 1.1.1.3 mrg #endif 925 1.1.1.2 mrg 926 1.1.1.2 mrg template<typename _Tp> 927 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 928 1.1.1.2 mrg double>::__type 929 1.1.1.2 mrg nexttoward(_Tp __x, long double __y) 930 1.1.1.2 mrg { return __builtin_nexttoward(__x, __y); } 931 1.1.1.2 mrg 932 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 933 1.1.1.2 mrg inline float 934 1.1.1.2 mrg remainder(float __x, float __y) 935 1.1.1.2 mrg { return __builtin_remainderf(__x, __y); } 936 1.1.1.2 mrg 937 1.1.1.2 mrg inline long double 938 1.1.1.2 mrg remainder(long double __x, long double __y) 939 1.1.1.2 mrg { return __builtin_remainderl(__x, __y); } 940 1.1.1.3 mrg #endif 941 1.1.1.2 mrg 942 1.1.1.2 mrg template<typename _Tp, typename _Up> 943 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 944 1.1.1.2 mrg remainder(_Tp __x, _Up __y) 945 1.1.1.2 mrg { 946 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 947 1.1.1.2 mrg return remainder(__type(__x), __type(__y)); 948 1.1.1.2 mrg } 949 1.1.1.2 mrg 950 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 951 1.1.1.2 mrg inline float 952 1.1.1.2 mrg remquo(float __x, float __y, int* __pquo) 953 1.1.1.2 mrg { return __builtin_remquof(__x, __y, __pquo); } 954 1.1.1.2 mrg 955 1.1.1.2 mrg inline long double 956 1.1.1.2 mrg remquo(long double __x, long double __y, int* __pquo) 957 1.1.1.2 mrg { return __builtin_remquol(__x, __y, __pquo); } 958 1.1.1.3 mrg #endif 959 1.1.1.2 mrg 960 1.1.1.2 mrg template<typename _Tp, typename _Up> 961 1.1.1.2 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 962 1.1.1.2 mrg remquo(_Tp __x, _Up __y, int* __pquo) 963 1.1.1.2 mrg { 964 1.1.1.2 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 965 1.1.1.2 mrg return remquo(__type(__x), __type(__y), __pquo); 966 1.1.1.2 mrg } 967 1.1.1.2 mrg 968 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 969 1.1.1.2 mrg inline float 970 1.1.1.2 mrg rint(float __x) 971 1.1.1.2 mrg { return __builtin_rintf(__x); } 972 1.1.1.2 mrg 973 1.1.1.2 mrg inline long double 974 1.1.1.2 mrg rint(long double __x) 975 1.1.1.2 mrg { return __builtin_rintl(__x); } 976 1.1.1.3 mrg #endif 977 1.1.1.2 mrg 978 1.1.1.2 mrg template<typename _Tp> 979 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 980 1.1.1.2 mrg double>::__type 981 1.1.1.2 mrg rint(_Tp __x) 982 1.1.1.2 mrg { return __builtin_rint(__x); } 983 1.1.1.2 mrg 984 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 985 1.1.1.2 mrg inline float 986 1.1.1.2 mrg round(float __x) 987 1.1.1.2 mrg { return __builtin_roundf(__x); } 988 1.1.1.2 mrg 989 1.1.1.2 mrg inline long double 990 1.1.1.2 mrg round(long double __x) 991 1.1.1.2 mrg { return __builtin_roundl(__x); } 992 1.1.1.3 mrg #endif 993 1.1.1.2 mrg 994 1.1.1.2 mrg template<typename _Tp> 995 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 996 1.1.1.2 mrg double>::__type 997 1.1.1.2 mrg round(_Tp __x) 998 1.1.1.2 mrg { return __builtin_round(__x); } 999 1.1.1.2 mrg 1000 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1001 1.1.1.2 mrg inline float 1002 1.1.1.2 mrg scalbln(float __x, long __ex) 1003 1.1.1.2 mrg { return __builtin_scalblnf(__x, __ex); } 1004 1.1.1.2 mrg 1005 1.1.1.2 mrg inline long double 1006 1.1.1.2 mrg scalbln(long double __x, long __ex) 1007 1.1.1.2 mrg { return __builtin_scalblnl(__x, __ex); } 1008 1.1.1.3 mrg #endif 1009 1.1.1.2 mrg 1010 1.1.1.2 mrg template<typename _Tp> 1011 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1012 1.1.1.2 mrg double>::__type 1013 1.1.1.2 mrg scalbln(_Tp __x, long __ex) 1014 1.1.1.2 mrg { return __builtin_scalbln(__x, __ex); } 1015 1.1.1.2 mrg 1016 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1017 1.1.1.2 mrg inline float 1018 1.1.1.2 mrg scalbn(float __x, int __ex) 1019 1.1.1.2 mrg { return __builtin_scalbnf(__x, __ex); } 1020 1.1.1.2 mrg 1021 1.1.1.2 mrg inline long double 1022 1.1.1.2 mrg scalbn(long double __x, int __ex) 1023 1.1.1.2 mrg { return __builtin_scalbnl(__x, __ex); } 1024 1.1.1.3 mrg #endif 1025 1.1.1.2 mrg 1026 1.1.1.2 mrg template<typename _Tp> 1027 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1028 1.1.1.2 mrg double>::__type 1029 1.1.1.2 mrg scalbn(_Tp __x, int __ex) 1030 1.1.1.2 mrg { return __builtin_scalbn(__x, __ex); } 1031 1.1.1.2 mrg 1032 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1033 1.1.1.2 mrg inline float 1034 1.1.1.2 mrg tgamma(float __x) 1035 1.1.1.2 mrg { return __builtin_tgammaf(__x); } 1036 1.1.1.2 mrg 1037 1.1.1.2 mrg inline long double 1038 1.1.1.2 mrg tgamma(long double __x) 1039 1.1.1.2 mrg { return __builtin_tgammal(__x); } 1040 1.1.1.3 mrg #endif 1041 1.1.1.2 mrg 1042 1.1.1.2 mrg template<typename _Tp> 1043 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1044 1.1.1.2 mrg double>::__type 1045 1.1.1.2 mrg tgamma(_Tp __x) 1046 1.1.1.2 mrg { return __builtin_tgamma(__x); } 1047 1.1.1.2 mrg 1048 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1049 1.1.1.2 mrg inline float 1050 1.1.1.2 mrg trunc(float __x) 1051 1.1.1.2 mrg { return __builtin_truncf(__x); } 1052 1.1.1.2 mrg 1053 1.1.1.2 mrg inline long double 1054 1.1.1.2 mrg trunc(long double __x) 1055 1.1.1.2 mrg { return __builtin_truncl(__x); } 1056 1.1.1.3 mrg #endif 1057 1.1.1.2 mrg 1058 1.1.1.2 mrg template<typename _Tp> 1059 1.1.1.2 mrg inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 1060 1.1.1.2 mrg double>::__type 1061 1.1.1.2 mrg trunc(_Tp __x) 1062 1.1.1.2 mrg { return __builtin_trunc(__x); } 1063 1.1 mrg 1064 1.1.1.5 mrg #endif // __cplusplus < 201103L 1065 1.1.1.5 mrg 1066 1.1.1.12 mrg /// @} 1067 1.1.1.5 mrg 1068 1.1.1.9 mrg #endif /* _GLIBCXX_USE_C99_MATH_TR1 */ 1069 1.1.1.2 mrg 1070 1.1 mrg // DR 550. What should the return type of pow(float,int) be? 1071 1.1.1.5 mrg // NB: C++11 and TR1 != C++03. 1072 1.1 mrg 1073 1.1.1.5 mrg // We cannot do "using std::pow;" because that would bring in unwanted 1074 1.1.1.5 mrg // pow(*, int) overloads in C++03, with the wrong return type. Instead we 1075 1.1.1.5 mrg // define all the necessary overloads, but the std::tr1::pow(double, double) 1076 1.1.1.5 mrg // overload cannot be provided here, because <tr1/math.h> would add it to 1077 1.1.1.5 mrg // the global namespace where it would clash with ::pow(double,double) from 1078 1.1.1.5 mrg // libc (revealed by the fix of PR c++/54537). 1079 1.1.1.5 mrg // The solution is to forward std::tr1::pow(double,double) to 1080 1.1.1.5 mrg // std::pow(double,double) via the function template below. See 1081 1.1.1.3 mrg // the discussion about this issue here: 1082 1.1.1.3 mrg // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html 1083 1.1.1.3 mrg 1084 1.1.1.4 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1085 1.1 mrg inline float 1086 1.1 mrg pow(float __x, float __y) 1087 1.1 mrg { return std::pow(__x, __y); } 1088 1.1 mrg 1089 1.1 mrg inline long double 1090 1.1 mrg pow(long double __x, long double __y) 1091 1.1 mrg { return std::pow(__x, __y); } 1092 1.1.1.3 mrg #endif 1093 1.1 mrg 1094 1.1 mrg template<typename _Tp, typename _Up> 1095 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type 1096 1.1 mrg pow(_Tp __x, _Up __y) 1097 1.1 mrg { 1098 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; 1099 1.1 mrg return std::pow(__type(__x), __type(__y)); 1100 1.1 mrg } 1101 1.1.1.2 mrg 1102 1.1.1.5 mrg #if __cplusplus >= 201103L 1103 1.1.1.5 mrg // We also deal with fabs in a special way, because "using std::fabs;" 1104 1.1.1.5 mrg // could bring in C++11's std::fabs<T>(const std::complex<T>&) with a 1105 1.1.1.5 mrg // different return type from std::tr1::fabs<T>(const std::complex<T>&). 1106 1.1.1.5 mrg // We define the necessary overloads, except std::tr1::fabs(double) which 1107 1.1.1.5 mrg // could clash with ::fabs(double) from libc. 1108 1.1.1.5 mrg // The function template handles double as well as integers, forwarding 1109 1.1.1.5 mrg // to std::fabs. 1110 1.1.1.5 mrg 1111 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO 1112 1.1.1.5 mrg #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1113 1.1.1.5 mrg inline float 1114 1.1.1.5 mrg fabs(float __x) 1115 1.1.1.5 mrg { return __builtin_fabsf(__x); } 1116 1.1.1.5 mrg 1117 1.1.1.5 mrg inline long double 1118 1.1.1.5 mrg fabs(long double __x) 1119 1.1.1.5 mrg { return __builtin_fabsl(__x); } 1120 1.1.1.5 mrg #endif 1121 1.1.1.5 mrg #endif 1122 1.1.1.5 mrg 1123 1.1.1.5 mrg template<typename _Tp> 1124 1.1.1.5 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1125 1.1.1.5 mrg fabs(_Tp __x) 1126 1.1.1.5 mrg { return std::fabs(__x); } 1127 1.1.1.5 mrg 1128 1.1.1.5 mrg #else // ! C++11 1129 1.1.1.5 mrg 1130 1.1.1.5 mrg // For C++03 just use std::fabs as there is no overload for std::complex<>. 1131 1.1.1.5 mrg using std::fabs; 1132 1.1.1.5 mrg 1133 1.1.1.5 mrg #endif // C++11 1134 1.1.1.5 mrg 1135 1.1.1.11 mrg } // namespace tr1 1136 1.1.1.11 mrg _GLIBCXX_END_NAMESPACE_VERSION 1137 1.1.1.11 mrg } // namespace std 1138 1.1.1.11 mrg 1139 1.1.1.11 mrg /** 1140 1.1.1.11 mrg * @defgroup tr1_math_spec_func TR1 Mathematical Special Functions 1141 1.1.1.11 mrg * @ingroup numerics 1142 1.1.1.11 mrg * 1143 1.1.1.11 mrg * A collection of advanced mathematical special functions. 1144 1.1.1.11 mrg */ 1145 1.1.1.11 mrg 1146 1.1.1.6 mrg #if _GLIBCXX_USE_STD_SPEC_FUNCS 1147 1.1.1.5 mrg 1148 1.1.1.11 mrg namespace std _GLIBCXX_VISIBILITY(default) 1149 1.1.1.11 mrg { 1150 1.1.1.11 mrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 1151 1.1.1.5 mrg 1152 1.1.1.11 mrg namespace tr1 1153 1.1.1.11 mrg { 1154 1.1.1.5 mrg using std::assoc_laguerref; 1155 1.1.1.5 mrg using std::assoc_laguerrel; 1156 1.1.1.5 mrg using std::assoc_laguerre; 1157 1.1.1.5 mrg 1158 1.1.1.5 mrg using std::assoc_legendref; 1159 1.1.1.5 mrg using std::assoc_legendrel; 1160 1.1.1.5 mrg using std::assoc_legendre; 1161 1.1.1.5 mrg 1162 1.1.1.5 mrg using std::betaf; 1163 1.1.1.5 mrg using std::betal; 1164 1.1.1.5 mrg using std::beta; 1165 1.1.1.5 mrg 1166 1.1.1.5 mrg using std::comp_ellint_1f; 1167 1.1.1.5 mrg using std::comp_ellint_1l; 1168 1.1.1.5 mrg using std::comp_ellint_1; 1169 1.1.1.5 mrg 1170 1.1.1.5 mrg using std::comp_ellint_2f; 1171 1.1.1.5 mrg using std::comp_ellint_2l; 1172 1.1.1.5 mrg using std::comp_ellint_2; 1173 1.1.1.5 mrg 1174 1.1.1.5 mrg using std::comp_ellint_3f; 1175 1.1.1.5 mrg using std::comp_ellint_3l; 1176 1.1.1.5 mrg using std::comp_ellint_3; 1177 1.1.1.5 mrg 1178 1.1.1.5 mrg using std::cyl_bessel_if; 1179 1.1.1.5 mrg using std::cyl_bessel_il; 1180 1.1.1.5 mrg using std::cyl_bessel_i; 1181 1.1.1.5 mrg 1182 1.1.1.5 mrg using std::cyl_bessel_jf; 1183 1.1.1.5 mrg using std::cyl_bessel_jl; 1184 1.1.1.5 mrg using std::cyl_bessel_j; 1185 1.1.1.5 mrg 1186 1.1.1.5 mrg using std::cyl_bessel_kf; 1187 1.1.1.5 mrg using std::cyl_bessel_kl; 1188 1.1.1.5 mrg using std::cyl_bessel_k; 1189 1.1.1.5 mrg 1190 1.1.1.5 mrg using std::cyl_neumannf; 1191 1.1.1.5 mrg using std::cyl_neumannl; 1192 1.1.1.5 mrg using std::cyl_neumann; 1193 1.1.1.5 mrg 1194 1.1.1.5 mrg using std::ellint_1f; 1195 1.1.1.5 mrg using std::ellint_1l; 1196 1.1.1.5 mrg using std::ellint_1; 1197 1.1.1.5 mrg 1198 1.1.1.5 mrg using std::ellint_2f; 1199 1.1.1.5 mrg using std::ellint_2l; 1200 1.1.1.5 mrg using std::ellint_2; 1201 1.1.1.5 mrg 1202 1.1.1.5 mrg using std::ellint_3f; 1203 1.1.1.5 mrg using std::ellint_3l; 1204 1.1.1.5 mrg using std::ellint_3; 1205 1.1.1.5 mrg 1206 1.1.1.5 mrg using std::expintf; 1207 1.1.1.5 mrg using std::expintl; 1208 1.1.1.5 mrg using std::expint; 1209 1.1.1.5 mrg 1210 1.1.1.5 mrg using std::hermitef; 1211 1.1.1.5 mrg using std::hermitel; 1212 1.1.1.5 mrg using std::hermite; 1213 1.1.1.5 mrg 1214 1.1.1.5 mrg using std::laguerref; 1215 1.1.1.5 mrg using std::laguerrel; 1216 1.1.1.5 mrg using std::laguerre; 1217 1.1.1.5 mrg 1218 1.1.1.5 mrg using std::legendref; 1219 1.1.1.5 mrg using std::legendrel; 1220 1.1.1.5 mrg using std::legendre; 1221 1.1.1.5 mrg 1222 1.1.1.5 mrg using std::riemann_zetaf; 1223 1.1.1.5 mrg using std::riemann_zetal; 1224 1.1.1.5 mrg using std::riemann_zeta; 1225 1.1.1.5 mrg 1226 1.1.1.5 mrg using std::sph_besself; 1227 1.1.1.5 mrg using std::sph_bessell; 1228 1.1.1.5 mrg using std::sph_bessel; 1229 1.1.1.5 mrg 1230 1.1.1.5 mrg using std::sph_legendref; 1231 1.1.1.5 mrg using std::sph_legendrel; 1232 1.1.1.5 mrg using std::sph_legendre; 1233 1.1.1.5 mrg 1234 1.1.1.5 mrg using std::sph_neumannf; 1235 1.1.1.5 mrg using std::sph_neumannl; 1236 1.1.1.5 mrg using std::sph_neumann; 1237 1.1.1.5 mrg 1238 1.1.1.9 mrg } // namespace tr1 1239 1.1.1.9 mrg _GLIBCXX_END_NAMESPACE_VERSION 1240 1.1.1.9 mrg } // namespace std 1241 1.1.1.9 mrg 1242 1.1.1.11 mrg #else // ! _GLIBCXX_USE_STD_SPEC_FUNCS 1243 1.1.1.11 mrg 1244 1.1 mrg #include <bits/stl_algobase.h> 1245 1.1 mrg #include <limits> 1246 1.1 mrg #include <tr1/type_traits> 1247 1.1 mrg 1248 1.1 mrg #include <tr1/gamma.tcc> 1249 1.1 mrg #include <tr1/bessel_function.tcc> 1250 1.1 mrg #include <tr1/beta_function.tcc> 1251 1.1 mrg #include <tr1/ell_integral.tcc> 1252 1.1 mrg #include <tr1/exp_integral.tcc> 1253 1.1 mrg #include <tr1/legendre_function.tcc> 1254 1.1 mrg #include <tr1/modified_bessel_func.tcc> 1255 1.1 mrg #include <tr1/poly_hermite.tcc> 1256 1.1 mrg #include <tr1/poly_laguerre.tcc> 1257 1.1 mrg #include <tr1/riemann_zeta.tcc> 1258 1.1 mrg 1259 1.1.1.2 mrg namespace std _GLIBCXX_VISIBILITY(default) 1260 1.1 mrg { 1261 1.1.1.8 mrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 1262 1.1.1.9 mrg namespace tr1 1263 1.1.1.11 mrg { 1264 1.1.1.11 mrg /** @addtogroup tr1_math_spec_func 1265 1.1.1.11 mrg * @{ 1266 1.1 mrg */ 1267 1.1 mrg 1268 1.1 mrg inline float 1269 1.1 mrg assoc_laguerref(unsigned int __n, unsigned int __m, float __x) 1270 1.1 mrg { return __detail::__assoc_laguerre<float>(__n, __m, __x); } 1271 1.1 mrg 1272 1.1 mrg inline long double 1273 1.1 mrg assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x) 1274 1.1 mrg { 1275 1.1 mrg return __detail::__assoc_laguerre<long double>(__n, __m, __x); 1276 1.1 mrg } 1277 1.1 mrg 1278 1.1 mrg /// 5.2.1.1 Associated Laguerre polynomials. 1279 1.1 mrg template<typename _Tp> 1280 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1281 1.1 mrg assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x) 1282 1.1 mrg { 1283 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1284 1.1 mrg return __detail::__assoc_laguerre<__type>(__n, __m, __x); 1285 1.1 mrg } 1286 1.1 mrg 1287 1.1 mrg inline float 1288 1.1 mrg assoc_legendref(unsigned int __l, unsigned int __m, float __x) 1289 1.1 mrg { return __detail::__assoc_legendre_p<float>(__l, __m, __x); } 1290 1.1 mrg 1291 1.1 mrg inline long double 1292 1.1 mrg assoc_legendrel(unsigned int __l, unsigned int __m, long double __x) 1293 1.1 mrg { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); } 1294 1.1 mrg 1295 1.1 mrg /// 5.2.1.2 Associated Legendre functions. 1296 1.1 mrg template<typename _Tp> 1297 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1298 1.1 mrg assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x) 1299 1.1 mrg { 1300 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1301 1.1 mrg return __detail::__assoc_legendre_p<__type>(__l, __m, __x); 1302 1.1 mrg } 1303 1.1 mrg 1304 1.1 mrg inline float 1305 1.1 mrg betaf(float __x, float __y) 1306 1.1 mrg { return __detail::__beta<float>(__x, __y); } 1307 1.1 mrg 1308 1.1 mrg inline long double 1309 1.1 mrg betal(long double __x, long double __y) 1310 1.1 mrg { return __detail::__beta<long double>(__x, __y); } 1311 1.1 mrg 1312 1.1 mrg /// 5.2.1.3 Beta functions. 1313 1.1 mrg template<typename _Tpx, typename _Tpy> 1314 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type 1315 1.1 mrg beta(_Tpx __x, _Tpy __y) 1316 1.1 mrg { 1317 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type; 1318 1.1 mrg return __detail::__beta<__type>(__x, __y); 1319 1.1 mrg } 1320 1.1 mrg 1321 1.1 mrg inline float 1322 1.1 mrg comp_ellint_1f(float __k) 1323 1.1 mrg { return __detail::__comp_ellint_1<float>(__k); } 1324 1.1 mrg 1325 1.1 mrg inline long double 1326 1.1 mrg comp_ellint_1l(long double __k) 1327 1.1 mrg { return __detail::__comp_ellint_1<long double>(__k); } 1328 1.1 mrg 1329 1.1 mrg /// 5.2.1.4 Complete elliptic integrals of the first kind. 1330 1.1 mrg template<typename _Tp> 1331 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1332 1.1 mrg comp_ellint_1(_Tp __k) 1333 1.1 mrg { 1334 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1335 1.1 mrg return __detail::__comp_ellint_1<__type>(__k); 1336 1.1 mrg } 1337 1.1 mrg 1338 1.1 mrg inline float 1339 1.1 mrg comp_ellint_2f(float __k) 1340 1.1 mrg { return __detail::__comp_ellint_2<float>(__k); } 1341 1.1 mrg 1342 1.1 mrg inline long double 1343 1.1 mrg comp_ellint_2l(long double __k) 1344 1.1 mrg { return __detail::__comp_ellint_2<long double>(__k); } 1345 1.1 mrg 1346 1.1 mrg /// 5.2.1.5 Complete elliptic integrals of the second kind. 1347 1.1 mrg template<typename _Tp> 1348 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1349 1.1 mrg comp_ellint_2(_Tp __k) 1350 1.1 mrg { 1351 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1352 1.1 mrg return __detail::__comp_ellint_2<__type>(__k); 1353 1.1 mrg } 1354 1.1 mrg 1355 1.1 mrg inline float 1356 1.1 mrg comp_ellint_3f(float __k, float __nu) 1357 1.1 mrg { return __detail::__comp_ellint_3<float>(__k, __nu); } 1358 1.1 mrg 1359 1.1 mrg inline long double 1360 1.1 mrg comp_ellint_3l(long double __k, long double __nu) 1361 1.1 mrg { return __detail::__comp_ellint_3<long double>(__k, __nu); } 1362 1.1 mrg 1363 1.1 mrg /// 5.2.1.6 Complete elliptic integrals of the third kind. 1364 1.1 mrg template<typename _Tp, typename _Tpn> 1365 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type 1366 1.1 mrg comp_ellint_3(_Tp __k, _Tpn __nu) 1367 1.1 mrg { 1368 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type; 1369 1.1 mrg return __detail::__comp_ellint_3<__type>(__k, __nu); 1370 1.1 mrg } 1371 1.1 mrg 1372 1.1 mrg inline float 1373 1.1 mrg cyl_bessel_if(float __nu, float __x) 1374 1.1 mrg { return __detail::__cyl_bessel_i<float>(__nu, __x); } 1375 1.1 mrg 1376 1.1 mrg inline long double 1377 1.1 mrg cyl_bessel_il(long double __nu, long double __x) 1378 1.1 mrg { return __detail::__cyl_bessel_i<long double>(__nu, __x); } 1379 1.1 mrg 1380 1.1 mrg /// 5.2.1.8 Regular modified cylindrical Bessel functions. 1381 1.1 mrg template<typename _Tpnu, typename _Tp> 1382 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 1383 1.1 mrg cyl_bessel_i(_Tpnu __nu, _Tp __x) 1384 1.1 mrg { 1385 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 1386 1.1 mrg return __detail::__cyl_bessel_i<__type>(__nu, __x); 1387 1.1 mrg } 1388 1.1 mrg 1389 1.1 mrg inline float 1390 1.1 mrg cyl_bessel_jf(float __nu, float __x) 1391 1.1 mrg { return __detail::__cyl_bessel_j<float>(__nu, __x); } 1392 1.1 mrg 1393 1.1 mrg inline long double 1394 1.1 mrg cyl_bessel_jl(long double __nu, long double __x) 1395 1.1 mrg { return __detail::__cyl_bessel_j<long double>(__nu, __x); } 1396 1.1 mrg 1397 1.1 mrg /// 5.2.1.9 Cylindrical Bessel functions (of the first kind). 1398 1.1 mrg template<typename _Tpnu, typename _Tp> 1399 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 1400 1.1 mrg cyl_bessel_j(_Tpnu __nu, _Tp __x) 1401 1.1 mrg { 1402 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 1403 1.1 mrg return __detail::__cyl_bessel_j<__type>(__nu, __x); 1404 1.1 mrg } 1405 1.1 mrg 1406 1.1 mrg inline float 1407 1.1 mrg cyl_bessel_kf(float __nu, float __x) 1408 1.1 mrg { return __detail::__cyl_bessel_k<float>(__nu, __x); } 1409 1.1 mrg 1410 1.1 mrg inline long double 1411 1.1 mrg cyl_bessel_kl(long double __nu, long double __x) 1412 1.1 mrg { return __detail::__cyl_bessel_k<long double>(__nu, __x); } 1413 1.1 mrg 1414 1.1 mrg /// 5.2.1.10 Irregular modified cylindrical Bessel functions. 1415 1.1 mrg template<typename _Tpnu, typename _Tp> 1416 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 1417 1.1 mrg cyl_bessel_k(_Tpnu __nu, _Tp __x) 1418 1.1 mrg { 1419 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 1420 1.1 mrg return __detail::__cyl_bessel_k<__type>(__nu, __x); 1421 1.1 mrg } 1422 1.1 mrg 1423 1.1 mrg inline float 1424 1.1 mrg cyl_neumannf(float __nu, float __x) 1425 1.1 mrg { return __detail::__cyl_neumann_n<float>(__nu, __x); } 1426 1.1 mrg 1427 1.1 mrg inline long double 1428 1.1 mrg cyl_neumannl(long double __nu, long double __x) 1429 1.1 mrg { return __detail::__cyl_neumann_n<long double>(__nu, __x); } 1430 1.1 mrg 1431 1.1 mrg /// 5.2.1.11 Cylindrical Neumann functions. 1432 1.1 mrg template<typename _Tpnu, typename _Tp> 1433 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type 1434 1.1 mrg cyl_neumann(_Tpnu __nu, _Tp __x) 1435 1.1 mrg { 1436 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type; 1437 1.1 mrg return __detail::__cyl_neumann_n<__type>(__nu, __x); 1438 1.1 mrg } 1439 1.1 mrg 1440 1.1 mrg inline float 1441 1.1 mrg ellint_1f(float __k, float __phi) 1442 1.1 mrg { return __detail::__ellint_1<float>(__k, __phi); } 1443 1.1 mrg 1444 1.1 mrg inline long double 1445 1.1 mrg ellint_1l(long double __k, long double __phi) 1446 1.1 mrg { return __detail::__ellint_1<long double>(__k, __phi); } 1447 1.1 mrg 1448 1.1 mrg /// 5.2.1.12 Incomplete elliptic integrals of the first kind. 1449 1.1 mrg template<typename _Tp, typename _Tpp> 1450 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type 1451 1.1 mrg ellint_1(_Tp __k, _Tpp __phi) 1452 1.1 mrg { 1453 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type; 1454 1.1 mrg return __detail::__ellint_1<__type>(__k, __phi); 1455 1.1 mrg } 1456 1.1 mrg 1457 1.1 mrg inline float 1458 1.1 mrg ellint_2f(float __k, float __phi) 1459 1.1 mrg { return __detail::__ellint_2<float>(__k, __phi); } 1460 1.1 mrg 1461 1.1 mrg inline long double 1462 1.1 mrg ellint_2l(long double __k, long double __phi) 1463 1.1 mrg { return __detail::__ellint_2<long double>(__k, __phi); } 1464 1.1 mrg 1465 1.1 mrg /// 5.2.1.13 Incomplete elliptic integrals of the second kind. 1466 1.1 mrg template<typename _Tp, typename _Tpp> 1467 1.1 mrg inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type 1468 1.1 mrg ellint_2(_Tp __k, _Tpp __phi) 1469 1.1 mrg { 1470 1.1 mrg typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type; 1471 1.1 mrg return __detail::__ellint_2<__type>(__k, __phi); 1472 1.1 mrg } 1473 1.1 mrg 1474 1.1 mrg inline float 1475 1.1 mrg ellint_3f(float __k, float __nu, float __phi) 1476 1.1 mrg { return __detail::__ellint_3<float>(__k, __nu, __phi); } 1477 1.1 mrg 1478 1.1 mrg inline long double 1479 1.1 mrg ellint_3l(long double __k, long double __nu, long double __phi) 1480 1.1 mrg { return __detail::__ellint_3<long double>(__k, __nu, __phi); } 1481 1.1 mrg 1482 1.1 mrg /// 5.2.1.14 Incomplete elliptic integrals of the third kind. 1483 1.1 mrg template<typename _Tp, typename _Tpn, typename _Tpp> 1484 1.1 mrg inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type 1485 1.1 mrg ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi) 1486 1.1 mrg { 1487 1.1 mrg typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type; 1488 1.1 mrg return __detail::__ellint_3<__type>(__k, __nu, __phi); 1489 1.1 mrg } 1490 1.1 mrg 1491 1.1 mrg inline float 1492 1.1 mrg expintf(float __x) 1493 1.1 mrg { return __detail::__expint<float>(__x); } 1494 1.1 mrg 1495 1.1 mrg inline long double 1496 1.1 mrg expintl(long double __x) 1497 1.1 mrg { return __detail::__expint<long double>(__x); } 1498 1.1 mrg 1499 1.1 mrg /// 5.2.1.15 Exponential integrals. 1500 1.1 mrg template<typename _Tp> 1501 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1502 1.1 mrg expint(_Tp __x) 1503 1.1 mrg { 1504 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1505 1.1 mrg return __detail::__expint<__type>(__x); 1506 1.1 mrg } 1507 1.1 mrg 1508 1.1 mrg inline float 1509 1.1 mrg hermitef(unsigned int __n, float __x) 1510 1.1 mrg { return __detail::__poly_hermite<float>(__n, __x); } 1511 1.1 mrg 1512 1.1 mrg inline long double 1513 1.1 mrg hermitel(unsigned int __n, long double __x) 1514 1.1 mrg { return __detail::__poly_hermite<long double>(__n, __x); } 1515 1.1 mrg 1516 1.1 mrg /// 5.2.1.16 Hermite polynomials. 1517 1.1 mrg template<typename _Tp> 1518 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1519 1.1 mrg hermite(unsigned int __n, _Tp __x) 1520 1.1 mrg { 1521 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1522 1.1 mrg return __detail::__poly_hermite<__type>(__n, __x); 1523 1.1 mrg } 1524 1.1 mrg 1525 1.1 mrg inline float 1526 1.1 mrg laguerref(unsigned int __n, float __x) 1527 1.1 mrg { return __detail::__laguerre<float>(__n, __x); } 1528 1.1 mrg 1529 1.1 mrg inline long double 1530 1.1 mrg laguerrel(unsigned int __n, long double __x) 1531 1.1 mrg { return __detail::__laguerre<long double>(__n, __x); } 1532 1.1 mrg 1533 1.1 mrg /// 5.2.1.18 Laguerre polynomials. 1534 1.1 mrg template<typename _Tp> 1535 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1536 1.1 mrg laguerre(unsigned int __n, _Tp __x) 1537 1.1 mrg { 1538 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1539 1.1 mrg return __detail::__laguerre<__type>(__n, __x); 1540 1.1 mrg } 1541 1.1 mrg 1542 1.1 mrg inline float 1543 1.1 mrg legendref(unsigned int __n, float __x) 1544 1.1 mrg { return __detail::__poly_legendre_p<float>(__n, __x); } 1545 1.1 mrg 1546 1.1 mrg inline long double 1547 1.1 mrg legendrel(unsigned int __n, long double __x) 1548 1.1 mrg { return __detail::__poly_legendre_p<long double>(__n, __x); } 1549 1.1 mrg 1550 1.1 mrg /// 5.2.1.19 Legendre polynomials. 1551 1.1 mrg template<typename _Tp> 1552 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1553 1.1 mrg legendre(unsigned int __n, _Tp __x) 1554 1.1 mrg { 1555 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1556 1.1 mrg return __detail::__poly_legendre_p<__type>(__n, __x); 1557 1.1 mrg } 1558 1.1 mrg 1559 1.1 mrg inline float 1560 1.1 mrg riemann_zetaf(float __x) 1561 1.1 mrg { return __detail::__riemann_zeta<float>(__x); } 1562 1.1 mrg 1563 1.1 mrg inline long double 1564 1.1 mrg riemann_zetal(long double __x) 1565 1.1 mrg { return __detail::__riemann_zeta<long double>(__x); } 1566 1.1 mrg 1567 1.1 mrg /// 5.2.1.20 Riemann zeta function. 1568 1.1 mrg template<typename _Tp> 1569 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1570 1.1 mrg riemann_zeta(_Tp __x) 1571 1.1 mrg { 1572 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1573 1.1 mrg return __detail::__riemann_zeta<__type>(__x); 1574 1.1 mrg } 1575 1.1 mrg 1576 1.1 mrg inline float 1577 1.1 mrg sph_besself(unsigned int __n, float __x) 1578 1.1 mrg { return __detail::__sph_bessel<float>(__n, __x); } 1579 1.1 mrg 1580 1.1 mrg inline long double 1581 1.1 mrg sph_bessell(unsigned int __n, long double __x) 1582 1.1 mrg { return __detail::__sph_bessel<long double>(__n, __x); } 1583 1.1 mrg 1584 1.1 mrg /// 5.2.1.21 Spherical Bessel functions. 1585 1.1 mrg template<typename _Tp> 1586 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1587 1.1 mrg sph_bessel(unsigned int __n, _Tp __x) 1588 1.1 mrg { 1589 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1590 1.1 mrg return __detail::__sph_bessel<__type>(__n, __x); 1591 1.1 mrg } 1592 1.1 mrg 1593 1.1 mrg inline float 1594 1.1 mrg sph_legendref(unsigned int __l, unsigned int __m, float __theta) 1595 1.1 mrg { return __detail::__sph_legendre<float>(__l, __m, __theta); } 1596 1.1 mrg 1597 1.1 mrg inline long double 1598 1.1 mrg sph_legendrel(unsigned int __l, unsigned int __m, long double __theta) 1599 1.1 mrg { return __detail::__sph_legendre<long double>(__l, __m, __theta); } 1600 1.1 mrg 1601 1.1 mrg /// 5.2.1.22 Spherical associated Legendre functions. 1602 1.1 mrg template<typename _Tp> 1603 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1604 1.1 mrg sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta) 1605 1.1 mrg { 1606 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1607 1.1 mrg return __detail::__sph_legendre<__type>(__l, __m, __theta); 1608 1.1 mrg } 1609 1.1 mrg 1610 1.1 mrg inline float 1611 1.1 mrg sph_neumannf(unsigned int __n, float __x) 1612 1.1 mrg { return __detail::__sph_neumann<float>(__n, __x); } 1613 1.1 mrg 1614 1.1 mrg inline long double 1615 1.1 mrg sph_neumannl(unsigned int __n, long double __x) 1616 1.1 mrg { return __detail::__sph_neumann<long double>(__n, __x); } 1617 1.1 mrg 1618 1.1 mrg /// 5.2.1.23 Spherical Neumann functions. 1619 1.1 mrg template<typename _Tp> 1620 1.1 mrg inline typename __gnu_cxx::__promote<_Tp>::__type 1621 1.1 mrg sph_neumann(unsigned int __n, _Tp __x) 1622 1.1 mrg { 1623 1.1 mrg typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 1624 1.1 mrg return __detail::__sph_neumann<__type>(__n, __x); 1625 1.1 mrg } 1626 1.1 mrg 1627 1.1.1.12 mrg /// @} tr1_math_spec_func 1628 1.1.1.7 mrg 1629 1.1.1.9 mrg } // namespace tr1 1630 1.1.1.9 mrg 1631 1.1.1.9 mrg _GLIBCXX_END_NAMESPACE_VERSION 1632 1.1.1.9 mrg } // namespace std 1633 1.1.1.9 mrg 1634 1.1.1.11 mrg #endif // _GLIBCXX_USE_STD_SPEC_FUNCS 1635 1.1.1.11 mrg 1636 1.1.1.9 mrg #if _GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__) 1637 1.1.1.9 mrg namespace std _GLIBCXX_VISIBILITY(default) 1638 1.1.1.9 mrg { 1639 1.1.1.9 mrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 1640 1.1.1.9 mrg 1641 1.1.1.9 mrg namespace tr1 1642 1.1.1.9 mrg { 1643 1.1.1.9 mrg using __gnu_cxx::conf_hypergf; 1644 1.1.1.9 mrg using __gnu_cxx::conf_hypergl; 1645 1.1.1.9 mrg using __gnu_cxx::conf_hyperg; 1646 1.1.1.9 mrg 1647 1.1.1.9 mrg using __gnu_cxx::hypergf; 1648 1.1.1.9 mrg using __gnu_cxx::hypergl; 1649 1.1.1.9 mrg using __gnu_cxx::hyperg; 1650 1.1.1.9 mrg } // namespace tr1 1651 1.1.1.9 mrg 1652 1.1.1.9 mrg _GLIBCXX_END_NAMESPACE_VERSION 1653 1.1.1.9 mrg } // namespace std 1654 1.1.1.9 mrg 1655 1.1.1.9 mrg #else // ! (_GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__)) 1656 1.1.1.9 mrg 1657 1.1.1.9 mrg #include <bits/stl_algobase.h> 1658 1.1.1.9 mrg #include <limits> 1659 1.1.1.9 mrg #include <tr1/type_traits> 1660 1.1.1.9 mrg 1661 1.1.1.9 mrg #include <tr1/hypergeometric.tcc> 1662 1.1.1.9 mrg 1663 1.1.1.9 mrg namespace std _GLIBCXX_VISIBILITY(default) 1664 1.1.1.9 mrg { 1665 1.1.1.9 mrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 1666 1.1.1.9 mrg 1667 1.1.1.9 mrg namespace tr1 1668 1.1.1.9 mrg { 1669 1.1.1.11 mrg /** @addtogroup tr1_math_spec_func 1670 1.1.1.11 mrg * @{ 1671 1.1.1.11 mrg */ 1672 1.1.1.11 mrg 1673 1.1.1.9 mrg inline float 1674 1.1.1.9 mrg conf_hypergf(float __a, float __c, float __x) 1675 1.1.1.9 mrg { return __detail::__conf_hyperg<float>(__a, __c, __x); } 1676 1.1.1.9 mrg 1677 1.1.1.9 mrg inline long double 1678 1.1.1.9 mrg conf_hypergl(long double __a, long double __c, long double __x) 1679 1.1.1.9 mrg { return __detail::__conf_hyperg<long double>(__a, __c, __x); } 1680 1.1.1.9 mrg 1681 1.1.1.9 mrg /// 5.2.1.7 Confluent hypergeometric functions. 1682 1.1.1.9 mrg template<typename _Tpa, typename _Tpc, typename _Tp> 1683 1.1.1.9 mrg inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type 1684 1.1.1.9 mrg conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x) 1685 1.1.1.9 mrg { 1686 1.1.1.9 mrg typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type; 1687 1.1.1.9 mrg return __detail::__conf_hyperg<__type>(__a, __c, __x); 1688 1.1.1.9 mrg } 1689 1.1.1.9 mrg 1690 1.1.1.9 mrg inline float 1691 1.1.1.9 mrg hypergf(float __a, float __b, float __c, float __x) 1692 1.1.1.9 mrg { return __detail::__hyperg<float>(__a, __b, __c, __x); } 1693 1.1.1.9 mrg 1694 1.1.1.9 mrg inline long double 1695 1.1.1.9 mrg hypergl(long double __a, long double __b, long double __c, long double __x) 1696 1.1.1.9 mrg { return __detail::__hyperg<long double>(__a, __b, __c, __x); } 1697 1.1.1.9 mrg 1698 1.1.1.9 mrg /// 5.2.1.17 Hypergeometric functions. 1699 1.1.1.9 mrg template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp> 1700 1.1.1.9 mrg inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type 1701 1.1.1.9 mrg hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x) 1702 1.1.1.9 mrg { 1703 1.1.1.9 mrg typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type; 1704 1.1.1.9 mrg return __detail::__hyperg<__type>(__a, __b, __c, __x); 1705 1.1.1.9 mrg } 1706 1.1.1.9 mrg 1707 1.1.1.12 mrg /// @} tr1_math_spec_func 1708 1.1.1.11 mrg 1709 1.1.1.9 mrg } // namespace tr1 1710 1.1.1.9 mrg 1711 1.1.1.9 mrg _GLIBCXX_END_NAMESPACE_VERSION 1712 1.1.1.9 mrg } // namespace std 1713 1.1.1.9 mrg #endif // _GLIBCXX_USE_STD_SPEC_FUNCS && !defined(__STRICT_ANSI__) 1714 1.1.1.9 mrg 1715 1.1 mrg #endif // _GLIBCXX_TR1_CMATH 1716