From Jason Turner

[c.math]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpn_on3zfp/{from.md → to.md} +151 -233
tmp/tmpn_on3zfp/{from.md → to.md} RENAMED
@@ -1,15 +1,10 @@
1
  ## Mathematical functions for floating-point types <a id="c.math">[[c.math]]</a>
2
 
3
  ### Header `<cmath>` synopsis <a id="cmath.syn">[[cmath.syn]]</a>
4
 
5
  ``` cpp
6
- namespace std {
7
- using float_t = see below;
8
- using double_t = see below;
9
- }
10
-
11
  #define HUGE_VAL see below
12
  #define HUGE_VALF see below
13
  #define HUGE_VALL see below
14
  #define INFINITY see below
15
  #define NAN see below
@@ -27,73 +22,76 @@ namespace std {
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
 
@@ -103,25 +101,25 @@ namespace std {
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
 
@@ -135,55 +133,55 @@ namespace std {
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
 
@@ -249,10 +247,18 @@ namespace std {
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);
@@ -261,10 +267,15 @@ namespace std {
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
 
@@ -396,41 +407,42 @@ namespace std {
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>
@@ -450,25 +462,26 @@ 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>
@@ -497,11 +510,11 @@ otherwise. For any `t1` and `t2`, the product of
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
 
@@ -529,14 +542,12 @@ long double assoc_laguerrel(unsigned n, unsigned m, long double x);
529
  ```
530
 
531
  *Effects:* These functions compute the associated Laguerre polynomials
532
  of their respective arguments `n`, `m`, and `x`.
533
 
534
- *Returns:* $$\mathsf{L}_n^m(x) =
535
- (-1)^m \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{L}_{n+m}(x)
536
- \text{ ,\quad for $x \ge 0$,}$$ where n is `n`, m is `m`, and x is
537
- `x`.
538
 
539
  *Remarks:* The effect of calling each of these functions is
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>
@@ -548,14 +559,12 @@ long double assoc_legendrel(unsigned l, unsigned m, long double x);
548
  ```
549
 
550
  *Effects:* These functions compute the associated Legendre functions of
551
  their respective arguments `l`, `m`, and `x`.
552
 
553
- *Returns:* $$\mathsf{P}_\ell^m(x) = (1 - x^2) ^ {m/2} \:
554
- \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{P}_\ell(x)
555
- \text{ ,\quad for $|x| \le 1$,}$$ where l is `l`, m is `m`, and x is
556
- `x`.
557
 
558
  *Remarks:* The effect of calling each of these functions is
559
  *implementation-defined* if `l >= 128`.
560
 
561
  #### Beta function <a id="sf.cmath.beta">[[sf.cmath.beta]]</a>
@@ -567,13 +576,11 @@ long double betal(long double x, long double y);
567
  ```
568
 
569
  *Effects:* These functions compute the beta function of their respective
570
  arguments `x` and `y`.
571
 
572
- *Returns:*
573
- $$\mathsf{B}(x, y) = \frac{\Gamma(x) \, \Gamma(y)}{\Gamma(x + y)}
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);
@@ -582,13 +589,11 @@ long double comp_ellint_1l(long double k);
582
  ```
583
 
584
  *Effects:* These functions compute the complete elliptic integral of the
585
  first kind of their respective arguments `k`.
586
 
587
- *Returns:*
588
- $$\mathsf{K}(k) = \mathsf{F}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$,}$$
589
- where k is `k`.
590
 
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
 
@@ -599,13 +604,11 @@ long double comp_ellint_2l(long double k);
599
  ```
600
 
601
  *Effects:* These functions compute the complete elliptic integral of the
602
  second kind of their respective arguments `k`.
603
 
604
- *Returns:*
605
- $$\mathsf{E}(k) = \mathsf{E}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$,}$$
606
- where k is `k`.
607
 
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
 
@@ -616,13 +619,12 @@ long double comp_ellint_3l(long double k, long double nu);
616
  ```
617
 
618
  *Effects:* These functions compute the complete elliptic integral of the
619
  third kind of their respective arguments `k` and `nu`.
620
 
621
- *Returns:*
622
- $$\mathsf{\Pi}(\nu, k) = \mathsf{\Pi}(\nu, k, \pi / 2) \text{ ,\quad for $|k| \le 1$,}$$
623
- where k is `k` and $\nu$ is `nu`.
624
 
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
 
@@ -633,14 +635,12 @@ long double cyl_bessel_il(long double nu, long double x);
633
  ```
634
 
635
  *Effects:* These functions compute the regular modified cylindrical
636
  Bessel functions of their respective arguments `nu` and `x`.
637
 
638
- *Returns:* $$\mathsf{I}_\nu(x) =
639
- i^{-\nu} \mathsf{J}_\nu(ix) =
640
- \sum_{k=0}^\infty \frac{(x/2)^{\nu+2k}}{k! \: \Gamma(\nu+k+1)}
641
- \text{ ,\quad for $x \ge 0$,}$$ where $\nu$ is `nu` and x is `x`.
642
 
643
  *Remarks:* The effect of calling each of these functions is
