- tmp/tmp2oyjsq7i/{from.md → to.md} +219 -360
tmp/tmp2oyjsq7i/{from.md → to.md}
RENAMED
|
@@ -27,600 +27,457 @@ namespace std {
|
|
| 27 |
#define MATH_ERREXCEPT see below
|
| 28 |
|
| 29 |
#define math_errhandling see below
|
| 30 |
|
| 31 |
namespace std {
|
| 32 |
-
|
| 33 |
-
double acos(double x);
|
| 34 |
-
long double acos(long double x); // see [library.c]
|
| 35 |
float acosf(float x);
|
| 36 |
long double acosl(long double x);
|
| 37 |
|
| 38 |
-
|
| 39 |
-
double asin(double x);
|
| 40 |
-
long double asin(long double x); // see [library.c]
|
| 41 |
float asinf(float x);
|
| 42 |
long double asinl(long double x);
|
| 43 |
|
| 44 |
-
|
| 45 |
-
double atan(double x);
|
| 46 |
-
long double atan(long double x); // see [library.c]
|
| 47 |
float atanf(float x);
|
| 48 |
long double atanl(long double x);
|
| 49 |
|
| 50 |
-
|
| 51 |
-
double atan2(double y, double x);
|
| 52 |
-
long double atan2(long double y, long double x); // see [library.c]
|
| 53 |
float atan2f(float y, float x);
|
| 54 |
long double atan2l(long double y, long double x);
|
| 55 |
|
| 56 |
-
|
| 57 |
-
double cos(double x);
|
| 58 |
-
long double cos(long double x); // see [library.c]
|
| 59 |
float cosf(float x);
|
| 60 |
long double cosl(long double x);
|
| 61 |
|
| 62 |
-
|
| 63 |
-
double sin(double x);
|
| 64 |
-
long double sin(long double x); // see [library.c]
|
| 65 |
float sinf(float x);
|
| 66 |
long double sinl(long double x);
|
| 67 |
|
| 68 |
-
|
| 69 |
-
double tan(double x);
|
| 70 |
-
long double tan(long double x); // see [library.c]
|
| 71 |
float tanf(float x);
|
| 72 |
long double tanl(long double x);
|
| 73 |
|
| 74 |
-
|
| 75 |
-
double acosh(double x);
|
| 76 |
-
long double acosh(long double x); // see [library.c]
|
| 77 |
float acoshf(float x);
|
| 78 |
long double acoshl(long double x);
|
| 79 |
|
| 80 |
-
|
| 81 |
-
double asinh(double x);
|
| 82 |
-
long double asinh(long double x); // see [library.c]
|
| 83 |
float asinhf(float x);
|
| 84 |
long double asinhl(long double x);
|
| 85 |
|
| 86 |
-
|
| 87 |
-
double atanh(double x);
|
| 88 |
-
long double atanh(long double x); // see [library.c]
|
| 89 |
float atanhf(float x);
|
| 90 |
long double atanhl(long double x);
|
| 91 |
|
| 92 |
-
|
| 93 |
-
double cosh(double x);
|
| 94 |
-
long double cosh(long double x); // see [library.c]
|
| 95 |
float coshf(float x);
|
| 96 |
long double coshl(long double x);
|
| 97 |
|
| 98 |
-
|
| 99 |
-
double sinh(double x);
|
| 100 |
-
long double sinh(long double x); // see [library.c]
|
| 101 |
float sinhf(float x);
|
| 102 |
long double sinhl(long double x);
|
| 103 |
|
| 104 |
-
|
| 105 |
-
double tanh(double x);
|
| 106 |
-
long double tanh(long double x); // see [library.c]
|
| 107 |
float tanhf(float x);
|
| 108 |
long double tanhl(long double x);
|
| 109 |
|
| 110 |
-
|
| 111 |
-
double exp(double x);
|
| 112 |
-
long double exp(long double x); // see [library.c]
|
| 113 |
float expf(float x);
|
| 114 |
long double expl(long double x);
|
| 115 |
|
| 116 |
-
|
| 117 |
-
double exp2(double x);
|
| 118 |
-
long double exp2(long double x); // see [library.c]
|
| 119 |
float exp2f(float x);
|
| 120 |
long double exp2l(long double x);
|
| 121 |
|
| 122 |
-
|
| 123 |
-
double expm1(double x);
|
| 124 |
-
long double expm1(long double x); // see [library.c]
|
| 125 |
float expm1f(float x);
|
| 126 |
long double expm1l(long double x);
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
long double
|
| 131 |
-
float frexpf(float value, int* exp);
|
| 132 |
-
long double frexpl(long double value, int* exp);
|
| 133 |
|
| 134 |
-
int ilogb(
|
| 135 |
-
int
|
| 136 |
-
int
|
| 137 |
-
int ilogbf(float x);
|
| 138 |
-
int ilogbl(long double x);
|
| 139 |
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
long double
|
| 143 |
-
float ldexpf(float x, int exp);
|
| 144 |
-
long double ldexpl(long double x, int exp);
|
| 145 |
|
| 146 |
-
|
| 147 |
-
double log(double x);
|
| 148 |
-
long double log(long double x); // see [library.c]
|
| 149 |
float logf(float x);
|
| 150 |
long double logl(long double x);
|
| 151 |
|
| 152 |
-
|
| 153 |
-
double log10(double x);
|
| 154 |
-
long double log10(long double x); // see [library.c]
|
| 155 |
float log10f(float x);
|
| 156 |
long double log10l(long double x);
|
| 157 |
|
| 158 |
-
|
| 159 |
-
double log1p(double x);
|
| 160 |
-
long double log1p(long double x); // see [library.c]
|
| 161 |
float log1pf(float x);
|
| 162 |
long double log1pl(long double x);
|
| 163 |
|
| 164 |
-
|
| 165 |
-
double log2(double x);
|
| 166 |
-
long double log2(long double x); // see [library.c]
|
| 167 |
float log2f(float x);
|
| 168 |
long double log2l(long double x);
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
long double
|
| 173 |
-
float logbf(float x);
|
| 174 |
-
long double logbl(long double x);
|
| 175 |
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
long double
|
| 179 |
-
float modff(float value, float* iptr);
|
| 180 |
-
long double modfl(long double value, long double* iptr);
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
long double
|
| 185 |
-
float scalbnf(float x, int n);
|
| 186 |
-
long double scalbnl(long double x, int n);
|
| 187 |
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
long double
|
| 191 |
-
float scalblnf(float x, long int n);
|
| 192 |
-
long double scalblnl(long double x, long int n);
|
| 193 |
|
| 194 |
-
|
| 195 |
-
double cbrt(double x);
|
| 196 |
-
long double cbrt(long double x); // see [library.c]
|
| 197 |
float cbrtf(float x);
|
| 198 |
long double cbrtl(long double x);
|
| 199 |
|
| 200 |
// [c.math.abs], absolute values
|
| 201 |
-
int abs(int j);
|
| 202 |
-
long int abs(long int j);
|
| 203 |
-
long long int abs(long long int j);
|
| 204 |
-
|
| 205 |
-
double abs(double j);
|
| 206 |
-
long double abs(long double j);
|
| 207 |
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
long double
|
| 211 |
-
float fabsf(float x);
|
| 212 |
-
long double fabsl(long double x);
|
| 213 |
|
| 214 |
-
|
| 215 |
-
double hypot(double x, double y);
|
| 216 |
-
long double hypot(long double x, long double y); // see [library.c]
|
| 217 |
float hypotf(float x, float y);
|
| 218 |
long double hypotl(long double x, long double y);
|
| 219 |
|
| 220 |
// [c.math.hypot3], three-dimensional hypotenuse
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
long double hypot(long double x, long double y, long double z);
|
| 224 |
|
| 225 |
-
|
| 226 |
-
double pow(double x, double y);
|
| 227 |
-
long double pow(long double x, long double y); // see [library.c]
|
| 228 |
float powf(float x, float y);
|
| 229 |
long double powl(long double x, long double y);
|
| 230 |
|
| 231 |
-
|
| 232 |
-
double sqrt(double x);
|
| 233 |
-
long double sqrt(long double x); // see [library.c]
|
| 234 |
float sqrtf(float x);
|
| 235 |
long double sqrtl(long double x);
|
| 236 |
|
| 237 |
-
|
| 238 |
-
double erf(double x);
|
| 239 |
-
long double erf(long double x); // see [library.c]
|
| 240 |
float erff(float x);
|
| 241 |
long double erfl(long double x);
|
| 242 |
|
| 243 |
-
|
| 244 |
-
double erfc(double x);
|
| 245 |
-
long double erfc(long double x); // see [library.c]
|
| 246 |
float erfcf(float x);
|
| 247 |
long double erfcl(long double x);
|
| 248 |
|
| 249 |
-
|
| 250 |
-
double lgamma(double x);
|
| 251 |
-
long double lgamma(long double x); // see [library.c]
|
| 252 |
float lgammaf(float x);
|
| 253 |
long double lgammal(long double x);
|
| 254 |
|
| 255 |
-
|
| 256 |
-
double tgamma(double x);
|
| 257 |
-
long double tgamma(long double x); // see [library.c]
|
| 258 |
float tgammaf(float x);
|
| 259 |
long double tgammal(long double x);
|
| 260 |
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
long double
|
| 264 |
-
float ceilf(float x);
|
| 265 |
-
long double ceill(long double x);
|
| 266 |
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
long double
|
| 270 |
-
float floorf(float x);
|
| 271 |
-
long double floorl(long double x);
|
| 272 |
|
| 273 |
-
|
| 274 |
-
double nearbyint(double x);
|
| 275 |
-
long double nearbyint(long double x); // see [library.c]
|
| 276 |
float nearbyintf(float x);
|
| 277 |
long double nearbyintl(long double x);
|
| 278 |
|
| 279 |
-
|
| 280 |
-
double rint(double x);
|
| 281 |
-
long double rint(long double x); // see [library.c]
|
| 282 |
float rintf(float x);
|
| 283 |
long double rintl(long double x);
|
| 284 |
|
| 285 |
-
long int lrint(
|
| 286 |
-
long int lrint(double x);
|
| 287 |
-
long int lrint(long double x); // see [library.c]
|
| 288 |
long int lrintf(float x);
|
| 289 |
long int lrintl(long double x);
|
| 290 |
|
| 291 |
-
long long int llrint(
|
| 292 |
-
long long int llrint(double x);
|
| 293 |
-
long long int llrint(long double x); // see [library.c]
|
| 294 |
long long int llrintf(float x);
|
| 295 |
long long int llrintl(long double x);
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
long double
|
| 300 |
-
float roundf(float x);
|
| 301 |
-
long double roundl(long double x);
|
| 302 |
|
| 303 |
-
long int lround(
|
| 304 |
-
long int
|
| 305 |
-
long int
|
| 306 |
-
long int lroundf(float x);
|
| 307 |
-
long int lroundl(long double x);
|
| 308 |
|
| 309 |
-
long long int llround(
|
| 310 |
-
long long int
|
| 311 |
-
long long int
|
| 312 |
-
long long int llroundf(float x);
|
| 313 |
-
long long int llroundl(long double x);
|
| 314 |
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
long double
|
| 318 |
-
float truncf(float x);
|
| 319 |
-
long double truncl(long double x);
|
| 320 |
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
long double
|
| 324 |
-
float fmodf(float x, float y);
|
| 325 |
-
long double fmodl(long double x, long double y);
|
| 326 |
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
long double
|
| 330 |
-
float remainderf(float x, float y);
|
| 331 |
-
long double remainderl(long double x, long double y);
|
| 332 |
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
long double
|
| 336 |
-
float remquof(float x, float y, int* quo);
|
| 337 |
-
long double remquol(long double x, long double y, int* quo);
|
| 338 |
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
long double
|
| 342 |
-
float copysignf(float x, float y);
|
| 343 |
-
long double copysignl(long double x, long double y);
|
| 344 |
|
| 345 |
double nan(const char* tagp);
|
| 346 |
float nanf(const char* tagp);
|
| 347 |
long double nanl(const char* tagp);
|
| 348 |
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
long double
|
| 352 |
-
float nextafterf(float x, float y);
|
| 353 |
-
long double nextafterl(long double x, long double y);
|
| 354 |
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
long double
|
| 358 |
-
float nexttowardf(float x, long double y);
|
| 359 |
-
long double nexttowardl(long double x, long double y);
|
| 360 |
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
long double
|
| 364 |
-
float fdimf(float x, float y);
|
| 365 |
-
long double fdiml(long double x, long double y);
|
| 366 |
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
long double
|
| 370 |
-
float fmaxf(float x, float y);
|
| 371 |
-
long double fmaxl(long double x, long double y);
|
| 372 |
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
long double
|
| 376 |
-
float fminf(float x, float y);
|
| 377 |
-
long double fminl(long double x, long double y);
|
| 378 |
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
long double fmal(long double x, long double y, long double z);
|
| 384 |
|
| 385 |
// [c.math.lerp], linear interpolation
|
| 386 |
-
constexpr
|
| 387 |
-
|
| 388 |
-
constexpr long double lerp(long double a, long double b, long double t) noexcept;
|
| 389 |
|
| 390 |
// [c.math.fpclass], classification / comparison functions
|
| 391 |
-
int fpclassify(
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
bool
|
| 396 |
-
bool
|
| 397 |
-
bool
|
| 398 |
-
|
| 399 |
-
bool
|
| 400 |
-
bool
|
| 401 |
-
bool
|
| 402 |
-
|
| 403 |
-
bool isnan(float x);
|
| 404 |
-
bool isnan(double x);
|
| 405 |
-
bool isnan(long double x);
|
| 406 |
-
|
| 407 |
-
bool isnormal(float x);
|
| 408 |
-
bool isnormal(double x);
|
| 409 |
-
bool isnormal(long double x);
|
| 410 |
-
|
| 411 |
-
bool signbit(float x);
|
| 412 |
-
bool signbit(double x);
|
| 413 |
-
bool signbit(long double x);
|
| 414 |
-
|
| 415 |
-
bool isgreater(float x, float y);
|
| 416 |
-
bool isgreater(double x, double y);
|
| 417 |
-
bool isgreater(long double x, long double y);
|
| 418 |
-
|
| 419 |
-
bool isgreaterequal(float x, float y);
|
| 420 |
-
bool isgreaterequal(double x, double y);
|
| 421 |
-
bool isgreaterequal(long double x, long double y);
|
| 422 |
-
|
| 423 |
-
bool isless(float x, float y);
|
| 424 |
-
bool isless(double x, double y);
|
| 425 |
-
bool isless(long double x, long double y);
|
| 426 |
-
|
| 427 |
-
bool islessequal(float x, float y);
|
| 428 |
-
bool islessequal(double x, double y);
|
| 429 |
-
bool islessequal(long double x, long double y);
|
| 430 |
-
|
| 431 |
-
bool islessgreater(float x, float y);
|
| 432 |
-
bool islessgreater(double x, double y);
|
| 433 |
-
bool islessgreater(long double x, long double y);
|
| 434 |
-
|
| 435 |
-
bool isunordered(float x, float y);
|
| 436 |
-
bool isunordered(double x, double y);
|
| 437 |
-
bool isunordered(long double x, long double y);
|
| 438 |
|
| 439 |
// [sf.cmath], mathematical special functions
|
| 440 |
|
| 441 |
// [sf.cmath.assoc.laguerre], associated Laguerre polynomials
|
| 442 |
-
|
| 443 |
float assoc_laguerref(unsigned n, unsigned m, float x);
|
| 444 |
long double assoc_laguerrel(unsigned n, unsigned m, long double x);
|
| 445 |
|
| 446 |
// [sf.cmath.assoc.legendre], associated Legendre functions
|
| 447 |
-
|
| 448 |
float assoc_legendref(unsigned l, unsigned m, float x);
|
| 449 |
long double assoc_legendrel(unsigned l, unsigned m, long double x);
|
| 450 |
|
| 451 |
// [sf.cmath.beta], beta function
|
| 452 |
-
|
| 453 |
float betaf(float x, float y);
|
| 454 |
long double betal(long double x, long double y);
|
| 455 |
|
| 456 |
// [sf.cmath.comp.ellint.1], complete elliptic integral of the first kind
|
| 457 |
-
|
| 458 |
float comp_ellint_1f(float k);
|
| 459 |
long double comp_ellint_1l(long double k);
|
| 460 |
|
| 461 |
// [sf.cmath.comp.ellint.2], complete elliptic integral of the second kind
|
| 462 |
-
|
| 463 |
float comp_ellint_2f(float k);
|
| 464 |
long double comp_ellint_2l(long double k);
|
| 465 |
|
| 466 |
// [sf.cmath.comp.ellint.3], complete elliptic integral of the third kind
|
| 467 |
-
|
| 468 |
float comp_ellint_3f(float k, float nu);
|
| 469 |
long double comp_ellint_3l(long double k, long double nu);
|
| 470 |
|
| 471 |
// [sf.cmath.cyl.bessel.i], regular modified cylindrical Bessel functions
|
| 472 |
-
|
| 473 |
float cyl_bessel_if(float nu, float x);
|
| 474 |
long double cyl_bessel_il(long double nu, long double x);
|
| 475 |
|
| 476 |
// [sf.cmath.cyl.bessel.j], cylindrical Bessel functions of the first kind
|
| 477 |
-
|
| 478 |
float cyl_bessel_jf(float nu, float x);
|
| 479 |
long double cyl_bessel_jl(long double nu, long double x);
|
| 480 |
|
| 481 |
// [sf.cmath.cyl.bessel.k], irregular modified cylindrical Bessel functions
|
| 482 |
-
|
| 483 |
float cyl_bessel_kf(float nu, float x);
|
| 484 |
long double cyl_bessel_kl(long double nu, long double x);
|
| 485 |
|
| 486 |
-
// [sf.cmath.cyl.neumann], cylindrical Neumann functions
|
| 487 |
// cylindrical Bessel functions of the second kind
|
| 488 |
-
|
| 489 |
float cyl_neumannf(float nu, float x);
|
| 490 |
long double cyl_neumannl(long double nu, long double x);
|
| 491 |
|
| 492 |
// [sf.cmath.ellint.1], incomplete elliptic integral of the first kind
|
| 493 |
-
|
| 494 |
float ellint_1f(float k, float phi);
|
| 495 |
long double ellint_1l(long double k, long double phi);
|
| 496 |
|
| 497 |
// [sf.cmath.ellint.2], incomplete elliptic integral of the second kind
|
| 498 |
-
|
| 499 |
float ellint_2f(float k, float phi);
|
| 500 |
long double ellint_2l(long double k, long double phi);
|
| 501 |
|
| 502 |
// [sf.cmath.ellint.3], incomplete elliptic integral of the third kind
|
| 503 |
-
|
|
|
|
| 504 |
float ellint_3f(float k, float nu, float phi);
|
| 505 |
long double ellint_3l(long double k, long double nu, long double phi);
|
| 506 |
|
| 507 |
// [sf.cmath.expint], exponential integral
|
| 508 |
-
|
| 509 |
float expintf(float x);
|
| 510 |
long double expintl(long double x);
|
| 511 |
|
| 512 |
// [sf.cmath.hermite], Hermite polynomials
|
| 513 |
-
|
| 514 |
float hermitef(unsigned n, float x);
|
| 515 |
long double hermitel(unsigned n, long double x);
|
| 516 |
|
| 517 |
// [sf.cmath.laguerre], Laguerre polynomials
|
| 518 |
-
|
| 519 |
float laguerref(unsigned n, float x);
|
| 520 |
long double laguerrel(unsigned n, long double x);
|
| 521 |
|
| 522 |
// [sf.cmath.legendre], Legendre polynomials
|
| 523 |
-
|
| 524 |
float legendref(unsigned l, float x);
|
| 525 |
long double legendrel(unsigned l, long double x);
|
| 526 |
|
| 527 |
// [sf.cmath.riemann.zeta], Riemann zeta function
|
| 528 |
-
|
| 529 |
float riemann_zetaf(float x);
|
| 530 |
long double riemann_zetal(long double x);
|
| 531 |
|
| 532 |
// [sf.cmath.sph.bessel], spherical Bessel functions of the first kind
|
| 533 |
-
|
| 534 |
float sph_besself(unsigned n, float x);
|
| 535 |
long double sph_bessell(unsigned n, long double x);
|
| 536 |
|
| 537 |
// [sf.cmath.sph.legendre], spherical associated Legendre functions
|
| 538 |
-
|
| 539 |
float sph_legendref(unsigned l, unsigned m, float theta);
|
| 540 |
long double sph_legendrel(unsigned l, unsigned m, long double theta);
|
| 541 |
|
| 542 |
// [sf.cmath.sph.neumann], spherical Neumann functions;
|
| 543 |
// spherical Bessel functions of the second kind
|
| 544 |
-
|
| 545 |
float sph_neumannf(unsigned n, float x);
|
| 546 |
long double sph_neumannl(unsigned n, long double x);
|
| 547 |
}
|
| 548 |
```
|
| 549 |
|
| 550 |
The contents and meaning of the header `<cmath>` are the same as the C
|
| 551 |
standard library header `<math.h>`, with the addition of a
|
| 552 |
-
three-dimensional hypotenuse function
|
| 553 |
-
|
|
|
|
| 554 |
|
| 555 |
[*Note 1*: Several functions have additional overloads in this
|
| 556 |
document, but they have the same behavior as in the C standard library
|
| 557 |
[[library.c]]. — *end note*]
|
| 558 |
|
| 559 |
-
For each
|
| 560 |
-
|
| 561 |
-
|
|
|
|
|
|
|
| 562 |
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
-
|
| 572 |
-
|
|
|
|
|
|
|
| 573 |
|
| 574 |
-
|
| 575 |
-
|
|
|
|
| 576 |
|
| 577 |
-
ISO C 7.12
|
| 578 |
|
| 579 |
### Absolute values <a id="c.math.abs">[[c.math.abs]]</a>
|
| 580 |
|
| 581 |
[*Note 1*: The headers `<cstdlib>` and `<cmath>` declare the functions
|
| 582 |
described in this subclause. — *end note*]
|
| 583 |
|
| 584 |
``` cpp
|
| 585 |
-
int abs(int j);
|
| 586 |
-
long int abs(long int j);
|
| 587 |
-
long long int abs(long long int j);
|
| 588 |
-
float abs(float j);
|
| 589 |
-
double abs(double j);
|
| 590 |
-
long double abs(long double j);
|
| 591 |
```
|
| 592 |
|
| 593 |
-
*Effects:*
|
| 594 |
-
standard library for the functions `abs`, `labs`, `llabs`,
|
| 595 |
-
|
| 596 |
|
| 597 |
-
*Remarks:* If `abs
|
| 598 |
`is_unsigned_v<X>` is `true` and if `X` cannot be converted to `int` by
|
| 599 |
integral promotion [[conv.prom]], the program is ill-formed.
|
| 600 |
|
| 601 |
[*Note 1*: Arguments that can be promoted to `int` are permitted for
|
| 602 |
compatibility with C. — *end note*]
|
| 603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
See also: ISO C 7.12.7.2, 7.22.6.1
|
| 605 |
|
| 606 |
### Three-dimensional hypotenuse <a id="c.math.hypot3">[[c.math.hypot3]]</a>
|
| 607 |
|
| 608 |
``` cpp
|
| 609 |
-
|
| 610 |
-
double hypot(double x, double y, double z);
|
| 611 |
-
long double hypot(long double x, long double y, long double z);
|
| 612 |
```
|
| 613 |
|
| 614 |
*Returns:* $\sqrt{x^2+y^2+z^2}$.
|
| 615 |
|
| 616 |
### Linear interpolation <a id="c.math.lerp">[[c.math.lerp]]</a>
|
| 617 |
|
| 618 |
``` cpp
|
| 619 |
-
constexpr
|
| 620 |
-
|
| 621 |
-
constexpr long double lerp(long double a, long double b, long double t) noexcept;
|
| 622 |
```
|
| 623 |
|
| 624 |
*Returns:* a+t(b-a).
|
| 625 |
|
| 626 |
*Remarks:* Let `r` be the value returned. If
|
|
@@ -639,35 +496,36 @@ otherwise. For any `t1` and `t2`, the product of
|
|
| 639 |
|
| 640 |
### Classification / comparison functions <a id="c.math.fpclass">[[c.math.fpclass]]</a>
|
| 641 |
|
| 642 |
The classification / comparison functions behave the same as the C
|
| 643 |
macros with the corresponding names defined in the C standard library.
|
| 644 |
-
Each function is overloaded for the three floating-point types.
|
| 645 |
|
| 646 |
-
ISO C 7.12.3, 7.12.4
|
| 647 |
|
| 648 |
### Mathematical special functions <a id="sf.cmath">[[sf.cmath]]</a>
|
| 649 |
|
| 650 |
-
|
| 651 |
-
subclause is a NaN (Not a Number), the function shall return a NaN but
|
| 652 |
-
it shall not report a domain error. Otherwise, the function shall report
|
| 653 |
-
a domain error for just those argument values for which:
|
| 654 |
|
| 655 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 656 |
domain and those argument values fall outside the specified domain, or
|
| 657 |
- the corresponding mathematical function value has a nonzero imaginary
|
| 658 |
component, or
|
| 659 |
- the corresponding mathematical function is not mathematically
|
| 660 |
-
defined.[^
|
| 661 |
|
| 662 |
Unless otherwise specified, each function is defined for all finite
|
| 663 |
values, for negative infinity, and for positive infinity.
|
| 664 |
|
| 665 |
#### Associated Laguerre polynomials <a id="sf.cmath.assoc.laguerre">[[sf.cmath.assoc.laguerre]]</a>
|
| 666 |
|
| 667 |
``` cpp
|
| 668 |
-
|
| 669 |
float assoc_laguerref(unsigned n, unsigned m, float x);
|
| 670 |
long double assoc_laguerrel(unsigned n, unsigned m, long double x);
|
| 671 |
```
|
| 672 |
|
| 673 |
*Effects:* These functions compute the associated Laguerre polynomials
|
|
@@ -682,11 +540,11 @@ of their respective arguments `n`, `m`, and `x`.
|
|
| 682 |
*implementation-defined* if `n >= 128` or if `m >= 128`.
|
| 683 |
|
| 684 |
#### Associated Legendre functions <a id="sf.cmath.assoc.legendre">[[sf.cmath.assoc.legendre]]</a>
|
| 685 |
|
| 686 |
``` cpp
|
| 687 |
-
|
| 688 |
float assoc_legendref(unsigned l, unsigned m, float x);
|
| 689 |
long double assoc_legendrel(unsigned l, unsigned m, long double x);
|
| 690 |
```
|
| 691 |
|
| 692 |
*Effects:* These functions compute the associated Legendre functions of
|
|
@@ -701,11 +559,11 @@ their respective arguments `l`, `m`, and `x`.
|
|
| 701 |
*implementation-defined* if `l >= 128`.
|
| 702 |
|
| 703 |
#### Beta function <a id="sf.cmath.beta">[[sf.cmath.beta]]</a>
|
| 704 |
|
| 705 |
``` cpp
|
| 706 |
-
|
| 707 |
float betaf(float x, float y);
|
| 708 |
long double betal(long double x, long double y);
|
| 709 |
```
|
| 710 |
|
| 711 |
*Effects:* These functions compute the beta function of their respective
|
|
@@ -716,11 +574,11 @@ $$\mathsf{B}(x, y) = \frac{\Gamma(x) \, \Gamma(y)}{\Gamma(x + y)}
|
|
| 716 |
\text{ ,\quad for $x > 0$,\, $y > 0$,}$$ where x is `x` and y is `y`.
|
| 717 |
|
| 718 |
#### Complete elliptic integral of the first kind <a id="sf.cmath.comp.ellint.1">[[sf.cmath.comp.ellint.1]]</a>
|
| 719 |
|
| 720 |
``` cpp
|
| 721 |
-
|
| 722 |
float comp_ellint_1f(float k);
|
| 723 |
long double comp_ellint_1l(long double k);
|
| 724 |
```
|
| 725 |
|
| 726 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
@@ -733,11 +591,11 @@ where k is `k`.
|
|
| 733 |
See also [[sf.cmath.ellint.1]].
|
| 734 |
|
| 735 |
#### Complete elliptic integral of the second kind <a id="sf.cmath.comp.ellint.2">[[sf.cmath.comp.ellint.2]]</a>
|
| 736 |
|
| 737 |
``` cpp
|
| 738 |
-
|
| 739 |
float comp_ellint_2f(float k);
|
| 740 |
long double comp_ellint_2l(long double k);
|
| 741 |
```
|
| 742 |
|
| 743 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
@@ -750,11 +608,11 @@ where k is `k`.
|
|
| 750 |
See also [[sf.cmath.ellint.2]].
|
| 751 |
|
| 752 |
#### Complete elliptic integral of the third kind <a id="sf.cmath.comp.ellint.3">[[sf.cmath.comp.ellint.3]]</a>
|
| 753 |
|
| 754 |
``` cpp
|
| 755 |
-
|
| 756 |
float comp_ellint_3f(float k, float nu);
|
| 757 |
long double comp_ellint_3l(long double k, long double nu);
|
| 758 |
```
|
| 759 |
|
| 760 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
@@ -767,11 +625,11 @@ where k is `k` and $\nu$ is `nu`.
|
|
| 767 |
See also [[sf.cmath.ellint.3]].
|
| 768 |
|
| 769 |
#### Regular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.i">[[sf.cmath.cyl.bessel.i]]</a>
|
| 770 |
|
| 771 |
``` cpp
|
| 772 |
-
|
| 773 |
float cyl_bessel_if(float nu, float x);
|
| 774 |
long double cyl_bessel_il(long double nu, long double x);
|
| 775 |
```
|
| 776 |
|
| 777 |
*Effects:* These functions compute the regular modified cylindrical
|
|
@@ -788,11 +646,11 @@ Bessel functions of their respective arguments `nu` and `x`.
|
|
| 788 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 789 |
|
| 790 |
#### Cylindrical Bessel functions of the first kind <a id="sf.cmath.cyl.bessel.j">[[sf.cmath.cyl.bessel.j]]</a>
|
| 791 |
|
| 792 |
``` cpp
|
| 793 |
-
|
| 794 |
float cyl_bessel_jf(float nu, float x);
|
| 795 |
long double cyl_bessel_jl(long double nu, long double x);
|
| 796 |
```
|
| 797 |
|
| 798 |
*Effects:* These functions compute the cylindrical Bessel functions of
|
|
@@ -806,11 +664,11 @@ the first kind of their respective arguments `nu` and `x`.
|
|
| 806 |
*implementation-defined* if `nu >= 128`.
|
| 807 |
|
| 808 |
#### Irregular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.k">[[sf.cmath.cyl.bessel.k]]</a>
|
| 809 |
|
| 810 |
``` cpp
|
| 811 |
-
|
| 812 |
float cyl_bessel_kf(float nu, float x);
|
| 813 |
long double cyl_bessel_kl(long double nu, long double x);
|
| 814 |
```
|
| 815 |
|
| 816 |
*Effects:* These functions compute the irregular modified cylindrical
|
|
@@ -846,11 +704,11 @@ See also [[sf.cmath.cyl.bessel.i]], [[sf.cmath.cyl.bessel.j]],
|
|
| 846 |
[[sf.cmath.cyl.neumann]].
|
| 847 |
|
| 848 |
#### Cylindrical Neumann functions <a id="sf.cmath.cyl.neumann">[[sf.cmath.cyl.neumann]]</a>
|
| 849 |
|
| 850 |
``` cpp
|
| 851 |
-
|
| 852 |
float cyl_neumannf(float nu, float x);
|
| 853 |
long double cyl_neumannl(long double nu, long double x);
|
| 854 |
```
|
| 855 |
|
| 856 |
*Effects:* These functions compute the cylindrical Neumann functions,
|
|
@@ -880,11 +738,11 @@ their respective arguments `nu` and `x`.
|
|
| 880 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 881 |
|
| 882 |
#### Incomplete elliptic integral of the first kind <a id="sf.cmath.ellint.1">[[sf.cmath.ellint.1]]</a>
|
| 883 |
|
| 884 |
``` cpp
|
| 885 |
-
|
| 886 |
float ellint_1f(float k, float phi);
|
| 887 |
long double ellint_1l(long double k, long double phi);
|
| 888 |
```
|
| 889 |
|
| 890 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
@@ -896,11 +754,11 @@ measured in radians).
|
|
| 896 |
\text{ ,\quad for $|k| \le 1$,}$$ where k is `k` and φ is `phi`.
|
| 897 |
|
| 898 |
#### Incomplete elliptic integral of the second kind <a id="sf.cmath.ellint.2">[[sf.cmath.ellint.2]]</a>
|
| 899 |
|
| 900 |
``` cpp
|
| 901 |
-
|
| 902 |
float ellint_2f(float k, float phi);
|
| 903 |
long double ellint_2l(long double k, long double phi);
|
| 904 |
```
|
| 905 |
|
| 906 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
@@ -912,11 +770,12 @@ $$\mathsf{E}(k, \phi) = \int_0^\phi \! \sqrt{1 - k^2 \sin^2 \theta} \, \mathsf{d
|
|
| 912 |
\text{ ,\quad for $|k| \le 1$,}$$ where k is `k` and φ is `phi`.
|
| 913 |
|
| 914 |
#### Incomplete elliptic integral of the third kind <a id="sf.cmath.ellint.3">[[sf.cmath.ellint.3]]</a>
|
| 915 |
|
| 916 |
``` cpp
|
| 917 |
-
|
|
|
|
| 918 |
float ellint_3f(float k, float nu, float phi);
|
| 919 |
long double ellint_3l(long double k, long double nu, long double phi);
|
| 920 |
```
|
| 921 |
|
| 922 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
@@ -928,11 +787,11 @@ measured in radians).
|
|
| 928 |
where $\nu$ is `nu`, k is `k`, and φ is `phi`.
|
| 929 |
|
| 930 |
#### Exponential integral <a id="sf.cmath.expint">[[sf.cmath.expint]]</a>
|
| 931 |
|
| 932 |
``` cpp
|
| 933 |
-
|
| 934 |
float expintf(float x);
|
| 935 |
long double expintl(long double x);
|
| 936 |
```
|
| 937 |
|
| 938 |
*Effects:* These functions compute the exponential integral of their
|
|
@@ -945,11 +804,11 @@ respective arguments `x`.
|
|
| 945 |
\;$$ where x is `x`.
|
| 946 |
|
| 947 |
#### Hermite polynomials <a id="sf.cmath.hermite">[[sf.cmath.hermite]]</a>
|
| 948 |
|
| 949 |
``` cpp
|
| 950 |
-
|
| 951 |
float hermitef(unsigned n, float x);
|
| 952 |
long double hermitel(unsigned n, long double x);
|
| 953 |
```
|
| 954 |
|
| 955 |
*Effects:* These functions compute the Hermite polynomials of their
|
|
@@ -965,11 +824,11 @@ respective arguments `n` and `x`.
|
|
| 965 |
*implementation-defined* if `n >= 128`.
|
| 966 |
|
| 967 |
#### Laguerre polynomials <a id="sf.cmath.laguerre">[[sf.cmath.laguerre]]</a>
|
| 968 |
|
| 969 |
``` cpp
|
| 970 |
-
|
| 971 |
float laguerref(unsigned n, float x);
|
| 972 |
long double laguerrel(unsigned n, long double x);
|
| 973 |
```
|
| 974 |
|
| 975 |
*Effects:* These functions compute the Laguerre polynomials of their
|
|
@@ -983,11 +842,11 @@ respective arguments `n` and `x`.
|
|
| 983 |
*implementation-defined* if `n >= 128`.
|
| 984 |
|
| 985 |
#### Legendre polynomials <a id="sf.cmath.legendre">[[sf.cmath.legendre]]</a>
|
| 986 |
|
| 987 |
``` cpp
|
| 988 |
-
|
| 989 |
float legendref(unsigned l, float x);
|
| 990 |
long double legendrel(unsigned l, long double x);
|
| 991 |
```
|
| 992 |
|
| 993 |
*Effects:* These functions compute the Legendre polynomials of their
|
|
@@ -1002,11 +861,11 @@ respective arguments `l` and `x`.
|
|
| 1002 |
*implementation-defined* if `l >= 128`.
|
| 1003 |
|
| 1004 |
#### Riemann zeta function <a id="sf.cmath.riemann.zeta">[[sf.cmath.riemann.zeta]]</a>
|
| 1005 |
|
| 1006 |
``` cpp
|
| 1007 |
-
|
| 1008 |
float riemann_zetaf(float x);
|
| 1009 |
long double riemann_zetal(long double x);
|
| 1010 |
```
|
| 1011 |
|
| 1012 |
*Effects:* These functions compute the Riemann zeta function of their
|
|
@@ -1036,11 +895,11 @@ respective arguments `x`.
|
|
| 1036 |
\;$$ where x is `x`.
|
| 1037 |
|
| 1038 |
#### Spherical Bessel functions of the first kind <a id="sf.cmath.sph.bessel">[[sf.cmath.sph.bessel]]</a>
|
| 1039 |
|
| 1040 |
``` cpp
|
| 1041 |
-
|
| 1042 |
float sph_besself(unsigned n, float x);
|
| 1043 |
long double sph_bessell(unsigned n, long double x);
|
| 1044 |
```
|
| 1045 |
|
| 1046 |
*Effects:* These functions compute the spherical Bessel functions of the
|
|
@@ -1056,11 +915,11 @@ where n is `n` and x is `x`.
|
|
| 1056 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 1057 |
|
| 1058 |
#### Spherical associated Legendre functions <a id="sf.cmath.sph.legendre">[[sf.cmath.sph.legendre]]</a>
|
| 1059 |
|
| 1060 |
``` cpp
|
| 1061 |
-
|
| 1062 |
float sph_legendref(unsigned l, unsigned m, float theta);
|
| 1063 |
long double sph_legendrel(unsigned l, unsigned m, long double theta);
|
| 1064 |
```
|
| 1065 |
|
| 1066 |
*Effects:* These functions compute the spherical associated Legendre
|
|
@@ -1080,11 +939,11 @@ is `theta`.
|
|
| 1080 |
See also [[sf.cmath.assoc.legendre]].
|
| 1081 |
|
| 1082 |
#### Spherical Neumann functions <a id="sf.cmath.sph.neumann">[[sf.cmath.sph.neumann]]</a>
|
| 1083 |
|
| 1084 |
``` cpp
|
| 1085 |
-
|
| 1086 |
float sph_neumannf(unsigned n, float x);
|
| 1087 |
long double sph_neumannl(unsigned n, long double x);
|
| 1088 |
```
|
| 1089 |
|
| 1090 |
*Effects:* These functions compute the spherical Neumann functions, also
|
|
|
|
| 27 |
#define MATH_ERREXCEPT see below
|
| 28 |
|
| 29 |
#define math_errhandling see below
|
| 30 |
|
| 31 |
namespace std {
|
| 32 |
+
floating-point-type acos(floating-point-type x);
|
|
|
|
|
|
|
| 33 |
float acosf(float x);
|
| 34 |
long double acosl(long double x);
|
| 35 |
|
| 36 |
+
floating-point-type asin(floating-point-type x);
|
|
|
|
|
|
|
| 37 |
float asinf(float x);
|
| 38 |
long double asinl(long double x);
|
| 39 |
|
| 40 |
+
floating-point-type atan(floating-point-type x);
|
|
|
|
|
|
|
| 41 |
float atanf(float x);
|
| 42 |
long double atanl(long double x);
|
| 43 |
|
| 44 |
+
floating-point-type atan2(floating-point-type y, floating-point-type x);
|
|
|
|
|
|
|
| 45 |
float atan2f(float y, float x);
|
| 46 |
long double atan2l(long double y, long double x);
|
| 47 |
|
| 48 |
+
floating-point-type cos(floating-point-type x);
|
|
|
|
|
|
|
| 49 |
float cosf(float x);
|
| 50 |
long double cosl(long double x);
|
| 51 |
|
| 52 |
+
floating-point-type sin(floating-point-type x);
|
|
|
|
|
|
|
| 53 |
float sinf(float x);
|
| 54 |
long double sinl(long double x);
|
| 55 |
|
| 56 |
+
floating-point-type tan(floating-point-type x);
|
|
|
|
|
|
|
| 57 |
float tanf(float x);
|
| 58 |
long double tanl(long double x);
|
| 59 |
|
| 60 |
+
floating-point-type acosh(floating-point-type x);
|
|
|
|
|
|
|
| 61 |
float acoshf(float x);
|
| 62 |
long double acoshl(long double x);
|
| 63 |
|
| 64 |
+
floating-point-type asinh(floating-point-type x);
|
|
|
|
|
|
|
| 65 |
float asinhf(float x);
|
| 66 |
long double asinhl(long double x);
|
| 67 |
|
| 68 |
+
floating-point-type atanh(floating-point-type x);
|
|
|
|
|
|
|
| 69 |
float atanhf(float x);
|
| 70 |
long double atanhl(long double x);
|
| 71 |
|
| 72 |
+
floating-point-type cosh(floating-point-type x);
|
|
|
|
|
|
|
| 73 |
float coshf(float x);
|
| 74 |
long double coshl(long double x);
|
| 75 |
|
| 76 |
+
floating-point-type sinh(floating-point-type x);
|
|
|
|
|
|
|
| 77 |
float sinhf(float x);
|
| 78 |
long double sinhl(long double x);
|
| 79 |
|
| 80 |
+
floating-point-type tanh(floating-point-type x);
|
|
|
|
|
|
|
| 81 |
float tanhf(float x);
|
| 82 |
long double tanhl(long double x);
|
| 83 |
|
| 84 |
+
floating-point-type exp(floating-point-type x);
|
|
|
|
|
|
|
| 85 |
float expf(float x);
|
| 86 |
long double expl(long double x);
|
| 87 |
|
| 88 |
+
floating-point-type exp2(floating-point-type x);
|
|
|
|
|
|
|
| 89 |
float exp2f(float x);
|
| 90 |
long double exp2l(long double x);
|
| 91 |
|
| 92 |
+
floating-point-type expm1(floating-point-type x);
|
|
|
|
|
|
|
| 93 |
float expm1f(float x);
|
| 94 |
long double expm1l(long double x);
|
| 95 |
|
| 96 |
+
constexpr floating-point-type frexp(floating-point-type value, int* exp);
|
| 97 |
+
constexpr float frexpf(float value, int* exp);
|
| 98 |
+
constexpr long double frexpl(long double value, int* exp);
|
|
|
|
|
|
|
| 99 |
|
| 100 |
+
constexpr int ilogb(floating-point-type x);
|
| 101 |
+
constexpr int ilogbf(float x);
|
| 102 |
+
constexpr int ilogbl(long double x);
|
|
|
|
|
|
|
| 103 |
|
| 104 |
+
constexpr floating-point-type ldexp(floating-point-type x, int exp);
|
| 105 |
+
constexpr float ldexpf(float x, int exp);
|
| 106 |
+
constexpr long double ldexpl(long double x, int exp);
|
|
|
|
|
|
|
| 107 |
|
| 108 |
+
floating-point-type log(floating-point-type x);
|
|
|
|
|
|
|
| 109 |
float logf(float x);
|
| 110 |
long double logl(long double x);
|
| 111 |
|
| 112 |
+
floating-point-type log10(floating-point-type x);
|
|
|
|
|
|
|
| 113 |
float log10f(float x);
|
| 114 |
long double log10l(long double x);
|
| 115 |
|
| 116 |
+
floating-point-type log1p(floating-point-type x);
|
|
|
|
|
|
|
| 117 |
float log1pf(float x);
|
| 118 |
long double log1pl(long double x);
|
| 119 |
|
| 120 |
+
floating-point-type log2(floating-point-type x);
|
|
|
|
|
|
|
| 121 |
float log2f(float x);
|
| 122 |
long double log2l(long double x);
|
| 123 |
|
| 124 |
+
constexpr floating-point-type logb(floating-point-type x);
|
| 125 |
+
constexpr float logbf(float x);
|
| 126 |
+
constexpr long double logbl(long double x);
|
|
|
|
|
|
|
| 127 |
|
| 128 |
+
constexpr floating-point-type modf(floating-point-type value, floating-point-type* iptr);
|
| 129 |
+
constexpr float modff(float value, float* iptr);
|
| 130 |
+
constexpr long double modfl(long double value, long double* iptr);
|
|
|
|
|
|
|
| 131 |
|
| 132 |
+
constexpr floating-point-type scalbn(floating-point-type x, int n);
|
| 133 |
+
constexpr float scalbnf(float x, int n);
|
| 134 |
+
constexpr long double scalbnl(long double x, int n);
|
|
|
|
|
|
|
| 135 |
|
| 136 |
+
constexpr floating-point-type scalbln(floating-point-type x, long int n);
|
| 137 |
+
constexpr float scalblnf(float x, long int n);
|
| 138 |
+
constexpr long double scalblnl(long double x, long int n);
|
|
|
|
|
|
|
| 139 |
|
| 140 |
+
floating-point-type cbrt(floating-point-type x);
|
|
|
|
|
|
|
| 141 |
float cbrtf(float x);
|
| 142 |
long double cbrtl(long double x);
|
| 143 |
|
| 144 |
// [c.math.abs], absolute values
|
| 145 |
+
constexpr int abs(int j);
|
| 146 |
+
constexpr long int abs(long int j);
|
| 147 |
+
constexpr long long int abs(long long int j);
|
| 148 |
+
constexpr floating-point-type abs(floating-point-type j);
|
|
|
|
|
|
|
| 149 |
|
| 150 |
+
constexpr floating-point-type fabs(floating-point-type x);
|
| 151 |
+
constexpr float fabsf(float x);
|
| 152 |
+
constexpr long double fabsl(long double x);
|
|
|
|
|
|
|
| 153 |
|
| 154 |
+
floating-point-type hypot(floating-point-type x, floating-point-type y);
|
|
|
|
|
|
|
| 155 |
float hypotf(float x, float y);
|
| 156 |
long double hypotl(long double x, long double y);
|
| 157 |
|
| 158 |
// [c.math.hypot3], three-dimensional hypotenuse
|
| 159 |
+
floating-point-type hypot(floating-point-type x, floating-point-type y,
|
| 160 |
+
floating-point-type z);
|
|
|
|
| 161 |
|
| 162 |
+
floating-point-type pow(floating-point-type x, floating-point-type y);
|
|
|
|
|
|
|
| 163 |
float powf(float x, float y);
|
| 164 |
long double powl(long double x, long double y);
|
| 165 |
|
| 166 |
+
floating-point-type sqrt(floating-point-type x);
|
|
|
|
|
|
|
| 167 |
float sqrtf(float x);
|
| 168 |
long double sqrtl(long double x);
|
| 169 |
|
| 170 |
+
floating-point-type erf(floating-point-type x);
|
|
|
|
|
|
|
| 171 |
float erff(float x);
|
| 172 |
long double erfl(long double x);
|
| 173 |
|
| 174 |
+
floating-point-type erfc(floating-point-type x);
|
|
|
|
|
|
|
| 175 |
float erfcf(float x);
|
| 176 |
long double erfcl(long double x);
|
| 177 |
|
| 178 |
+
floating-point-type lgamma(floating-point-type x);
|
|
|
|
|
|
|
| 179 |
float lgammaf(float x);
|
| 180 |
long double lgammal(long double x);
|
| 181 |
|
| 182 |
+
floating-point-type tgamma(floating-point-type x);
|
|
|
|
|
|
|
| 183 |
float tgammaf(float x);
|
| 184 |
long double tgammal(long double x);
|
| 185 |
|
| 186 |
+
constexpr floating-point-type ceil(floating-point-type x);
|
| 187 |
+
constexpr float ceilf(float x);
|
| 188 |
+
constexpr long double ceill(long double x);
|
|
|
|
|
|
|
| 189 |
|
| 190 |
+
constexpr floating-point-type floor(floating-point-type x);
|
| 191 |
+
constexpr float floorf(float x);
|
| 192 |
+
constexpr long double floorl(long double x);
|
|
|
|
|
|
|
| 193 |
|
| 194 |
+
floating-point-type nearbyint(floating-point-type x);
|
|
|
|
|
|
|
| 195 |
float nearbyintf(float x);
|
| 196 |
long double nearbyintl(long double x);
|
| 197 |
|
| 198 |
+
floating-point-type rint(floating-point-type x);
|
|
|
|
|
|
|
| 199 |
float rintf(float x);
|
| 200 |
long double rintl(long double x);
|
| 201 |
|
| 202 |
+
long int lrint(floating-point-type x);
|
|
|
|
|
|
|
| 203 |
long int lrintf(float x);
|
| 204 |
long int lrintl(long double x);
|
| 205 |
|
| 206 |
+
long long int llrint(floating-point-type x);
|
|
|
|
|
|
|
| 207 |
long long int llrintf(float x);
|
| 208 |
long long int llrintl(long double x);
|
| 209 |
|
| 210 |
+
constexpr floating-point-type round(floating-point-type x);
|
| 211 |
+
constexpr float roundf(float x);
|
| 212 |
+
constexpr long double roundl(long double x);
|
|
|
|
|
|
|
| 213 |
|
| 214 |
+
constexpr long int lround(floating-point-type x);
|
| 215 |
+
constexpr long int lroundf(float x);
|
| 216 |
+
constexpr long int lroundl(long double x);
|
|
|
|
|
|
|
| 217 |
|
| 218 |
+
constexpr long long int llround(floating-point-type x);
|
| 219 |
+
constexpr long long int llroundf(float x);
|
| 220 |
+
constexpr long long int llroundl(long double x);
|
|
|
|
|
|
|
| 221 |
|
| 222 |
+
constexpr floating-point-type trunc(floating-point-type x);
|
| 223 |
+
constexpr float truncf(float x);
|
| 224 |
+
constexpr long double truncl(long double x);
|
|
|
|
|
|
|
| 225 |
|
| 226 |
+
constexpr floating-point-type fmod(floating-point-type x, floating-point-type y);
|
| 227 |
+
constexpr float fmodf(float x, float y);
|
| 228 |
+
constexpr long double fmodl(long double x, long double y);
|
|
|
|
|
|
|
| 229 |
|
| 230 |
+
constexpr floating-point-type remainder(floating-point-type x, floating-point-type y);
|
| 231 |
+
constexpr float remainderf(float x, float y);
|
| 232 |
+
constexpr long double remainderl(long double x, long double y);
|
|
|
|
|
|
|
| 233 |
|
| 234 |
+
constexpr floating-point-type remquo(floating-point-type x, floating-point-type y, int* quo);
|
| 235 |
+
constexpr float remquof(float x, float y, int* quo);
|
| 236 |
+
constexpr long double remquol(long double x, long double y, int* quo);
|
|
|
|
|
|
|
| 237 |
|
| 238 |
+
constexpr floating-point-type copysign(floating-point-type x, floating-point-type y);
|
| 239 |
+
constexpr float copysignf(float x, float y);
|
| 240 |
+
constexpr long double copysignl(long double x, long double y);
|
|
|
|
|
|
|
| 241 |
|
| 242 |
double nan(const char* tagp);
|
| 243 |
float nanf(const char* tagp);
|
| 244 |
long double nanl(const char* tagp);
|
| 245 |
|
| 246 |
+
constexpr floating-point-type nextafter(floating-point-type x, floating-point-type y);
|
| 247 |
+
constexpr float nextafterf(float x, float y);
|
| 248 |
+
constexpr long double nextafterl(long double x, long double y);
|
|
|
|
|
|
|
| 249 |
|
| 250 |
+
constexpr floating-point-type nexttoward(floating-point-type x, long double y);
|
| 251 |
+
constexpr float nexttowardf(float x, long double y);
|
| 252 |
+
constexpr long double nexttowardl(long double x, long double y);
|
|
|
|
|
|
|
| 253 |
|
| 254 |
+
constexpr floating-point-type fdim(floating-point-type x, floating-point-type y);
|
| 255 |
+
constexpr float fdimf(float x, float y);
|
| 256 |
+
constexpr long double fdiml(long double x, long double y);
|
|
|
|
|
|
|
| 257 |
|
| 258 |
+
constexpr floating-point-type fmax(floating-point-type x, floating-point-type y);
|
| 259 |
+
constexpr float fmaxf(float x, float y);
|
| 260 |
+
constexpr long double fmaxl(long double x, long double y);
|
|
|
|
|
|
|
| 261 |
|
| 262 |
+
constexpr floating-point-type fmin(floating-point-type x, floating-point-type y);
|
| 263 |
+
constexpr float fminf(float x, float y);
|
| 264 |
+
constexpr long double fminl(long double x, long double y);
|
|
|
|
|
|
|
| 265 |
|
| 266 |
+
constexpr floating-point-type fma(floating-point-type x, floating-point-type y,
|
| 267 |
+
floating-point-type z);
|
| 268 |
+
constexpr float fmaf(float x, float y, float z);
|
| 269 |
+
constexpr long double fmal(long double x, long double y, long double z);
|
|
|
|
| 270 |
|
| 271 |
// [c.math.lerp], linear interpolation
|
| 272 |
+
constexpr floating-point-type lerp(floating-point-type a, floating-point-type b,
|
| 273 |
+
floating-point-type t) noexcept;
|
|
|
|
| 274 |
|
| 275 |
// [c.math.fpclass], classification / comparison functions
|
| 276 |
+
constexpr int fpclassify(floating-point-type x);
|
| 277 |
+
constexpr bool isfinite(floating-point-type x);
|
| 278 |
+
constexpr bool isinf(floating-point-type x);
|
| 279 |
+
constexpr bool isnan(floating-point-type x);
|
| 280 |
+
constexpr bool isnormal(floating-point-type x);
|
| 281 |
+
constexpr bool signbit(floating-point-type x);
|
| 282 |
+
constexpr bool isgreater(floating-point-type x, floating-point-type y);
|
| 283 |
+
constexpr bool isgreaterequal(floating-point-type x, floating-point-type y);
|
| 284 |
+
constexpr bool isless(floating-point-type x, floating-point-type y);
|
| 285 |
+
constexpr bool islessequal(floating-point-type x, floating-point-type y);
|
| 286 |
+
constexpr bool islessgreater(floating-point-type x, floating-point-type y);
|
| 287 |
+
constexpr bool isunordered(floating-point-type x, floating-point-type y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
// [sf.cmath], mathematical special functions
|
| 290 |
|
| 291 |
// [sf.cmath.assoc.laguerre], associated Laguerre polynomials
|
| 292 |
+
floating-point-type assoc_laguerre(unsigned n, unsigned m, floating-point-type x);
|
| 293 |
float assoc_laguerref(unsigned n, unsigned m, float x);
|
| 294 |
long double assoc_laguerrel(unsigned n, unsigned m, long double x);
|
| 295 |
|
| 296 |
// [sf.cmath.assoc.legendre], associated Legendre functions
|
| 297 |
+
floating-point-type assoc_legendre(unsigned l, unsigned m, floating-point-type x);
|
| 298 |
float assoc_legendref(unsigned l, unsigned m, float x);
|
| 299 |
long double assoc_legendrel(unsigned l, unsigned m, long double x);
|
| 300 |
|
| 301 |
// [sf.cmath.beta], beta function
|
| 302 |
+
floating-point-type beta(floating-point-type x, floating-point-type y);
|
| 303 |
float betaf(float x, float y);
|
| 304 |
long double betal(long double x, long double y);
|
| 305 |
|
| 306 |
// [sf.cmath.comp.ellint.1], complete elliptic integral of the first kind
|
| 307 |
+
floating-point-type comp_ellint_1(floating-point-type k);
|
| 308 |
float comp_ellint_1f(float k);
|
| 309 |
long double comp_ellint_1l(long double k);
|
| 310 |
|
| 311 |
// [sf.cmath.comp.ellint.2], complete elliptic integral of the second kind
|
| 312 |
+
floating-point-type comp_ellint_2(floating-point-type k);
|
| 313 |
float comp_ellint_2f(float k);
|
| 314 |
long double comp_ellint_2l(long double k);
|
| 315 |
|
| 316 |
// [sf.cmath.comp.ellint.3], complete elliptic integral of the third kind
|
| 317 |
+
floating-point-type comp_ellint_3(floating-point-type k, floating-point-type nu);
|
| 318 |
float comp_ellint_3f(float k, float nu);
|
| 319 |
long double comp_ellint_3l(long double k, long double nu);
|
| 320 |
|
| 321 |
// [sf.cmath.cyl.bessel.i], regular modified cylindrical Bessel functions
|
| 322 |
+
floating-point-type cyl_bessel_i(floating-point-type nu, floating-point-type x);
|
| 323 |
float cyl_bessel_if(float nu, float x);
|
| 324 |
long double cyl_bessel_il(long double nu, long double x);
|
| 325 |
|
| 326 |
// [sf.cmath.cyl.bessel.j], cylindrical Bessel functions of the first kind
|
| 327 |
+
floating-point-type cyl_bessel_j(floating-point-type nu, floating-point-type x);
|
| 328 |
float cyl_bessel_jf(float nu, float x);
|
| 329 |
long double cyl_bessel_jl(long double nu, long double x);
|
| 330 |
|
| 331 |
// [sf.cmath.cyl.bessel.k], irregular modified cylindrical Bessel functions
|
| 332 |
+
floating-point-type cyl_bessel_k(floating-point-type nu, floating-point-type x);
|
| 333 |
float cyl_bessel_kf(float nu, float x);
|
| 334 |
long double cyl_bessel_kl(long double nu, long double x);
|
| 335 |
|
| 336 |
+
// [sf.cmath.cyl.neumann], cylindrical Neumann functions
|
| 337 |
// cylindrical Bessel functions of the second kind
|
| 338 |
+
floating-point-type cyl_neumann(floating-point-type nu, floating-point-type x);
|
| 339 |
float cyl_neumannf(float nu, float x);
|
| 340 |
long double cyl_neumannl(long double nu, long double x);
|
| 341 |
|
| 342 |
// [sf.cmath.ellint.1], incomplete elliptic integral of the first kind
|
| 343 |
+
floating-point-type ellint_1(floating-point-type k, floating-point-type phi);
|
| 344 |
float ellint_1f(float k, float phi);
|
| 345 |
long double ellint_1l(long double k, long double phi);
|
| 346 |
|
| 347 |
// [sf.cmath.ellint.2], incomplete elliptic integral of the second kind
|
| 348 |
+
floating-point-type ellint_2(floating-point-type k, floating-point-type phi);
|
| 349 |
float ellint_2f(float k, float phi);
|
| 350 |
long double ellint_2l(long double k, long double phi);
|
| 351 |
|
| 352 |
// [sf.cmath.ellint.3], incomplete elliptic integral of the third kind
|
| 353 |
+
floating-point-type ellint_3(floating-point-type k, floating-point-type nu,
|
| 354 |
+
floating-point-type phi);
|
| 355 |
float ellint_3f(float k, float nu, float phi);
|
| 356 |
long double ellint_3l(long double k, long double nu, long double phi);
|
| 357 |
|
| 358 |
// [sf.cmath.expint], exponential integral
|
| 359 |
+
floating-point-type expint(floating-point-type x);
|
| 360 |
float expintf(float x);
|
| 361 |
long double expintl(long double x);
|
| 362 |
|
| 363 |
// [sf.cmath.hermite], Hermite polynomials
|
| 364 |
+
floating-point-type hermite(unsigned n, floating-point-type x);
|
| 365 |
float hermitef(unsigned n, float x);
|
| 366 |
long double hermitel(unsigned n, long double x);
|
| 367 |
|
| 368 |
// [sf.cmath.laguerre], Laguerre polynomials
|
| 369 |
+
floating-point-type laguerre(unsigned n, floating-point-type x);
|
| 370 |
float laguerref(unsigned n, float x);
|
| 371 |
long double laguerrel(unsigned n, long double x);
|
| 372 |
|
| 373 |
// [sf.cmath.legendre], Legendre polynomials
|
| 374 |
+
floating-point-type legendre(unsigned l, floating-point-type x);
|
| 375 |
float legendref(unsigned l, float x);
|
| 376 |
long double legendrel(unsigned l, long double x);
|
| 377 |
|
| 378 |
// [sf.cmath.riemann.zeta], Riemann zeta function
|
| 379 |
+
floating-point-type riemann_zeta(floating-point-type x);
|
| 380 |
float riemann_zetaf(float x);
|
| 381 |
long double riemann_zetal(long double x);
|
| 382 |
|
| 383 |
// [sf.cmath.sph.bessel], spherical Bessel functions of the first kind
|
| 384 |
+
floating-point-type sph_bessel(unsigned n, floating-point-type x);
|
| 385 |
float sph_besself(unsigned n, float x);
|
| 386 |
long double sph_bessell(unsigned n, long double x);
|
| 387 |
|
| 388 |
// [sf.cmath.sph.legendre], spherical associated Legendre functions
|
| 389 |
+
floating-point-type sph_legendre(unsigned l, unsigned m, floating-point-type theta);
|
| 390 |
float sph_legendref(unsigned l, unsigned m, float theta);
|
| 391 |
long double sph_legendrel(unsigned l, unsigned m, long double theta);
|
| 392 |
|
| 393 |
// [sf.cmath.sph.neumann], spherical Neumann functions;
|
| 394 |
// spherical Bessel functions of the second kind
|
| 395 |
+
floating-point-type sph_neumann(unsigned n, floating-point-type x);
|
| 396 |
float sph_neumannf(unsigned n, float x);
|
| 397 |
long double sph_neumannl(unsigned n, long double x);
|
| 398 |
}
|
| 399 |
```
|
| 400 |
|
| 401 |
The contents and meaning of the header `<cmath>` are the same as the C
|
| 402 |
standard library header `<math.h>`, with the addition of a
|
| 403 |
+
three-dimensional hypotenuse function [[c.math.hypot3]], a linear
|
| 404 |
+
interpolation function [[c.math.lerp]], and the mathematical special
|
| 405 |
+
functions described in [[sf.cmath]].
|
| 406 |
|
| 407 |
[*Note 1*: Several functions have additional overloads in this
|
| 408 |
document, but they have the same behavior as in the C standard library
|
| 409 |
[[library.c]]. — *end note*]
|
| 410 |
|
| 411 |
+
For each function with at least one parameter of type
|
| 412 |
+
*floating-point-type*, the implementation provides an overload for each
|
| 413 |
+
cv-unqualified floating-point type [[basic.fundamental]] where all uses
|
| 414 |
+
of *floating-point-type* in the function signature are replaced with
|
| 415 |
+
that floating-point type.
|
| 416 |
|
| 417 |
+
For each function with at least one parameter of type
|
| 418 |
+
*floating-point-type* other than `abs`, the implementation also provides
|
| 419 |
+
additional overloads sufficient to ensure that, if every argument
|
| 420 |
+
corresponding to a *floating-point-type* parameter has arithmetic type,
|
| 421 |
+
then every such argument is effectively cast to the floating-point type
|
| 422 |
+
with the greatest floating-point conversion rank and greatest
|
| 423 |
+
floating-point conversion subrank among the types of all such arguments,
|
| 424 |
+
where arguments of integer type are considered to have the same
|
| 425 |
+
floating-point conversion rank as `double`. If no such floating-point
|
| 426 |
+
type with the greatest rank and subrank exists, then overload resolution
|
| 427 |
+
does not result in a usable candidate [[over.match.general]] from the
|
| 428 |
+
overloads provided by the implementation.
|
| 429 |
|
| 430 |
+
An invocation of `nexttoward` is ill-formed if the argument
|
| 431 |
+
corresponding to the *floating-point-type* parameter has extended
|
| 432 |
+
floating-point type.
|
| 433 |
|
| 434 |
+
See also: ISO C 7.12
|
| 435 |
|
| 436 |
### Absolute values <a id="c.math.abs">[[c.math.abs]]</a>
|
| 437 |
|
| 438 |
[*Note 1*: The headers `<cstdlib>` and `<cmath>` declare the functions
|
| 439 |
described in this subclause. — *end note*]
|
| 440 |
|
| 441 |
``` cpp
|
| 442 |
+
constexpr int abs(int j);
|
| 443 |
+
constexpr long int abs(long int j);
|
| 444 |
+
constexpr long long int abs(long long int j);
|
|
|
|
|
|
|
|
|
|
| 445 |
```
|
| 446 |
|
| 447 |
+
*Effects:* These functions have the semantics specified in the C
|
| 448 |
+
standard library for the functions `abs`, `labs`, and `llabs`,
|
| 449 |
+
respectively.
|
| 450 |
|
| 451 |
+
*Remarks:* If `abs` is called with an argument of type `X` for which
|
| 452 |
`is_unsigned_v<X>` is `true` and if `X` cannot be converted to `int` by
|
| 453 |
integral promotion [[conv.prom]], the program is ill-formed.
|
| 454 |
|
| 455 |
[*Note 1*: Arguments that can be promoted to `int` are permitted for
|
| 456 |
compatibility with C. — *end note*]
|
| 457 |
|
| 458 |
+
``` cpp
|
| 459 |
+
constexpr floating-point-type abs(floating-point-type x);
|
| 460 |
+
```
|
| 461 |
+
|
| 462 |
+
*Returns:* The absolute value of `x`.
|
| 463 |
+
|
| 464 |
See also: ISO C 7.12.7.2, 7.22.6.1
|
| 465 |
|
| 466 |
### Three-dimensional hypotenuse <a id="c.math.hypot3">[[c.math.hypot3]]</a>
|
| 467 |
|
| 468 |
``` cpp
|
| 469 |
+
floating-point-type hypot(floating-point-type x, floating-point-type y, floating-point-type z);
|
|
|
|
|
|
|
| 470 |
```
|
| 471 |
|
| 472 |
*Returns:* $\sqrt{x^2+y^2+z^2}$.
|
| 473 |
|
| 474 |
### Linear interpolation <a id="c.math.lerp">[[c.math.lerp]]</a>
|
| 475 |
|
| 476 |
``` cpp
|
| 477 |
+
constexpr floating-point-type lerp(floating-point-type a, floating-point-type b,
|
| 478 |
+
floating-point-type t) noexcept;
|
|
|
|
| 479 |
```
|
| 480 |
|
| 481 |
*Returns:* a+t(b-a).
|
| 482 |
|
| 483 |
*Remarks:* Let `r` be the value returned. If
|
|
|
|
| 496 |
|
| 497 |
### Classification / comparison functions <a id="c.math.fpclass">[[c.math.fpclass]]</a>
|
| 498 |
|
| 499 |
The classification / comparison functions behave the same as the C
|
| 500 |
macros with the corresponding names defined in the C standard library.
|
|
|
|
| 501 |
|
| 502 |
+
See also: ISO C 7.12.3, 7.12.4
|
| 503 |
|
| 504 |
### Mathematical special functions <a id="sf.cmath">[[sf.cmath]]</a>
|
| 505 |
|
| 506 |
+
#### General <a id="sf.cmath.general">[[sf.cmath.general]]</a>
|
|
|
|
|
|
|
|
|
|
| 507 |
|
| 508 |
+
If any argument value to any of the functions specified in [[sf.cmath]]
|
| 509 |
+
is a NaN (Not a Number), the function shall return a NaN but it shall
|
| 510 |
+
not report a domain error. Otherwise, the function shall report a domain
|
| 511 |
+
error for just those argument values for which:
|
| 512 |
+
|
| 513 |
+
- the function description’s *Returns:* element explicitly specifies a
|
| 514 |
domain and those argument values fall outside the specified domain, or
|
| 515 |
- the corresponding mathematical function value has a nonzero imaginary
|
| 516 |
component, or
|
| 517 |
- the corresponding mathematical function is not mathematically
|
| 518 |
+
defined.[^14]
|
| 519 |
|
| 520 |
Unless otherwise specified, each function is defined for all finite
|
| 521 |
values, for negative infinity, and for positive infinity.
|
| 522 |
|
| 523 |
#### Associated Laguerre polynomials <a id="sf.cmath.assoc.laguerre">[[sf.cmath.assoc.laguerre]]</a>
|
| 524 |
|
| 525 |
``` cpp
|
| 526 |
+
floating-point-type assoc_laguerre(unsigned n, unsigned m, floating-point-type x);
|
| 527 |
float assoc_laguerref(unsigned n, unsigned m, float x);
|
| 528 |
long double assoc_laguerrel(unsigned n, unsigned m, long double x);
|
| 529 |
```
|
| 530 |
|
| 531 |
*Effects:* These functions compute the associated Laguerre polynomials
|
|
|
|
| 540 |
*implementation-defined* if `n >= 128` or if `m >= 128`.
|
| 541 |
|
| 542 |
#### Associated Legendre functions <a id="sf.cmath.assoc.legendre">[[sf.cmath.assoc.legendre]]</a>
|
| 543 |
|
| 544 |
``` cpp
|
| 545 |
+
floating-point-type assoc_legendre(unsigned l, unsigned m, floating-point-type x);
|
| 546 |
float assoc_legendref(unsigned l, unsigned m, float x);
|
| 547 |
long double assoc_legendrel(unsigned l, unsigned m, long double x);
|
| 548 |
```
|
| 549 |
|
| 550 |
*Effects:* These functions compute the associated Legendre functions of
|
|
|
|
| 559 |
*implementation-defined* if `l >= 128`.
|
| 560 |
|
| 561 |
#### Beta function <a id="sf.cmath.beta">[[sf.cmath.beta]]</a>
|
| 562 |
|
| 563 |
``` cpp
|
| 564 |
+
floating-point-type beta(floating-point-type x, floating-point-type y);
|
| 565 |
float betaf(float x, float y);
|
| 566 |
long double betal(long double x, long double y);
|
| 567 |
```
|
| 568 |
|
| 569 |
*Effects:* These functions compute the beta function of their respective
|
|
|
|
| 574 |
\text{ ,\quad for $x > 0$,\, $y > 0$,}$$ where x is `x` and y is `y`.
|
| 575 |
|
| 576 |
#### Complete elliptic integral of the first kind <a id="sf.cmath.comp.ellint.1">[[sf.cmath.comp.ellint.1]]</a>
|
| 577 |
|
| 578 |
``` cpp
|
| 579 |
+
floating-point-type comp_ellint_1(floating-point-type k);
|
| 580 |
float comp_ellint_1f(float k);
|
| 581 |
long double comp_ellint_1l(long double k);
|
| 582 |
```
|
| 583 |
|
| 584 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
|
|
| 591 |
See also [[sf.cmath.ellint.1]].
|
| 592 |
|
| 593 |
#### Complete elliptic integral of the second kind <a id="sf.cmath.comp.ellint.2">[[sf.cmath.comp.ellint.2]]</a>
|
| 594 |
|
| 595 |
``` cpp
|
| 596 |
+
floating-point-type comp_ellint_2(floating-point-type k);
|
| 597 |
float comp_ellint_2f(float k);
|
| 598 |
long double comp_ellint_2l(long double k);
|
| 599 |
```
|
| 600 |
|
| 601 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
|
|
| 608 |
See also [[sf.cmath.ellint.2]].
|
| 609 |
|
| 610 |
#### Complete elliptic integral of the third kind <a id="sf.cmath.comp.ellint.3">[[sf.cmath.comp.ellint.3]]</a>
|
| 611 |
|
| 612 |
``` cpp
|
| 613 |
+
floating-point-type comp_ellint_3(floating-point-type k, floating-point-type nu);
|
| 614 |
float comp_ellint_3f(float k, float nu);
|
| 615 |
long double comp_ellint_3l(long double k, long double nu);
|
| 616 |
```
|
| 617 |
|
| 618 |
*Effects:* These functions compute the complete elliptic integral of the
|
|
|
|
| 625 |
See also [[sf.cmath.ellint.3]].
|
| 626 |
|
| 627 |
#### Regular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.i">[[sf.cmath.cyl.bessel.i]]</a>
|
| 628 |
|
| 629 |
``` cpp
|
| 630 |
+
floating-point-type cyl_bessel_i(floating-point-type nu, floating-point-type x);
|
| 631 |
float cyl_bessel_if(float nu, float x);
|
| 632 |
long double cyl_bessel_il(long double nu, long double x);
|
| 633 |
```
|
| 634 |
|
| 635 |
*Effects:* These functions compute the regular modified cylindrical
|
|
|
|
| 646 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 647 |
|
| 648 |
#### Cylindrical Bessel functions of the first kind <a id="sf.cmath.cyl.bessel.j">[[sf.cmath.cyl.bessel.j]]</a>
|
| 649 |
|
| 650 |
``` cpp
|
| 651 |
+
floating-point-type cyl_bessel_j(floating-point-type nu, floating-point-type x);
|
| 652 |
float cyl_bessel_jf(float nu, float x);
|
| 653 |
long double cyl_bessel_jl(long double nu, long double x);
|
| 654 |
```
|
| 655 |
|
| 656 |
*Effects:* These functions compute the cylindrical Bessel functions of
|
|
|
|
| 664 |
*implementation-defined* if `nu >= 128`.
|
| 665 |
|
| 666 |
#### Irregular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.k">[[sf.cmath.cyl.bessel.k]]</a>
|
| 667 |
|
| 668 |
``` cpp
|
| 669 |
+
floating-point-type cyl_bessel_k(floating-point-type nu, floating-point-type x);
|
| 670 |
float cyl_bessel_kf(float nu, float x);
|
| 671 |
long double cyl_bessel_kl(long double nu, long double x);
|
| 672 |
```
|
| 673 |
|
| 674 |
*Effects:* These functions compute the irregular modified cylindrical
|
|
|
|
| 704 |
[[sf.cmath.cyl.neumann]].
|
| 705 |
|
| 706 |
#### Cylindrical Neumann functions <a id="sf.cmath.cyl.neumann">[[sf.cmath.cyl.neumann]]</a>
|
| 707 |
|
| 708 |
``` cpp
|
| 709 |
+
floating-point-type cyl_neumann(floating-point-type nu, floating-point-type x);
|
| 710 |
float cyl_neumannf(float nu, float x);
|
| 711 |
long double cyl_neumannl(long double nu, long double x);
|
| 712 |
```
|
| 713 |
|
| 714 |
*Effects:* These functions compute the cylindrical Neumann functions,
|
|
|
|
| 738 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 739 |
|
| 740 |
#### Incomplete elliptic integral of the first kind <a id="sf.cmath.ellint.1">[[sf.cmath.ellint.1]]</a>
|
| 741 |
|
| 742 |
``` cpp
|
| 743 |
+
floating-point-type ellint_1(floating-point-type k, floating-point-type phi);
|
| 744 |
float ellint_1f(float k, float phi);
|
| 745 |
long double ellint_1l(long double k, long double phi);
|
| 746 |
```
|
| 747 |
|
| 748 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
|
|
| 754 |
\text{ ,\quad for $|k| \le 1$,}$$ where k is `k` and φ is `phi`.
|
| 755 |
|
| 756 |
#### Incomplete elliptic integral of the second kind <a id="sf.cmath.ellint.2">[[sf.cmath.ellint.2]]</a>
|
| 757 |
|
| 758 |
``` cpp
|
| 759 |
+
floating-point-type ellint_2(floating-point-type k, floating-point-type phi);
|
| 760 |
float ellint_2f(float k, float phi);
|
| 761 |
long double ellint_2l(long double k, long double phi);
|
| 762 |
```
|
| 763 |
|
| 764 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
|
|
| 770 |
\text{ ,\quad for $|k| \le 1$,}$$ where k is `k` and φ is `phi`.
|
| 771 |
|
| 772 |
#### Incomplete elliptic integral of the third kind <a id="sf.cmath.ellint.3">[[sf.cmath.ellint.3]]</a>
|
| 773 |
|
| 774 |
``` cpp
|
| 775 |
+
floating-point-type ellint_3(floating-point-type k, floating-point-type nu,
|
| 776 |
+
floating-point-type phi);
|
| 777 |
float ellint_3f(float k, float nu, float phi);
|
| 778 |
long double ellint_3l(long double k, long double nu, long double phi);
|
| 779 |
```
|
| 780 |
|
| 781 |
*Effects:* These functions compute the incomplete elliptic integral of
|
|
|
|
| 787 |
where $\nu$ is `nu`, k is `k`, and φ is `phi`.
|
| 788 |
|
| 789 |
#### Exponential integral <a id="sf.cmath.expint">[[sf.cmath.expint]]</a>
|
| 790 |
|
| 791 |
``` cpp
|
| 792 |
+
floating-point-type expint(floating-point-type x);
|
| 793 |
float expintf(float x);
|
| 794 |
long double expintl(long double x);
|
| 795 |
```
|
| 796 |
|
| 797 |
*Effects:* These functions compute the exponential integral of their
|
|
|
|
| 804 |
\;$$ where x is `x`.
|
| 805 |
|
| 806 |
#### Hermite polynomials <a id="sf.cmath.hermite">[[sf.cmath.hermite]]</a>
|
| 807 |
|
| 808 |
``` cpp
|
| 809 |
+
floating-point-type hermite(unsigned n, floating-point-type x);
|
| 810 |
float hermitef(unsigned n, float x);
|
| 811 |
long double hermitel(unsigned n, long double x);
|
| 812 |
```
|
| 813 |
|
| 814 |
*Effects:* These functions compute the Hermite polynomials of their
|
|
|
|
| 824 |
*implementation-defined* if `n >= 128`.
|
| 825 |
|
| 826 |
#### Laguerre polynomials <a id="sf.cmath.laguerre">[[sf.cmath.laguerre]]</a>
|
| 827 |
|
| 828 |
``` cpp
|
| 829 |
+
floating-point-type laguerre(unsigned n, floating-point-type x);
|
| 830 |
float laguerref(unsigned n, float x);
|
| 831 |
long double laguerrel(unsigned n, long double x);
|
| 832 |
```
|
| 833 |
|
| 834 |
*Effects:* These functions compute the Laguerre polynomials of their
|
|
|
|
| 842 |
*implementation-defined* if `n >= 128`.
|
| 843 |
|
| 844 |
#### Legendre polynomials <a id="sf.cmath.legendre">[[sf.cmath.legendre]]</a>
|
| 845 |
|
| 846 |
``` cpp
|
| 847 |
+
floating-point-type legendre(unsigned l, floating-point-type x);
|
| 848 |
float legendref(unsigned l, float x);
|
| 849 |
long double legendrel(unsigned l, long double x);
|
| 850 |
```
|
| 851 |
|
| 852 |
*Effects:* These functions compute the Legendre polynomials of their
|
|
|
|
| 861 |
*implementation-defined* if `l >= 128`.
|
| 862 |
|
| 863 |
#### Riemann zeta function <a id="sf.cmath.riemann.zeta">[[sf.cmath.riemann.zeta]]</a>
|
| 864 |
|
| 865 |
``` cpp
|
| 866 |
+
floating-point-type riemann_zeta(floating-point-type x);
|
| 867 |
float riemann_zetaf(float x);
|
| 868 |
long double riemann_zetal(long double x);
|
| 869 |
```
|
| 870 |
|
| 871 |
*Effects:* These functions compute the Riemann zeta function of their
|
|
|
|
| 895 |
\;$$ where x is `x`.
|
| 896 |
|
| 897 |
#### Spherical Bessel functions of the first kind <a id="sf.cmath.sph.bessel">[[sf.cmath.sph.bessel]]</a>
|
| 898 |
|
| 899 |
``` cpp
|
| 900 |
+
floating-point-type sph_bessel(unsigned n, floating-point-type x);
|
| 901 |
float sph_besself(unsigned n, float x);
|
| 902 |
long double sph_bessell(unsigned n, long double x);
|
| 903 |
```
|
| 904 |
|
| 905 |
*Effects:* These functions compute the spherical Bessel functions of the
|
|
|
|
| 915 |
See also [[sf.cmath.cyl.bessel.j]].
|
| 916 |
|
| 917 |
#### Spherical associated Legendre functions <a id="sf.cmath.sph.legendre">[[sf.cmath.sph.legendre]]</a>
|
| 918 |
|
| 919 |
``` cpp
|
| 920 |
+
floating-point-type sph_legendre(unsigned l, unsigned m, floating-point-type theta);
|
| 921 |
float sph_legendref(unsigned l, unsigned m, float theta);
|
| 922 |
long double sph_legendrel(unsigned l, unsigned m, long double theta);
|
| 923 |
```
|
| 924 |
|
| 925 |
*Effects:* These functions compute the spherical associated Legendre
|
|
|
|
| 939 |
See also [[sf.cmath.assoc.legendre]].
|
| 940 |
|
| 941 |
#### Spherical Neumann functions <a id="sf.cmath.sph.neumann">[[sf.cmath.sph.neumann]]</a>
|
| 942 |
|
| 943 |
``` cpp
|
| 944 |
+
floating-point-type sph_neumann(unsigned n, floating-point-type x);
|
| 945 |
float sph_neumannf(unsigned n, float x);
|
| 946 |
long double sph_neumannl(unsigned n, long double x);
|
| 947 |
```
|
| 948 |
|
| 949 |
*Effects:* These functions compute the spherical Neumann functions, also
|