644
  *implementation-defined* if `nu >= 128`.
645
 
646
  See also [[sf.cmath.cyl.bessel.j]].
@@ -654,13 +654,12 @@ long double cyl_bessel_jl(long double nu, long double x);
654
  ```
655
 
656
  *Effects:* These functions compute the cylindrical Bessel functions of
657
  the first kind of their respective arguments `nu` and `x`.
658
 
659
- *Returns:* $$\mathsf{J}_\nu(x) =
660
- \sum_{k=0}^\infty \frac{(-1)^k (x/2)^{\nu+2k}}{k! \: \Gamma(\nu+k+1)}
661
- \text{ ,\quad for $x \ge 0$,}$$ where $\nu$ is `nu` and x is `x`.
662
 
663
  *Remarks:* The effect of calling each of these functions is
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>
@@ -672,32 +671,12 @@ long double cyl_bessel_kl(long double nu, long double x);
672
  ```
673
 
674
  *Effects:* These functions compute the irregular modified cylindrical
675
  Bessel functions of their respective arguments `nu` and `x`.
676
 
677
- *Returns:* $$%
678
- \mathsf{K}_\nu(x) =
679
- (\pi/2)i^{\nu+1} ( \mathsf{J}_\nu(ix)
680
- + i \mathsf{N}_\nu(ix)
681
- )
682
- =
683
- \left\{
684
- \begin{array}{cl}
685
- \displaystyle
686
- \frac{\pi}{2}
687
- \frac{\mathsf{I}_{-\nu}(x) - \mathsf{I}_{\nu}(x)}
688
- {\sin \nu\pi },
689
- & \mbox{for $x \ge 0$ and non-integral $\nu$}
690
- \\
691
- \\
692
- \displaystyle
693
- \frac{\pi}{2}
694
- \lim_{\mu \rightarrow \nu} \frac{\mathsf{I}_{-\mu}(x) - \mathsf{I}_{\mu}(x)}
695
- {\sin \mu\pi },
696
- & \mbox{for $x \ge 0$ and integral $\nu$}
697
- \end{array}
698
- \right.$$ where $\nu$ is `nu` and x is `x`.
699
 
700
  *Remarks:* The effect of calling each of these functions is
701
  *implementation-defined* if `nu >= 128`.
702
 
703
  See also [[sf.cmath.cyl.bessel.i]], [[sf.cmath.cyl.bessel.j]],
@@ -713,26 +692,12 @@ long double cyl_neumannl(long double nu, long double x);
713
 
714
  *Effects:* These functions compute the cylindrical Neumann functions,
715
  also known as the cylindrical Bessel functions of the second kind, of
716
  their respective arguments `nu` and `x`.
717
 
718
- *Returns:* $$%
719
- \mathsf{N}_\nu(x) =
720
- \left\{
721
- \begin{array}{cl}
722
- \displaystyle
723
- \frac{\mathsf{J}_\nu(x) \cos \nu\pi - \mathsf{J}_{-\nu}(x)}
724
- {\sin \nu\pi },
725
- & \mbox{for $x \ge 0$ and non-integral $\nu$}
726
- \\
727
- \\
728
- \displaystyle
729
- \lim_{\mu \rightarrow \nu} \frac{\mathsf{J}_\mu(x) \cos \mu\pi - \mathsf{J}_{-\mu}(x)}
730
- {\sin \mu\pi },
731
- & \mbox{for $x \ge 0$ and integral $\nu$}
732
- \end{array}
733
- \right.$$ where $\nu$ is `nu` and x is `x`.
734
 
735
  *Remarks:* The effect of calling each of these functions is
736
  *implementation-defined* if `nu >= 128`.
737
 
738
  See also [[sf.cmath.cyl.bessel.j]].
@@ -747,13 +712,11 @@ long double ellint_1l(long double k, long double phi);
747
 
748
  *Effects:* These functions compute the incomplete elliptic integral of
749
  the first kind of their respective arguments `k` and `phi` (`phi`
750
  measured in radians).
751
 
752
- *Returns:* $$\mathsf{F}(k, \phi) =
753
- \int_0^\phi \! \frac{\mathsf{d}\theta}{\sqrt{1 - k^2 \sin^2 \theta}}
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);
@@ -763,13 +726,11 @@ long double ellint_2l(long double k, long double phi);
763
 
764
  *Effects:* These functions compute the incomplete elliptic integral of
765
  the second kind of their respective arguments `k` and `phi` (`phi`
766
  measured in radians).
767
 
768
- *Returns:*
769
- $$\mathsf{E}(k, \phi) = \int_0^\phi \! \sqrt{1 - k^2 \sin^2 \theta} \, \mathsf{d}\theta
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,
@@ -780,13 +741,12 @@ long double ellint_3l(long double k, long double nu, long double phi);
780
 
781
  *Effects:* These functions compute the incomplete elliptic integral of
782
  the third kind of their respective arguments `k`, `nu`, and `phi` (`phi`
783
  measured in radians).
784
 
785
- *Returns:* $$\mathsf{\Pi}(\nu, k, \phi) = \int_0^\phi \!
786
- \frac{ \mathsf{d}\theta }{ (1 - \nu \, \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta} } \text{ ,\quad for $|k| \le 1$,}$$
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);
@@ -795,15 +755,11 @@ long double expintl(long double x);
795
  ```
796
 
797
  *Effects:* These functions compute the exponential integral of their
798
  respective arguments `x`.
799
 
800
- *Returns:* $$%
801
- \mathsf{Ei}(x) =
802
- - \int_{-x}^\infty \frac{e^{-t}}
803
- {t } \, \mathsf{d}t
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);
@@ -812,15 +768,11 @@ long double hermitel(unsigned n, long double x);
812
  ```
813
 
814
  *Effects:* These functions compute the Hermite polynomials of their
815
  respective arguments `n` and `x`.
816
 
817
- *Returns:* $$%
818
- \mathsf{H}_n(x) =
819
- (-1)^n e^{x^2} \frac{ \mathsf{d} ^n}
820
- { \mathsf{d}x^n} \, e^{-x^2}
821
- \;$$ where n is `n` and x is `x`.
822
 
823
  *Remarks:* The effect of calling each of these functions is
824
  *implementation-defined* if `n >= 128`.
825
 
826
  #### Laguerre polynomials <a id="sf.cmath.laguerre">[[sf.cmath.laguerre]]</a>
@@ -832,13 +784,11 @@ long double laguerrel(unsigned n, long double x);
832
  ```
833
 
834
  *Effects:* These functions compute the Laguerre polynomials of their
835
  respective arguments `n` and `x`.
836
 
837
- *Returns:* $$\mathsf{L}_n(x) =
838
- \frac{e^x}{n!} \frac{\mathsf{d}^n}{\mathsf{d}x^n} \, (x^n e^{-x})
839
- \text{ ,\quad for $x \ge 0$,}$$ where n is `n` and x is `x`.
840
 
841
  *Remarks:* The effect of calling each of these functions is
842
  *implementation-defined* if `n >= 128`.
843
 
844
  #### Legendre polynomials <a id="sf.cmath.legendre">[[sf.cmath.legendre]]</a>
@@ -850,14 +800,11 @@ long double legendrel(unsigned l, long double x);
850
  ```
851
 
852
  *Effects:* These functions compute the Legendre polynomials of their
853
  respective arguments `l` and `x`.
854
 
855
- *Returns:* $$\mathsf{P}_\ell(x) =
856
- \frac{1}{2^\ell \, \ell!}
857
- \frac{\mathsf{d}^\ell}{\mathsf{d}x^\ell} \, (x^2 - 1) ^ \ell
858
- \text{ ,\quad for $|x| \le 1$,}$$ where l is `l` and x is `x`.
859
 
860
  *Remarks:* The effect of calling each of these functions is
861
  *implementation-defined* if `l >= 128`.
862
 
863
  #### Riemann zeta function <a id="sf.cmath.riemann.zeta">[[sf.cmath.riemann.zeta]]</a>
@@ -869,32 +816,11 @@ long double riemann_zetal(long double x);
869
  ```
870
 
871
  *Effects:* These functions compute the Riemann zeta function of their
872
  respective arguments `x`.
873
 
874
- *Returns:* $$%
875
- \mathsf{\zeta}(x) =
876
- \left\{
877
- \begin{array}{cl}
878
- \displaystyle
879
- \sum_{k=1}^\infty k^{-x},
880
- & \mbox{for $x > 1$}
881
- \\
882
- \\
883
- \displaystyle
884
- \frac{1}
885
- {1 - 2^{1-x}}
886
- \sum_{k=1}^\infty (-1)^{k-1} k^{-x},
887
- & \mbox{for $0 \le x \le 1$}
888
- \\
889
- \\
890
- \displaystyle
891
- 2^x \pi^{x-1} \sin(\frac{\pi x}{2}) \, \Gamma(1-x) \, \zeta(1-x),
892
- & \mbox{for $x < 0$}
893
- \end{array}
894
- \right.
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);
@@ -903,13 +829,11 @@ long double sph_bessell(unsigned n, long double x);
903
  ```
904
 
905
  *Effects:* These functions compute the spherical Bessel functions of the
906
  first kind of their respective arguments `n` and `x`.
907
 
908
- *Returns:*
909
- $$\mathsf{j}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{J}_{n + 1\!/\!2}(x) \text{ ,\quad for $x \ge 0$,}$$
910
- where n is `n` and x is `x`.
911
 
912
  *Remarks:* The effect of calling each of these functions is
913
  *implementation-defined* if `n >= 128`.
914
 
915
  See also [[sf.cmath.cyl.bessel.j]].
@@ -924,16 +848,12 @@ long double sph_legendrel(unsigned l, unsigned m, long double theta);
924
 
925
  *Effects:* These functions compute the spherical associated Legendre
926
  functions of their respective arguments `l`, `m`, and `theta` (`theta`
927
  measured in radians).
928
 
929
- *Returns:* $$\mathsf{Y}_\ell^m(\theta, 0)$$ where
930
- $$\mathsf{Y}_\ell^m(\theta, \phi) =
931
- (-1)^m \left[\frac{(2 \ell + 1)}{4 \pi} \frac{(\ell - m)!}{(\ell + m)!}\right]^{1/2}
932
- \mathsf{P}_\ell^m (\cos\theta) e^{i m \phi}
933
- \text{ ,\quad for $|m| \le \ell$,}$$ and l is `l`, m is `m`, and θ
934
- is `theta`.
935
 
936
  *Remarks:* The effect of calling each of these functions is
937
  *implementation-defined* if `l >= 128`.
938
 
939
  See also [[sf.cmath.assoc.legendre]].
@@ -948,13 +868,11 @@ long double sph_neumannl(unsigned n, long double x);
948
 
949
  *Effects:* These functions compute the spherical Neumann functions, also
950
  known as the spherical Bessel functions of the second kind, of their
951
  respective arguments `n` and `x`.
952
 
953
- *Returns:*
954
- $$\mathsf{n}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{N}_{n + 1\!/\!2}(x)
955
- \text{ ,\quad for $x \ge 0$,}$$ where n is `n` and x is `x`.
956
 
957
  *Remarks:* The effect of calling each of these functions is
958
  *implementation-defined* if `n >= 128`.
959
 
960
  See also [[sf.cmath.cyl.neumann]].
 
1
  ## Mathematical functions for floating-point types <a id="c.math">[[c.math]]</a>
2
 
3
  ### Header `<cmath>` synopsis <a id="cmath.syn">[[cmath.syn]]</a>
4
 
5
  ``` cpp
 
 
 
 
 
6
  #define HUGE_VAL see below
7
  #define HUGE_VALF see below
8
  #define HUGE_VALL see below
9
  #define INFINITY see below
10
  #define NAN see below
 
22
  #define MATH_ERREXCEPT see below
23
 
24
  #define math_errhandling see below
25
 
26
  namespace std {
27
+ using float_t = see below;
28
+ using double_t = see below;
 
29
 
30
+ constexpr floating-point-type acos(floating-point-type x);
31
+ constexpr float acosf(float x);
32
+ constexpr long double acosl(long double x);
33
 
34
+ constexpr floating-point-type asin(floating-point-type x);
35
+ constexpr float asinf(float x);
36
+ constexpr long double asinl(long double x);
37
 
38
+ constexpr floating-point-type atan(floating-point-type x);
39
+ constexpr float atanf(float x);
40
+ constexpr long double atanl(long double x);
41
 
42
+ constexpr floating-point-type atan2(floating-point-type y, floating-point-type x);
43
+ constexpr float atan2f(float y, float x);
44
+ constexpr long double atan2l(long double y, long double x);
45
 
46
+ constexpr floating-point-type cos(floating-point-type x);
47
+ constexpr float cosf(float x);
48
+ constexpr long double cosl(long double x);
49
 
50
+ constexpr floating-point-type sin(floating-point-type x);
51
+ constexpr float sinf(float x);
52
+ constexpr long double sinl(long double x);
53
 
54
+ constexpr floating-point-type tan(floating-point-type x);
55
+ constexpr float tanf(float x);
56
+ constexpr long double tanl(long double x);
57
 
58
+ constexpr floating-point-type acosh(floating-point-type x);
59
+ constexpr float acoshf(float x);
60
+ constexpr long double acoshl(long double x);
61
 
62
+ constexpr floating-point-type asinh(floating-point-type x);
63
+ constexpr float asinhf(float x);
64
+ constexpr long double asinhl(long double x);
65
 
66
+ constexpr floating-point-type atanh(floating-point-type x);
67
+ constexpr float atanhf(float x);
68
+ constexpr long double atanhl(long double x);
69
 
70
+ constexpr floating-point-type cosh(floating-point-type x);
71
+ constexpr float coshf(float x);
72
+ constexpr long double coshl(long double x);
73
 
74
+ constexpr floating-point-type sinh(floating-point-type x);
75
+ constexpr float sinhf(float x);
76
+ constexpr long double sinhl(long double x);
77
 
78
+ constexpr floating-point-type tanh(floating-point-type x);
79
+ constexpr float tanhf(float x);
80
+ constexpr long double tanhl(long double x);
81
 
82
+ constexpr floating-point-type exp(floating-point-type x);
83
+ constexpr float expf(float x);
84
+ constexpr long double expl(long double x);
85
 
86
+ constexpr floating-point-type exp2(floating-point-type x);
87
+ constexpr float exp2f(float x);
88
+ constexpr long double exp2l(long double x);
89
+
90
+ constexpr floating-point-type expm1(floating-point-type x);
91
+ constexpr float expm1f(float x);
92
+ constexpr long double expm1l(long double x);
93
 
94
  constexpr floating-point-type frexp(floating-point-type value, int* exp);
95
  constexpr float frexpf(float value, int* exp);
96
  constexpr long double frexpl(long double value, int* exp);
97
 
 
101
 
102
  constexpr floating-point-type ldexp(floating-point-type x, int exp);
103
  constexpr float ldexpf(float x, int exp);
104
  constexpr long double ldexpl(long double x, int exp);
105
 
106
+ constexpr floating-point-type log(floating-point-type x);
107
+ constexpr float logf(float x);
108
+ constexpr long double logl(long double x);
109
 
110
+ constexpr floating-point-type log10(floating-point-type x);
111
+ constexpr float log10f(float x);
112
+ constexpr long double log10l(long double x);
113
 
114
+ constexpr floating-point-type log1p(floating-point-type x);
115
+ constexpr float log1pf(float x);
116
+ constexpr long double log1pl(long double x);
117
 
118
+ constexpr floating-point-type log2(floating-point-type x);
119
+ constexpr float log2f(float x);
120
+ constexpr long double log2l(long double x);
121
 
122
  constexpr floating-point-type logb(floating-point-type x);
123
  constexpr float logbf(float x);
124
  constexpr long double logbl(long double x);
125
 
 
133
 
134
  constexpr floating-point-type scalbln(floating-point-type x, long int n);
135
  constexpr float scalblnf(float x, long int n);
136
  constexpr long double scalblnl(long double x, long int n);
137
 
138
+ constexpr floating-point-type cbrt(floating-point-type x);
139
+ constexpr float cbrtf(float x);
140
+ constexpr long double cbrtl(long double x);
141
 
142
  // [c.math.abs], absolute values
143
+ constexpr int abs(int j); // freestanding
144
+ constexpr long int abs(long int j); // freestanding
145
+ constexpr long long int abs(long long int j); // freestanding
146
+ constexpr floating-point-type abs(floating-point-type j); // freestanding-deleted
147
 
148
  constexpr floating-point-type fabs(floating-point-type x);
149
  constexpr float fabsf(float x);
150
  constexpr long double fabsl(long double x);
151
 
152
+ constexpr floating-point-type hypot(floating-point-type x, floating-point-type y);
153
+ constexpr float hypotf(float x, float y);
154
+ constexpr long double hypotl(long double x, long double y);
155
 
156
  // [c.math.hypot3], three-dimensional hypotenuse
157
+ constexpr floating-point-type hypot(floating-point-type x, floating-point-type y,
158
  floating-point-type z);
159
 
160
+ constexpr floating-point-type pow(floating-point-type x, floating-point-type y);
161
+ constexpr float powf(float x, float y);
162
+ constexpr long double powl(long double x, long double y);
163
 
164
+ constexpr floating-point-type sqrt(floating-point-type x);
165
+ constexpr float sqrtf(float x);
166
+ constexpr long double sqrtl(long double x);
167
 
168
+ constexpr floating-point-type erf(floating-point-type x);
169
+ constexpr float erff(float x);
170
+ constexpr long double erfl(long double x);
171
 
172
+ constexpr floating-point-type erfc(floating-point-type x);
173
+ constexpr float erfcf(float x);
174
+ constexpr long double erfcl(long double x);
175
 
176
+ constexpr floating-point-type lgamma(floating-point-type x);
177
+ constexpr float lgammaf(float x);
178
+ constexpr long double lgammal(long double x);
179
 
180
+ constexpr floating-point-type tgamma(floating-point-type x);
181
+ constexpr float tgammaf(float x);
182
+ constexpr long double tgammal(long double x);
183
 
184
  constexpr floating-point-type ceil(floating-point-type x);
185
  constexpr float ceilf(float x);
186
  constexpr long double ceill(long double x);
187
 
 
247
 
248
  constexpr floating-point-type nexttoward(floating-point-type x, long double y);
249
  constexpr float nexttowardf(float x, long double y);
250
  constexpr long double nexttowardl(long double x, long double y);
251
 
252
+ constexpr floating-point-type nextup(floating-point-type x);
253
+ constexpr float nextupf(float x);
254
+ constexpr long double nextupl(long double x);
255
+
256
+ constexpr floating-point-type nextdown(floating-point-type x);
257
+ constexpr float nextdownf(float x);
258
+ constexpr long double nextdownl(long double x);
259
+
260
  constexpr floating-point-type fdim(floating-point-type x, floating-point-type y);
261
  constexpr float fdimf(float x, float y);
262
  constexpr long double fdiml(long double x, long double y);
263
 
264
  constexpr floating-point-type fmax(floating-point-type x, floating-point-type y);
 
267
 
268
  constexpr floating-point-type fmin(floating-point-type x, floating-point-type y);
269
  constexpr float fminf(float x, float y);
270
  constexpr long double fminl(long double x, long double y);
271
 
272
+ constexpr floating-point-type fmaximum(floating-point-type x, floating-point-type y);
273
+ constexpr floating-point-type fmaximum_num(floating-point-type x, floating-point-type y);
274
+ constexpr floating-point-type fminimum(floating-point-type x, floating-point-type y);
275
+ constexpr floating-point-type fminimum_num(floating-point-type x, floating-point-type y);
276
+
277
  constexpr floating-point-type fma(floating-point-type x, floating-point-type y,
278
  floating-point-type z);
279
  constexpr float fmaf(float x, float y, float z);
280
  constexpr long double fmal(long double x, long double y, long double z);
281
 
 
407
  float sph_neumannf(unsigned n, float x);
408
  long double sph_neumannl(unsigned n, long double x);
409
  }
410
  ```
411
 
412
+ The contents and meaning of the header `<cmath>` are a subset of the C
413
+ standard library header `<math.h>` and only the declarations shown in
414
+ the synopsis above are present, with the addition of a three-dimensional
415
+ hypotenuse function [[c.math.hypot3]], a linear interpolation function
416
+ [[c.math.lerp]], and the mathematical special functions described in
417
+ [[sf.cmath]].
418
 
419
  [*Note 1*: Several functions have additional overloads in this
420
  document, but they have the same behavior as in the C standard library
421
  [[library.c]]. — *end note*]
422
 
423
  For each function with at least one parameter of type
424
+ `floating-point-type`, the implementation provides an overload for each
425
  cv-unqualified floating-point type [[basic.fundamental]] where all uses
426
+ of `floating-point-type` in the function signature are replaced with
427
  that floating-point type.
428
 
429
  For each function with at least one parameter of type
430
+ `floating-point-type` other than `abs`, the implementation also provides
431
  additional overloads sufficient to ensure that, if every argument
432
+ corresponding to a `floating-point-type` parameter has arithmetic type,
433
  then every such argument is effectively cast to the floating-point type
434
  with the greatest floating-point conversion rank and greatest
435
  floating-point conversion subrank among the types of all such arguments,
436
  where arguments of integer type are considered to have the same
437
  floating-point conversion rank as `double`. If no such floating-point
438
  type with the greatest rank and subrank exists, then overload resolution
439
  does not result in a usable candidate [[over.match.general]] from the
440
  overloads provided by the implementation.
441
 
442
  An invocation of `nexttoward` is ill-formed if the argument
443
+ corresponding to the `floating-point-type` parameter has extended
444
  floating-point type.
445
 
446
  See also: ISO C 7.12
447
 
448
  ### Absolute values <a id="c.math.abs">[[c.math.abs]]</a>
 
462
 
463
  *Remarks:* If `abs` is called with an argument of type `X` for which
464
  `is_unsigned_v<X>` is `true` and if `X` cannot be converted to `int` by
465
  integral promotion [[conv.prom]], the program is ill-formed.
466
 
467
+ [*Note 1*: Allowing arguments that can be promoted to `int` provides
468
  compatibility with C. — *end note*]
469
 
470
  ``` cpp
471
  constexpr floating-point-type abs(floating-point-type x);
472
  ```
473
 
474
  *Returns:* The absolute value of `x`.
475
 
476
+ See also: ISO C 7.12.8.3, 7.24.7.1
477
 
478
  ### Three-dimensional hypotenuse <a id="c.math.hypot3">[[c.math.hypot3]]</a>
479
 
480
  ``` cpp
481
+ constexpr floating-point-type hypot(floating-point-type x, floating-point-type y,
482
+ floating-point-type z);
483
  ```
484
 
485
  *Returns:* $\sqrt{x^2+y^2+z^2}$.
486
 
487
  ### Linear interpolation <a id="c.math.lerp">[[c.math.lerp]]</a>
 
510
  ### Classification / comparison functions <a id="c.math.fpclass">[[c.math.fpclass]]</a>
511
 
512
  The classification / comparison functions behave the same as the C
513
  macros with the corresponding names defined in the C standard library.
514
 
515
+ See also: ISO C 7.12.4, 7.12.18
516
 
517
  ### Mathematical special functions <a id="sf.cmath">[[sf.cmath]]</a>
518
 
519
  #### General <a id="sf.cmath.general">[[sf.cmath.general]]</a>
520
 
 
542
  ```
543
 
544
  *Effects:* These functions compute the associated Laguerre polynomials
545
  of their respective arguments `n`, `m`, and `x`.
546
 
547
+ *Returns:* Lₙᵐ(x), where Lₙᵐ is given by , Lₙ₊ₘ is given by , n is `n`,
548
+ m is `m`, and x is `x`.
 
 
549
 
550
  *Remarks:* The effect of calling each of these functions is
551
  *implementation-defined* if `n >= 128` or if `m >= 128`.
552
 
553
  #### Associated Legendre functions <a id="sf.cmath.assoc.legendre">[[sf.cmath.assoc.legendre]]</a>
 
559
  ```
560
 
561
  *Effects:* These functions compute the associated Legendre functions of
562
  their respective arguments `l`, `m`, and `x`.
563
 
564
+ *Returns:* P_ℓ^m(x), where P_ℓ^m is given by , P_ℓ is given by , ℓ is
565
+ `l`, m is `m`, and x is `x`.
 
 
566
 
567
  *Remarks:* The effect of calling each of these functions is
568
  *implementation-defined* if `l >= 128`.
569
 
570
  #### Beta function <a id="sf.cmath.beta">[[sf.cmath.beta]]</a>
 
576
  ```
577
 
578
  *Effects:* These functions compute the beta function of their respective
579
  arguments `x` and `y`.
580
 
581
+ *Returns:* B(x, y), where B is given by , x is `x` and y is `y`.
 
 
582
 
583
  #### Complete elliptic integral of the first kind <a id="sf.cmath.comp.ellint.1">[[sf.cmath.comp.ellint.1]]</a>
584
 
585
  ``` cpp
586
  floating-point-type comp_ellint_1(floating-point-type k);
 
589
  ```
590
 
591
  *Effects:* These functions compute the complete elliptic integral of the
592
  first kind of their respective arguments `k`.
593
 
594
+ *Returns:* K(k), where K is given by and k is `k`.
 
 
595
 
596
  See also [[sf.cmath.ellint.1]].
597
 
598
  #### Complete elliptic integral of the second kind <a id="sf.cmath.comp.ellint.2">[[sf.cmath.comp.ellint.2]]</a>
599
 
 
604
  ```
605
 
606
  *Effects:* These functions compute the complete elliptic integral of the
607
  second kind of their respective arguments `k`.
608
 
609
+ *Returns:* E(k), where E is given by and k is `k`.
 
 
610
 
611
  See also [[sf.cmath.ellint.2]].
612
 
613
  #### Complete elliptic integral of the third kind <a id="sf.cmath.comp.ellint.3">[[sf.cmath.comp.ellint.3]]</a>
614
 
 
619
  ```
620
 
621
  *Effects:* These functions compute the complete elliptic integral of the
622
  third kind of their respective arguments `k` and `nu`.
623
 
624
+ *Returns:* $\mathsf{\Pi}(\nu, k)$, where $\mathsf{\Pi}$ is given by , k
625
+ is `k`, and $\nu$ is `nu`.
 
626
 
627
  See also [[sf.cmath.ellint.3]].
628
 
629
  #### Regular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.i">[[sf.cmath.cyl.bessel.i]]</a>
630
 
 
635
  ```
636
 
637
  *Effects:* These functions compute the regular modified cylindrical
638
  Bessel functions of their respective arguments `nu` and `x`.
639
 
640
+ *Returns:* $\mathsf{I}_\nu(x)$, where $\mathsf{I}_\nu$ is given by ,
641
+ $\nu$ is `nu`, and x is `x`.
 
 
642
 
643
  *Remarks:* The effect of calling each of these functions is
644
  *implementation-defined* if `nu >= 128`.
645
 
646
  See also [[sf.cmath.cyl.bessel.j]].
 
654
  ```
655
 
656
  *Effects:* These functions compute the cylindrical Bessel functions of
657
  the first kind of their respective arguments `nu` and `x`.
658
 
659
+ *Returns:* $\mathsf{J}_\nu(x)$, where $\mathsf{J}_\nu$ is given by ,
660
+ $\nu$ is `nu`, and x is `x`.
 
661
 
662
  *Remarks:* The effect of calling each of these functions is
663
  *implementation-defined* if `nu >= 128`.
664
 
665
  #### Irregular modified cylindrical Bessel functions <a id="sf.cmath.cyl.bessel.k">[[sf.cmath.cyl.bessel.k]]</a>
 
671
  ```
672
 
673
  *Effects:* These functions compute the irregular modified cylindrical
674
  Bessel functions of their respective arguments `nu` and `x`.
675
 
676
+ *Returns:* $\mathsf{K}_\nu(x)$, where $\mathsf{K}_\nu$ is given by ,
677
+ $\nu$ is `nu`, and x is `x`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
 
679
  *Remarks:* The effect of calling each of these functions is
680
  *implementation-defined* if `nu >= 128`.
681
 
682
  See also [[sf.cmath.cyl.bessel.i]], [[sf.cmath.cyl.bessel.j]],
 
692
 
693
  *Effects:* These functions compute the cylindrical Neumann functions,
694
  also known as the cylindrical Bessel functions of the second kind, of
695
  their respective arguments `nu` and `x`.
696
 
697
+ *Returns:* $\mathsf{N}_\nu(x)$, where $\mathsf{N}_\nu$ is given by ,
698
+ $\nu$ is `nu`, and x is `x`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
699
 
700
  *Remarks:* The effect of calling each of these functions is
701
  *implementation-defined* if `nu >= 128`.
702
 
703
  See also [[sf.cmath.cyl.bessel.j]].
 
712
 
713
  *Effects:* These functions compute the incomplete elliptic integral of
714
  the first kind of their respective arguments `k` and `phi` (`phi`
715
  measured in radians).
716
 
717
+ *Returns:* F(k, φ), where F is given by , k is `k`, and φ is `phi`.
 
 
718
 
719
  #### Incomplete elliptic integral of the second kind <a id="sf.cmath.ellint.2">[[sf.cmath.ellint.2]]</a>
720
 
721
  ``` cpp
722
  floating-point-type ellint_2(floating-point-type k, floating-point-type phi);
 
726
 
727
  *Effects:* These functions compute the incomplete elliptic integral of
728
  the second kind of their respective arguments `k` and `phi` (`phi`
729
  measured in radians).
730
 
731
+ *Returns:* E(k, φ), where E is given by , k is `k`, and φ is `phi`.
 
 
732
 
733
  #### Incomplete elliptic integral of the third kind <a id="sf.cmath.ellint.3">[[sf.cmath.ellint.3]]</a>
734
 
735
  ``` cpp
736
  floating-point-type ellint_3(floating-point-type k, floating-point-type nu,
 
741
 
742
  *Effects:* These functions compute the incomplete elliptic integral of
743
  the third kind of their respective arguments `k`, `nu`, and `phi` (`phi`
744
  measured in radians).
745
 
746
+ *Returns:* $\mathsf{\Pi}(\nu, k, \phi)$, where $\mathsf{\Pi}$ is given
747
+ by , $\nu$ is `nu`, k is `k`, and φ is `phi`.
 
748
 
749
  #### Exponential integral <a id="sf.cmath.expint">[[sf.cmath.expint]]</a>
750
 
751
  ``` cpp
752
  floating-point-type expint(floating-point-type x);
 
755
  ```
756
 
757
  *Effects:* These functions compute the exponential integral of their
758
  respective arguments `x`.
759
 
760
+ *Returns:* Ei(x), where Ei is given by and x is `x`.
 
 
 
 
761
 
762
  #### Hermite polynomials <a id="sf.cmath.hermite">[[sf.cmath.hermite]]</a>
763
 
764
  ``` cpp
765
  floating-point-type hermite(unsigned n, floating-point-type x);
 
768
  ```
769
 
770
  *Effects:* These functions compute the Hermite polynomials of their
771
  respective arguments `n` and `x`.
772
 
773
+ *Returns:* Hₙ(x), where Hₙ is given by , n is `n`, and x is `x`.
 
 
 
 
774
 
775
  *Remarks:* The effect of calling each of these functions is
776
  *implementation-defined* if `n >= 128`.
777
 
778
  #### Laguerre polynomials <a id="sf.cmath.laguerre">[[sf.cmath.laguerre]]</a>
 
784
  ```
785
 
786
  *Effects:* These functions compute the Laguerre polynomials of their
787
  respective arguments `n` and `x`.
788
 
789
+ *Returns:* L(x), where Lₙ is given by , n is `n`, and x is `x`.
 
 
790
 
791
  *Remarks:* The effect of calling each of these functions is
792
  *implementation-defined* if `n >= 128`.
793
 
794
  #### Legendre polynomials <a id="sf.cmath.legendre">[[sf.cmath.legendre]]</a>
 
800
  ```
801
 
802
  *Effects:* These functions compute the Legendre polynomials of their
803
  respective arguments `l` and `x`.
804
 
805
+ *Returns:* P_ℓ(x), where P_ℓ is given by , l is `l`, and x is `x`.
 
 
 
806
 
807
  *Remarks:* The effect of calling each of these functions is
808
  *implementation-defined* if `l >= 128`.
809
 
810
  #### Riemann zeta function <a id="sf.cmath.riemann.zeta">[[sf.cmath.riemann.zeta]]</a>
 
816
  ```
817
 
818
  *Effects:* These functions compute the Riemann zeta function of their
819
  respective arguments `x`.
820
 
821
+ *Returns:* ζ(x), where ζ is given by and x is `x`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
822
 
823
  #### Spherical Bessel functions of the first kind <a id="sf.cmath.sph.bessel">[[sf.cmath.sph.bessel]]</a>
824
 
825
  ``` cpp
826
  floating-point-type sph_bessel(unsigned n, floating-point-type x);
 
829
  ```
830
 
831
  *Effects:* These functions compute the spherical Bessel functions of the
832
  first kind of their respective arguments `n` and `x`.
833
 
834
+ *Returns:* jₙ(x), where jₙ is given by , n is `n`, and x is `x`.
 
 
835
 
836
  *Remarks:* The effect of calling each of these functions is
837
  *implementation-defined* if `n >= 128`.
838
 
839
  See also [[sf.cmath.cyl.bessel.j]].
 
848
 
849
  *Effects:* These functions compute the spherical associated Legendre
850
  functions of their respective arguments `l`, `m`, and `theta` (`theta`
851
  measured in radians).
852
 
853
+ *Returns:* Y_ℓ^m(θ, 0), where Y_ℓ^m is given by , l is `l`, m is `m`,
854
+ and θ is `theta`.
 
 
 
 
855
 
856
  *Remarks:* The effect of calling each of these functions is
857
  *implementation-defined* if `l >= 128`.
858
 
859
  See also [[sf.cmath.assoc.legendre]].
 
868
 
869
  *Effects:* These functions compute the spherical Neumann functions, also
870
  known as the spherical Bessel functions of the second kind, of their
871
  respective arguments `n` and `x`.
872
 
873
+ *Returns:* nₙ(x), where nₙ is given by , n is `n`, and x is `x`.
 
 
874
 
875
  *Remarks:* The effect of calling each of these functions is
876
  *implementation-defined* if `n >= 128`.
877
 
878
  See also [[sf.cmath.cyl.neumann]].