From Jason Turner

[c.math]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpnt0xkgmu/{from.md → to.md} +1160 -238
tmp/tmpnt0xkgmu/{from.md → to.md} RENAMED
@@ -1,247 +1,1135 @@
1
- ## C library <a id="c.math">[[c.math]]</a>
2
 
3
- The header `<ctgmath>` simply includes the headers `<ccomplex>` and
4
- `<cmath>`.
5
 
6
- The overloads provided in C by type-generic macros are already provided
7
- in `<ccomplex>` and `<cmath>` by “sufficient” additional overloads.
 
 
 
8
 
9
- Tables  [[tab:numerics.hdr.cmath]] and  [[tab:numerics.hdr.cstdlib]]
10
- describe headers `<cmath>` and `<cstdlib>`, respectively.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- The contents of these headers are the same as the Standard C library
13
- headers `<math.h>` and `<stdlib.h>` respectively, with the following
14
- changes:
15
 
16
- The `rand` function has the semantics specified in the C standard,
17
- except that the implementation may specify that particular library
18
- functions may call `rand`. It is implementation-defined whether the
19
- `rand` function may introduce data races ([[res.on.data.races]]). The
20
- random number generation ([[rand]]) facilities in this standard are
21
- often preferable to `rand`, because `rand`’s underlying algorithm is
22
- unspecified. Use of `rand` therefore continues to be nonportable, with
23
- unpredictable and oft-questionable quality and performance.
24
 
25
- In addition to the `int` versions of certain math functions in
26
- `<cstdlib>`, C++adds `long` and `long long` overloaded versions of these
27
- functions, with the same semantics.
 
 
28
 
29
- The added signatures are:
 
 
 
 
30
 
31
- ``` cpp
32
- long abs(long); // labs()
33
- long long abs(long long); // llabs()
34
- ldiv_t div(long, long); // ldiv()
35
- lldiv_t div(long long, long long); // lldiv()
36
- ```
37
 
38
- In addition to the `double` versions of the math functions in `<cmath>`,
39
- C++adds `float` and `long double` overloaded versions of these
40
- functions, with the same semantics.
 
 
41
 
42
- The added signatures are:
 
 
 
 
43
 
44
- ``` cpp
45
- float abs(float);
46
- float acos(float);
47
- float acosh(float);
48
- float asin(float);
49
- float asinh(float);
50
- float atan(float);
51
- float atan2(float, float);
52
- float atanh(float);
53
- float cbrt(float);
54
- float ceil(float);
55
- float copysign(float, float);
56
- float cos(float);
57
- float cosh(float);
58
- float erf(float);
59
- float erfc(float);
60
- float exp(float);
61
- float exp2(float);
62
- float expm1(float);
63
- float fabs(float);
64
- float fdim(float, float);
65
- float floor(float);
66
- float fma(float, float, float);
67
- float fmax(float, float);
68
- float fmin(float, float);
69
- float fmod(float, float);
70
- float frexp(float, int*);
71
- float hypot(float, float);
72
- int ilogb(float);
73
- float ldexp(float, int);
74
- float lgamma(float);
75
- long long llrint(float);
76
- long long llround(float);
77
- float log(float);
78
- float log10(float);
79
- float log1p(float);
80
- float log2(float);
81
- float logb(float);
82
- long lrint(float);
83
- long lround(float);
84
- float modf(float, float*);
85
- float nearbyint(float);
86
- float nextafter(float, float);
87
- float nexttoward(float, long double);
88
- float pow(float, float);
89
- float remainder(float, float);
90
- float remquo(float, float, int *);
91
- float rint(float);
92
- float round(float);
93
- float scalbln(float, long);
94
- float scalbn(float, int);
95
- float sin(float);
96
- float sinh(float);
97
- float sqrt(float);
98
- float tan(float);
99
- float tanh(float);
100
- float tgamma(float);
101
- float trunc(float);
102
-
103
- double abs(double); // fabs()
104
-
105
- long double abs(long double);
106
- long double acos(long double);
107
- long double acosh(long double);
108
- long double asin(long double);
109
- long double asinh(long double);
110
- long double atan(long double);
111
- long double atan2(long double, long double);
112
- long double atanh(long double);
113
- long double cbrt(long double);
114
- long double ceil(long double);
115
- long double copysign(long double, long double);
116
- long double cos(long double);
117
- long double cosh(long double);
118
- long double erf(long double);
119
- long double erfc(long double);
120
- long double exp(long double);
121
- long double exp2(long double);
122
- long double expm1(long double);
123
- long double fabs(long double);
124
- long double fdim(long double, long double);
125
- long double floor(long double);
126
- long double fma(long double, long double, long double);
127
- long double fmax(long double, long double);
128
- long double fmin(long double, long double);
129
- long double fmod(long double, long double);
130
- long double frexp(long double, int*);
131
- long double hypot(long double, long double);
132
- int ilogb(long double);
133
- long double ldexp(long double, int);
134
- long double lgamma(long double);
135
- long long llrint(long double);
136
- long long llround(long double);
137
- long double log(long double);
138
- long double log10(long double);
139
- long double log1p(long double);
140
- long double log2(long double);
141
- long double logb(long double);
142
- long lrint(long double);
143
- long lround(long double);
144
- long double modf(long double, long double*);
145
- long double nearbyint(long double);
146
- long double nextafter(long double, long double);
147
- long double nexttoward(long double, long double);
148
- long double pow(long double, long double);
149
- long double remainder(long double, long double);
150
- long double remquo(long double, long double, int *);
151
- long double rint(long double);
152
- long double round(long double);
153
- long double scalbln(long double, long);
154
- long double scalbn(long double, int);
155
- long double sin(long double);
156
- long double sinh(long double);
157
- long double sqrt(long double);
158
- long double tan(long double);
159
- long double tanh(long double);
160
- long double tgamma(long double);
161
- long double trunc(long double);
162
- ```
163
-
164
- The classification/comparison functions behave the same as the C macros
165
- with the corresponding names defined in 7.12.3, Classification macros,
166
- and 7.12.14, Comparison macros in the C Standard. Each function is
167
- overloaded for the three floating-point types, as follows:
168
 
169
- ``` cpp
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  int fpclassify(float x);
171
- bool isfinite(float x);
172
- bool isinf(float x);
173
- bool isnan(float x);
174
- bool isnormal(float x);
175
- bool signbit(float x);
176
-
177
- bool isgreater(float x, float y);
178
- bool isgreaterequal(float x, float y);
179
- bool isless(float x, float y);
180
- bool islessequal(float x, float y);
181
- bool islessgreater(float x, float y);
182
- bool isunordered(float x, float y);
183
-
184
  int fpclassify(double x);
185
- bool isfinite(double x);
186
- bool isinf(double x);
187
- bool isnan(double x);
188
- bool isnormal(double x);
189
- bool signbit(double x);
190
-
191
- bool isgreater(double x, double y);
192
- bool isgreaterequal(double x, double y);
193
- bool isless(double x, double y);
194
- bool islessequal(double x, double y);
195
- bool islessgreater(double x, double y);
196
- bool isunordered(double x, double y);
197
-
198
  int fpclassify(long double x);
199
- bool isfinite(long double x);
200
- bool isinf(long double x);
201
- bool isnan(long double x);
202
- bool isnormal(long double x);
203
- bool signbit(long double x);
204
-
205
- bool isgreater(long double x, long double y);
206
- bool isgreaterequal(long double x, long double y);
207
- bool isless(long double x, long double y);
208
- bool islessequal(long double x, long double y);
209
- bool islessgreater(long double x, long double y);
210
- bool isunordered(long double x, long double y);
211
- ```
212
-
213
- Moreover, there shall be additional overloads sufficient to ensure:
214
-
215
- 1. If any arithmetic argument corresponding to a `double` parameter has
216
- type `long double`, then all arithmetic arguments corresponding to
217
- `double` parameters are effectively cast to `long double`.
218
- 2. Otherwise, if any arithmetic argument corresponding to a `double`
219
- parameter has type `double` or an integer type, then all arithmetic
220
- arguments corresponding to `double` parameters are effectively cast
221
- to `double`.
222
- 3. Otherwise, all arithmetic arguments corresponding to `double`
223
- parameters have type `float`.
224
-
225
- ISO C 7.5, 7.10.2, 7.10.6.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
  <!-- Link reference definitions -->
228
  [accumulate]: #accumulate
229
  [adjacent.difference]: #adjacent.difference
230
  [algorithms]: algorithms.md#algorithms
231
  [bad.alloc]: language.md#bad.alloc
232
  [basic.fundamental]: basic.md#basic.fundamental
233
  [basic.stc.thread]: basic.md#basic.stc.thread
234
  [basic.types]: basic.md#basic.types
235
  [c.math]: #c.math
236
- [ccmplx]: #ccmplx
 
 
 
237
  [cfenv]: #cfenv
238
  [cfenv.syn]: #cfenv.syn
239
  [class.gslice]: #class.gslice
240
  [class.gslice.overview]: #class.gslice.overview
241
  [class.slice]: #class.slice
242
  [class.slice.overview]: #class.slice.overview
 
243
  [cmplx.over]: #cmplx.over
244
  [complex]: #complex
245
  [complex.literals]: #complex.literals
246
  [complex.member.ops]: #complex.member.ops
247
  [complex.members]: #complex.members
@@ -250,39 +1138,48 @@ ISO C 7.5, 7.10.2, 7.10.6.
250
  [complex.special]: #complex.special
251
  [complex.syn]: #complex.syn
252
  [complex.transcendentals]: #complex.transcendentals
253
  [complex.value.ops]: #complex.value.ops
254
  [cons.slice]: #cons.slice
255
- [copyassignable]: #copyassignable
256
- [copyconstructible]: #copyconstructible
 
 
257
  [dcl.init]: dcl.md#dcl.init
258
- [equalitycomparable]: #equalitycomparable
259
  [function.objects]: utilities.md#function.objects
260
  [gslice.access]: #gslice.access
261
  [gslice.array.assign]: #gslice.array.assign
262
  [gslice.array.comp.assign]: #gslice.array.comp.assign
263
  [gslice.array.fill]: #gslice.array.fill
264
  [gslice.cons]: #gslice.cons
 
 
265
  [indirect.array.assign]: #indirect.array.assign
266
  [indirect.array.comp.assign]: #indirect.array.comp.assign
267
  [indirect.array.fill]: #indirect.array.fill
268
  [inner.product]: #inner.product
 
269
  [input.output]: input.md#input.output
270
  [iostate.flags]: input.md#iostate.flags
271
  [istream.formatted]: input.md#istream.formatted
272
- [limits]: language.md#limits
 
273
  [mask.array.assign]: #mask.array.assign
274
  [mask.array.comp.assign]: #mask.array.comp.assign
275
  [mask.array.fill]: #mask.array.fill
276
- [moveassignable]: #moveassignable
277
  [numarray]: #numarray
278
  [numeric.iota]: #numeric.iota
279
  [numeric.ops]: #numeric.ops
 
 
280
  [numeric.ops.overview]: #numeric.ops.overview
281
  [numeric.requirements]: #numeric.requirements
282
  [numerics]: #numerics
 
283
  [numerics.general]: #numerics.general
 
284
  [partial.sum]: #partial.sum
285
  [rand]: #rand
286
  [rand.adapt]: #rand.adapt
287
  [rand.adapt.disc]: #rand.adapt.disc
288
  [rand.adapt.general]: #rand.adapt.general
@@ -331,25 +1228,49 @@ ISO C 7.5, 7.10.2, 7.10.6.
331
  [rand.synopsis]: #rand.synopsis
332
  [rand.util]: #rand.util
333
  [rand.util.canonical]: #rand.util.canonical
334
  [rand.util.seedseq]: #rand.util.seedseq
335
  [random.access.iterators]: iterators.md#random.access.iterators
 
336
  [res.on.data.races]: library.md#res.on.data.races
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  [slice.access]: #slice.access
338
  [slice.arr.assign]: #slice.arr.assign
339
  [slice.arr.comp.assign]: #slice.arr.comp.assign
340
  [slice.arr.fill]: #slice.arr.fill
341
  [strings]: strings.md#strings
342
  [tab:RandomDistribution]: #tab:RandomDistribution
343
  [tab:RandomEngine]: #tab:RandomEngine
344
  [tab:SeedSequence]: #tab:SeedSequence
345
- [tab:UniformRandomNumberGenerator]: #tab:UniformRandomNumberGenerator
 
 
 
346
  [tab:iterator.input.requirements]: iterators.md#tab:iterator.input.requirements
347
- [tab:iterator.output.requirements]: iterators.md#tab:iterator.output.requirements
348
- [tab:iterator.random.access.requirements]: iterators.md#tab:iterator.random.access.requirements
349
- [tab:numerics.hdr.cmath]: #tab:numerics.hdr.cmath
350
- [tab:numerics.hdr.cstdlib]: #tab:numerics.hdr.cstdlib
351
  [tab:numerics.lib.summary]: #tab:numerics.lib.summary
352
  [template.gslice.array]: #template.gslice.array
353
  [template.gslice.array.overview]: #template.gslice.array.overview
354
  [template.indirect.array]: #template.indirect.array
355
  [template.indirect.array.overview]: #template.indirect.array.overview
@@ -358,10 +1279,13 @@ ISO C 7.5, 7.10.2, 7.10.6.
358
  [template.slice.array]: #template.slice.array
359
  [template.slice.array.overview]: #template.slice.array.overview
360
  [template.valarray]: #template.valarray
361
  [template.valarray.overview]: #template.valarray.overview
362
  [thread.thread.class]: thread.md#thread.thread.class
 
 
 
363
  [valarray.access]: #valarray.access
364
  [valarray.assign]: #valarray.assign
365
  [valarray.binary]: #valarray.binary
366
  [valarray.cassign]: #valarray.cassign
367
  [valarray.comparison]: #valarray.comparison
@@ -397,53 +1321,51 @@ ISO C 7.5, 7.10.2, 7.10.6.
397
  [^6]: The distribution corresponding to this probability density
398
  function is also known (with a possible change of variable) as the
399
  Gumbel Type I, the log-Weibull, or the Fisher-Tippett Type I
400
  distribution.
401
 
402
- [^7]: Clause  [[limits]] recommends a minimum number of recursively
403
  nested template instantiations. This requirement thus indirectly
404
  suggests a minimum allowable complexity for valarray expressions.
405
 
406
  [^8]: The intent is to specify an array template that has the minimum
407
  functionality necessary to address aliasing ambiguities and the
408
  proliferation of temporaries. Thus, the `valarray` template is
409
  neither a matrix class nor a field class. However, it is a very
410
  useful building block for designing such classes.
411
 
412
- [^9]: For convenience, such objects are referred to as “arrays”
413
- throughout the remainder of [[numarray]].
414
-
415
- [^10]: This default constructor is essential, since arrays of `valarray`
416
  may be useful. After initialization, the length of an empty array
417
  can be increased with the `resize` member function.
418
 
419
- [^11]: This constructor is the preferred method for converting a C array
420
  to a `valarray` object.
421
 
422
- [^12]: This copy constructor creates a distinct array rather than an
423
  alias. Implementations in which arrays share storage are permitted,
424
  but they shall implement a copy-on-reference mechanism to ensure
425
  that arrays are conceptually distinct.
426
 
427
- [^13]: Compilers may take advantage of inlining, constant propagation,
428
- loop fusion, tracking of pointers obtained from `operator new`, and
429
- other techniques to generate efficient `valarray`s.
430
-
431
- [^14]: BLAS stands for *Basic Linear Algebra Subprograms.* C++programs
432
  may instantiate this class. See, for example, Dongarra, Du Croz,
433
  Duff, and Hammerling: *A set of Level 3 Basic Linear Algebra
434
  Subprograms*; Technical Report MCS-P1-0888, Argonne National
435
  Laboratory (USA), Mathematics and Computer Science Division, August,
436
  1988.
437
 
438
- [^15]: `accumulate` is similar to the APL reduction operator and Common
 
 
439
  Lisp reduce function, but it avoids the difficulty of defining the
440
  result of reduction on an empty sequence by always requiring an
441
  initial value.
442
 
443
- [^16]: The use of fully closed ranges is intentional
444
 
445
- [^17]: The use of fully closed ranges is intentional
446
 
447
- [^18]: The use of fully closed ranges is intentional.
448
 
449
- [^19]: The use of fully closed ranges is intentional.
 
 
 
 
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
16
+ #define FP_INFINITE see below
17
+ #define FP_NAN see below
18
+ #define FP_NORMAL see below
19
+ #define FP_SUBNORMAL see below
20
+ #define FP_ZERO see below
21
+ #define FP_FAST_FMA see below
22
+ #define FP_FAST_FMAF see below
23
+ #define FP_FAST_FMAL see below
24
+ #define FP_ILOGB0 see below
25
+ #define FP_ILOGBNAN see below
26
+ #define MATH_ERRNO see below
27
+ #define MATH_ERREXCEPT see below
28
 
29
+ #define math_errhandling see below
 
 
30
 
31
+ namespace std {
32
+ float acos(float x); // see [library.c]
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
+ float asin(float x); // see [library.c]
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
+ float atan(float x); // see [library.c]
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
+ float atan2(float y, float x); // see [library.c]
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
+ float cos(float x); // see [library.c]
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
+ float sin(float x); // see [library.c]
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
+ float tan(float x); // see [library.c]
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
+ float acosh(float x); // see [library.c]
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
+ float asinh(float x); // see [library.c]
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
+ float atanh(float x); // see [library.c]
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
+ float cosh(float x); // see [library.c]
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
+ float sinh(float x); // see [library.c]
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
+ float tanh(float x); // see [library.c]
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
+ float exp(float x); // see [library.c]
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
+ float exp2(float x); // see [library.c]
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
+ float expm1(float x); // see [library.c]
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
+ float frexp(float value, int* exp); // see [library.c]
129
+ double frexp(double value, int* exp);
130
+ long double frexp(long double value, int* exp); // see [library.c]
131
+ float frexpf(float value, int* exp);
132
+ long double frexpl(long double value, int* exp);
133
+
134
+ int ilogb(float x); // see [library.c]
135
+ int ilogb(double x);
136
+ int ilogb(long double x); // see [library.c]
137
+ int ilogbf(float x);
138
+ int ilogbl(long double x);
139
+
140
+ float ldexp(float x, int exp); // see [library.c]
141
+ double ldexp(double x, int exp);
142
+ long double ldexp(long double x, int exp); // see [library.c]
143
+ float ldexpf(float x, int exp);
144
+ long double ldexpl(long double x, int exp);
145
+
146
+ float log(float x); // see [library.c]
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
+ float log10(float x); // see [library.c]
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
+ float log1p(float x); // see [library.c]
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
+ float log2(float x); // see [library.c]
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
+ float logb(float x); // see [library.c]
171
+ double logb(double x);
172
+ long double logb(long double x); // see [library.c]
173
+ float logbf(float x);
174
+ long double logbl(long double x);
175
+
176
+ float modf(float value, float* iptr); // see [library.c]
177
+ double modf(double value, double* iptr);
178
+ long double modf(long double value, long double* iptr); // see [library.c]
179
+ float modff(float value, float* iptr);
180
+ long double modfl(long double value, long double* iptr);
181
+
182
+ float scalbn(float x, int n); // see [library.c]
183
+ double scalbn(double x, int n);
184
+ long double scalbn(long double x, int n); // see [library.c]
185
+ float scalbnf(float x, int n);
186
+ long double scalbnl(long double x, int n);
187
+
188
+ float scalbln(float x, long int n); // see [library.c]
189
+ double scalbln(double x, long int n);
190
+ long double scalbln(long double x, long int n); // see [library.c]
191
+ float scalblnf(float x, long int n);
192
+ long double scalblnl(long double x, long int n);
193
+
194
+ float cbrt(float x); // see [library.c]
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
+ float abs(float j);
205
+ double abs(double j);
206
+ long double abs(long double j);
207
+
208
+ float fabs(float x); // see [library.c]
209
+ double fabs(double x);
210
+ long double fabs(long double x); // see [library.c]
211
+ float fabsf(float x);
212
+ long double fabsl(long double x);
213
+
214
+ float hypot(float x, float y); // see [library.c]
215
+ double hypot(double x, double y);
216
+ long double hypot(double x, 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
+ float hypot(float x, float y, float z);
222
+ double hypot(double x, double y, double z);
223
+ long double hypot(long double x, long double y, long double z);
224
+
225
+ float pow(float x, float y); // see [library.c]
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
+ float sqrt(float x); // see [library.c]
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
+ float erf(float x); // see [library.c]
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
+ float erfc(float x); // see [library.c]
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
+ float lgamma(float x); // see [library.c]
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
+ float tgamma(float x); // see [library.c]
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
+ float ceil(float x); // see [library.c]
262
+ double ceil(double x);
263
+ long double ceil(long double x); // see [library.c]
264
+ float ceilf(float x);
265
+ long double ceill(long double x);
266
+
267
+ float floor(float x); // see [library.c]
268
+ double floor(double x);
269
+ long double floor(long double x); // see [library.c]
270
+ float floorf(float x);
271
+ long double floorl(long double x);
272
+
273
+ float nearbyint(float x); // see [library.c]
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
+ float rint(float x); // see [library.c]
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(float x); // see [library.c]
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(float x); // see [library.c]
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
+ float round(float x); // see [library.c]
298
+ double round(double x);
299
+ long double round(long double x); // see [library.c]
300
+ float roundf(float x);
301
+ long double roundl(long double x);
302
+
303
+ long int lround(float x); // see [library.c]
304
+ long int lround(double x);
305
+ long int lround(long double x); // see [library.c]
306
+ long int lroundf(float x);
307
+ long int lroundl(long double x);
308
+
309
+ long long int llround(float x); // see [library.c]
310
+ long long int llround(double x);
311
+ long long int llround(long double x); // see [library.c]
312
+ long long int llroundf(float x);
313
+ long long int llroundl(long double x);
314
+
315
+ float trunc(float x); // see [library.c]
316
+ double trunc(double x);
317
+ long double trunc(long double x); // see [library.c]
318
+ float truncf(float x);
319
+ long double truncl(long double x);
320
+
321
+ float fmod(float x, float y); // see [library.c]
322
+ double fmod(double x, double y);
323
+ long double fmod(long double x, long double y); // see [library.c]
324
+ float fmodf(float x, float y);
325
+ long double fmodl(long double x, long double y);
326
+
327
+ float remainder(float x, float y); // see [library.c]
328
+ double remainder(double x, double y);
329
+ long double remainder(long double x, long double y); // see [library.c]
330
+ float remainderf(float x, float y);
331
+ long double remainderl(long double x, long double y);
332
+
333
+ float remquo(float x, float y, int* quo); // see [library.c]
334
+ double remquo(double x, double y, int* quo);
335
+ long double remquo(long double x, long double y, int* quo); // see [library.c]
336
+ float remquof(float x, float y, int* quo);
337
+ long double remquol(long double x, long double y, int* quo);
338
+
339
+ float copysign(float x, float y); // see [library.c]
340
+ double copysign(double x, double y);
341
+ long double copysign(long double x, long double y); // see [library.c]
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
+ float nextafter(float x, float y); // see [library.c]
350
+ double nextafter(double x, double y);
351
+ long double nextafter(long double x, long double y); // see [library.c]
352
+ float nextafterf(float x, float y);
353
+ long double nextafterl(long double x, long double y);
354
+
355
+ float nexttoward(float x, long double y); // see [library.c]
356
+ double nexttoward(double x, long double y);
357
+ long double nexttoward(long double x, long double y); // see [library.c]
358
+ float nexttowardf(float x, long double y);
359
+ long double nexttowardl(long double x, long double y);
360
+
361
+ float fdim(float x, float y); // see [library.c]
362
+ double fdim(double x, double y);
363
+ long double fdim(long double x, long double y); // see [library.c]
364
+ float fdimf(float x, float y);
365
+ long double fdiml(long double x, long double y);
366
+
367
+ float fmax(float x, float y); // see [library.c]
368
+ double fmax(double x, double y);
369
+ long double fmax(long double x, long double y); // see [library.c]
370
+ float fmaxf(float x, float y);
371
+ long double fmaxl(long double x, long double y);
372
+
373
+ float fmin(float x, float y); // see [library.c]
374
+ double fmin(double x, double y);
375
+ long double fmin(long double x, long double y); // see [library.c]
376
+ float fminf(float x, float y);
377
+ long double fminl(long double x, long double y);
378
+
379
+ float fma(float x, float y, float z); // see [library.c]
380
+ double fma(double x, double y, double z);
381
+ long double fma(long double x, long double y, long double z); // see [library.c]
382
+ float fmaf(float x, float y, float z);
383
+ long double fmal(long double x, long double y, long double z);
384
+
385
+ // [c.math.fpclass], classification / comparison functions
386
  int fpclassify(float x);
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  int fpclassify(double x);
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  int fpclassify(long double x);
389
+
390
+ int isfinite(float x);
391
+ int isfinite(double x);
392
+ int isfinite(long double x);
393
+
394
+ int isinf(float x);
395
+ int isinf(double x);
396
+ int isinf(long double x);
397
+
398
+ int isnan(float x);
399
+ int isnan(double x);
400
+ int isnan(long double x);
401
+
402
+ int isnormal(float x);
403
+ int isnormal(double x);
404
+ int isnormal(long double x);
405
+
406
+ int signbit(float x);
407
+ int signbit(double x);
408
+ int signbit(long double x);
409
+
410
+ int isgreater(float x, float y);
411
+ int isgreater(double x, double y);
412
+ int isgreater(long double x, long double y);
413
+
414
+ int isgreaterequal(float x, float y);
415
+ int isgreaterequal(double x, double y);
416
+ int isgreaterequal(long double x, long double y);
417
+
418
+ int isless(float x, float y);
419
+ int isless(double x, double y);
420
+ int isless(long double x, long double y);
421
+
422
+ int islessequal(float x, float y);
423
+ int islessequal(double x, double y);
424
+ int islessequal(long double x, long double y);
425
+
426
+ int islessgreater(float x, float y);
427
+ int islessgreater(double x, double y);
428
+ int islessgreater(long double x, long double y);
429
+
430
+ int isunordered(float x, float y);
431
+ int isunordered(double x, double y);
432
+ int isunordered(long double x, long double y);
433
+
434
+ // [sf.cmath], mathematical special functions
435
+
436
+ // [sf.cmath.assoc_laguerre], associated Laguerre polynomials
437
+ double assoc_laguerre(unsigned n, unsigned m, double x);
438
+ float assoc_laguerref(unsigned n, unsigned m, float x);
439
+ long double assoc_laguerrel(unsigned n, unsigned m, long double x);
440
+
441
+ // [sf.cmath.assoc_legendre], associated Legendre functions
442
+ double assoc_legendre(unsigned l, unsigned m, double x);
443
+ float assoc_legendref(unsigned l, unsigned m, float x);
444
+ long double assoc_legendrel(unsigned l, unsigned m, long double x);
445
+
446
+ // [sf.cmath.beta], beta function
447
+ double beta(double x, double y);
448
+ float betaf(float x, float y);
449
+ long double betal(long double x, long double y);
450
+
451
+ // [sf.cmath.comp_ellint_1], complete elliptic integral of the first kind
452
+ double comp_ellint_1(double k);
453
+ float comp_ellint_1f(float k);
454
+ long double comp_ellint_1l(long double k);
455
+
456
+ // [sf.cmath.comp_ellint_2], complete elliptic integral of the second kind
457
+ double comp_ellint_2(double k);
458
+ float comp_ellint_2f(float k);
459
+ long double comp_ellint_2l(long double k);
460
+
461
+ // [sf.cmath.comp_ellint_3], complete elliptic integral of the third kind
462
+ double comp_ellint_3(double k, double nu);
463
+ float comp_ellint_3f(float k, float nu);
464
+ long double comp_ellint_3l(long double k, long double nu);
465
+
466
+ // [sf.cmath.cyl_bessel_i], regular modified cylindrical Bessel functions
467
+ double cyl_bessel_i(double nu, double x);
468
+ float cyl_bessel_if(float nu, float x);
469
+ long double cyl_bessel_il(long double nu, long double x);
470
+
471
+ // [sf.cmath.cyl_bessel_j], cylindrical Bessel functions of the first kind
472
+ double cyl_bessel_j(double nu, double x);
473
+ float cyl_bessel_jf(float nu, float x);
474
+ long double cyl_bessel_jl(long double nu, long double x);
475
+
476
+ // [sf.cmath.cyl_bessel_k], irregular modified cylindrical Bessel functions
477
+ double cyl_bessel_k(double nu, double x);
478
+ float cyl_bessel_kf(float nu, float x);
479
+ long double cyl_bessel_kl(long double nu, long double x);
480
+
481
+ // [sf.cmath.cyl_neumann], cylindrical Neumann functions;
482
+ // cylindrical Bessel functions of the second kind
483
+ double cyl_neumann(double nu, double x);
484
+ float cyl_neumannf(float nu, float x);
485
+ long double cyl_neumannl(long double nu, long double x);
486
+
487
+ // [sf.cmath.ellint_1], incomplete elliptic integral of the first kind
488
+ double ellint_1(double k, double phi);
489
+ float ellint_1f(float k, float phi);
490
+ long double ellint_1l(long double k, long double phi);
491
+
492
+ // [sf.cmath.ellint_2], incomplete elliptic integral of the second kind
493
+ double ellint_2(double k, double phi);
494
+ float ellint_2f(float k, float phi);
495
+ long double ellint_2l(long double k, long double phi);
496
+
497
+ // [sf.cmath.ellint_3], incomplete elliptic integral of the third kind
498
+ double ellint_3(double k, double nu, double phi);
499
+ float ellint_3f(float k, float nu, float phi);
500
+ long double ellint_3l(long double k, long double nu, long double phi);
501
+
502
+ // [sf.cmath.expint], exponential integral
503
+ double expint(double x);
504
+ float expintf(float x);
505
+ long double expintl(long double x);
506
+
507
+ // [sf.cmath.hermite], Hermite polynomials
508
+ double hermite(unsigned n, double x);
509
+ float hermitef(unsigned n, float x);
510
+ long double hermitel(unsigned n, long double x);
511
+
512
+ // [sf.cmath.laguerre], Laguerre polynomials
513
+ double laguerre(unsigned n, double x);
514
+ float laguerref(unsigned n, float x);
515
+ long double laguerrel(unsigned n, long double x);
516
+
517
+ // [sf.cmath.legendre], Legendre polynomials
518
+ double legendre(unsigned l, double x);
519
+ float legendref(unsigned l, float x);
520
+ long double legendrel(unsigned l, long double x);
521
+
522
+ // [sf.cmath.riemann_zeta], Riemann zeta function
523
+ double riemann_zeta(double x);
524
+ float riemann_zetaf(float x);
525
+ long double riemann_zetal(long double x);
526
+
527
+ // [sf.cmath.sph_bessel], spherical Bessel functions of the first kind
528
+ double sph_bessel(unsigned n, double x);
529
+ float sph_besself(unsigned n, float x);
530
+ long double sph_bessell(unsigned n, long double x);
531
+
532
+ // [sf.cmath.sph_legendre], spherical associated Legendre functions
533
+ double sph_legendre(unsigned l, unsigned m, double theta);
534
+ float sph_legendref(unsigned l, unsigned m, float theta);
535
+ long double sph_legendrel(unsigned l, unsigned m, long double theta);
536
+
537
+ // [sf.cmath.sph_neumann], spherical Neumann functions;
538
+ // spherical Bessel functions of the second kind:
539
+ double sph_neumann(unsigned n, double x);
540
+ float sph_neumannf(unsigned n, float x);
541
+ long double sph_neumannl(unsigned n, long double x);
542
+ }
543
+ ```
544
+
545
+ The contents and meaning of the header `<cmath>` are the same as the C
546
+ standard library header `<math.h>`, with the addition of a
547
+ three-dimensional hypotenuse function ([[c.math.hypot3]]) and the
548
+ mathematical special functions described in [[sf.cmath]].
549
+
550
+ [*Note 1*: Several functions have additional overloads in this
551
+ International Standard, but they have the same behavior as in the C
552
+ standard library ([[library.c]]). — *end note*]
553
+
554
+ For each set of overloaded functions within `<cmath>`, with the
555
+ exception of `abs`, there shall be additional overloads sufficient to
556
+ ensure:
557
+
558
+ 1. If any argument of arithmetic type corresponding to a `double`
559
+ parameter has type `long double`, then all arguments of arithmetic
560
+ type ([[basic.fundamental]]) corresponding to `double` parameters
561
+ are effectively cast to `long double`.
562
+ 2. Otherwise, if any argument of arithmetic type corresponding to a
563
+ `double` parameter has type `double` or an integer type, then all
564
+ arguments of arithmetic type corresponding to `double` parameters
565
+ are effectively cast to `double`.
566
+ 3. Otherwise, all arguments of arithmetic type corresponding to
567
+ `double` parameters have type `float`.
568
+
569
+ [*Note 2*: `abs` is exempted from these rules in order to stay
570
+ compatible with C. — *end note*]
571
+
572
+ ISO C 7.12
573
+
574
+ ### Absolute values <a id="c.math.abs">[[c.math.abs]]</a>
575
+
576
+ [*Note 1*: The headers `<cstdlib>` ([[cstdlib.syn]]) and `<cmath>` (
577
+ [[cmath.syn]]) declare the functions described in this
578
+ subclause. — *end note*]
579
+
580
+ ``` cpp
581
+ int abs(int j);
582
+ long int abs(long int j);
583
+ long long int abs(long long int j);
584
+ float abs(float j);
585
+ double abs(double j);
586
+ long double abs(long double j);
587
+ ```
588
+
589
+ *Effects:* The `abs` functions have the semantics specified in the C
590
+ standard library for the functions `abs`, `labs`, `llabs`, `fabsf`,
591
+ `fabs`, and `fabsl`.
592
+
593
+ *Remarks:* If `abs()` is called with an argument of type `X` for which
594
+ `is_unsigned_v<X>` is `true` and if `X` cannot be converted to `int` by
595
+ integral promotion ([[conv.prom]]), the program is ill-formed.
596
+
597
+ [*Note 1*: Arguments that can be promoted to `int` are permitted for
598
+ compatibility with C. — *end note*]
599
+
600
+ ISO C 7.12.7.2, 7.22.6.1
601
+
602
+ ### Three-dimensional hypotenuse <a id="c.math.hypot3">[[c.math.hypot3]]</a>
603
+
604
+ ``` cpp
605
+ float hypot(float x, float y, float z);
606
+ double hypot(double x, double y, double z);
607
+ long double hypot(long double x, long double y, long double z);
608
+ ```
609
+
610
+ *Returns:* $\sqrt{x^2+y^2+z^2}$.
611
+
612
+ ### Classification / comparison functions <a id="c.math.fpclass">[[c.math.fpclass]]</a>
613
+
614
+ The classification / comparison functions behave the same as the C
615
+ macros with the corresponding names defined in the C standard library.
616
+ Each function is overloaded for the three floating-point types.
617
+
618
+ ISO C 7.12.3, 7.12.4
619
+
620
+ ### Mathematical special functions <a id="sf.cmath">[[sf.cmath]]</a>
621
+
622
+ If any argument value to any of the functions specified in this
623
+ subclause is a NaN (Not a Number), the function shall return a NaN but
624
+ it shall not report a domain error. Otherwise, the function shall report
625
+ a domain error for just those argument values for which:
626
+
627
+ - the function description’s *Returns:* clause explicitly specifies a
628
+ domain and those argument values fall outside the specified domain, or
629
+ - the corresponding mathematical function value has a nonzero imaginary
630
+ component, or
631
+ - the corresponding mathematical function is not mathematically
632
+ defined.[^18]
633
+
634
+ Unless otherwise specified, each function is defined for all finite
635
+ values, for negative infinity, and for positive infinity.
636
+
637
+ #### Associated Laguerre polynomials <a id="sf.cmath.assoc_laguerre">[[sf.cmath.assoc_laguerre]]</a>
638
+
639
+ ``` cpp
640
+ double assoc_laguerre(unsigned n, unsigned m, double x);
641
+ float assoc_laguerref(unsigned n, unsigned m, float x);
642
+ long double assoc_laguerrel(unsigned n, unsigned m, long double x);
643
+ ```
644
+
645
+ *Effects:* These functions compute the associated Laguerre polynomials
646
+ of their respective arguments `n`, `m`, and `x`.
647
+
648
+ *Returns:* $$%
649
+ \mathsf{L}_n^m(x) =
650
+ (-1)^m \frac{\mathsf{d} ^ m}
651
+ {\mathsf{d}x ^ m} \, \mathsf{L}_{n+m}(x),
652
+ \quad \mbox{for $x \ge 0$}$$ where n is `n`, m is `m`, and x is
653
+ `x`.
654
+
655
+ *Remarks:* The effect of calling each of these functions is
656
+ *implementation-defined* if `n >= 128` or if `m >= 128`.
657
+
658
+ #### Associated Legendre functions <a id="sf.cmath.assoc_legendre">[[sf.cmath.assoc_legendre]]</a>
659
+
660
+ ``` cpp
661
+ double assoc_legendre(unsigned l, unsigned m, double x);
662
+ float assoc_legendref(unsigned l, unsigned m, float x);
663
+ long double assoc_legendrel(unsigned l, unsigned m, long double x);
664
+ ```
665
+
666
+ *Effects:* These functions compute the associated Legendre functions of
667
+ their respective arguments `l`, `m`, and `x`.
668
+
669
+ *Returns:* $$%
670
+ \mathsf{P}_\ell^m(x) =
671
+ (1 - x^2) ^ {m/2}
672
+ \:
673
+ \frac{ \mathsf{d} ^ m}
674
+ { \mathsf{d}x ^ m} \, \mathsf{P}_\ell(x),
675
+ \quad \mbox{for $|x| \le 1$}$$ where l is `l`, m is `m`, and x is
676
+ `x`.
677
+
678
+ *Remarks:* The effect of calling each of these functions is
679
+ *implementation-defined* if `l >= 128`.
680
+
681
+ #### Beta function <a id="sf.cmath.beta">[[sf.cmath.beta]]</a>
682
+
683
+ ``` cpp
684
+ double beta(double x, double y);
685
+ float betaf(float x, float y);
686
+ long double betal(long double x, long double y);
687
+ ```
688
+
689
+ *Effects:* These functions compute the beta function of their respective
690
+ arguments `x` and `y`.
691
+
692
+ *Returns:* $$%
693
+ \mathsf{B}(x, y) =
694
+ \frac{ \Gamma(x) \, \Gamma(y) }
695
+ { \Gamma(x+y) },
696
+ \quad \mbox{for $x > 0$,\, $y > 0$}$$ where x is `x` and y is
697
+ `y`.
698
+
699
+ #### Complete elliptic integral of the first kind <a id="sf.cmath.comp_ellint_1">[[sf.cmath.comp_ellint_1]]</a>
700
+
701
+ ``` cpp
702
+ double comp_ellint_1(double k);
703
+ float comp_ellint_1f(float k);
704
+ long double comp_ellint_1l(long double k);
705
+ ```
706
+
707
+ *Effects:* These functions compute the complete elliptic integral of the
708
+ first kind of their respective arguments `k`.
709
+
710
+ *Returns:* $$%
711
+ \mathsf{K}(k) =
712
+ \mathsf{F}(k, \pi / 2),
713
+ \quad \mbox{for $|k| \le 1$}$$ where k is `k`.
714
+
715
+ See also [[sf.cmath.ellint_1]].
716
+
717
+ #### Complete elliptic integral of the second kind <a id="sf.cmath.comp_ellint_2">[[sf.cmath.comp_ellint_2]]</a>
718
+
719
+ ``` cpp
720
+ double comp_ellint_2(double k);
721
+ float comp_ellint_2f(float k);
722
+ long double comp_ellint_2l(long double k);
723
+ ```
724
+
725
+ *Effects:* These functions compute the complete elliptic integral of the
726
+ second kind of their respective arguments `k`.
727
+
728
+ *Returns:* $$%
729
+ \mathsf{E}(k) =
730
+ \mathsf{E}(k, \pi / 2),
731
+ \quad \mbox{for $|k| \le 1$}$$ where k is `k`.
732
+
733
+ See also [[sf.cmath.ellint_2]].
734
+
735
+ #### Complete elliptic integral of the third kind <a id="sf.cmath.comp_ellint_3">[[sf.cmath.comp_ellint_3]]</a>
736
+
737
+ ``` cpp
738
+ double comp_ellint_3(double k, double nu);
739
+ float comp_ellint_3f(float k, float nu);
740
+ long double comp_ellint_3l(long double k, long double nu);
741
+ ```
742
+
743
+ *Effects:* These functions compute the complete elliptic integral of the
744
+ third kind of their respective arguments `k` and `nu`.
745
+
746
+ *Returns:* $$%
747
+ \mathsf{\Pi}(\nu, k) = \mathsf{\Pi}(\nu, k, \pi / 2),
748
+ \quad \mbox{for $|k| \le 1$}$$ where k is `k` and $\nu$ is `nu`.
749
+
750
+ See also [[sf.cmath.ellint_3]].
751
+
752
+ #### Regular modified cylindrical Bessel functions <a id="sf.cmath.cyl_bessel_i">[[sf.cmath.cyl_bessel_i]]</a>
753
+
754
+ ``` cpp
755
+ double cyl_bessel_i(double nu, double x);
756
+ float cyl_bessel_if(float nu, float x);
757
+ long double cyl_bessel_il(long double nu, long double x);
758
+ ```
759
+
760
+ *Effects:* These functions compute the regular modified cylindrical
761
+ Bessel functions of their respective arguments `nu` and `x`.
762
+
763
+ *Returns:* $$%
764
+ \mathsf{I}_\nu(x) =
765
+ i^{-\nu} \mathsf{J}_\nu(ix)
766
+ =
767
+ \sum_{k=0}^\infty \frac{(x/2)^{\nu+2k}}
768
+ {k! \: \Gamma(\nu+k+1)},
769
+ \quad \mbox{for $x \ge 0$}$$ where $\nu$ is `nu` and x is `x`.
770
+
771
+ *Remarks:* The effect of calling each of these functions is
772
+ *implementation-defined* if `nu >= 128`.
773
+
774
+ See also [[sf.cmath.cyl_bessel_j]].
775
+
776
+ #### Cylindrical Bessel functions of the first kind <a id="sf.cmath.cyl_bessel_j">[[sf.cmath.cyl_bessel_j]]</a>
777
+
778
+ ``` cpp
779
+ double cyl_bessel_j(double nu, double x);
780
+ float cyl_bessel_jf(float nu, float x);
781
+ long double cyl_bessel_jl(long double nu, long double x);
782
+ ```
783
+
784
+ *Effects:* These functions compute the cylindrical Bessel functions of
785
+ the first kind of their respective arguments `nu` and `x`.
786
+
787
+ *Returns:* $$%
788
+ \mathsf{J}_\nu(x) =
789
+ \sum_{k=0}^\infty \frac{(-1)^k (x/2)^{\nu+2k}}
790
+ {k! \: \Gamma(\nu+k+1)},
791
+ \quad \mbox{for $x \ge 0$}$$ where $\nu$ is `nu` and x is `x`.
792
+
793
+ *Remarks:* The effect of calling each of these functions is
794
+ *implementation-defined* if `nu >= 128`.
795
+
796
+ #### Irregular modified cylindrical Bessel functions <a id="sf.cmath.cyl_bessel_k">[[sf.cmath.cyl_bessel_k]]</a>
797
+
798
+ ``` cpp
799
+ double cyl_bessel_k(double nu, double x);
800
+ float cyl_bessel_kf(float nu, float x);
801
+ long double cyl_bessel_kl(long double nu, long double x);
802
+ ```
803
+
804
+ *Effects:* These functions compute the irregular modified cylindrical
805
+ Bessel functions of their respective arguments `nu` and `x`.
806
+
807
+ *Returns:* $$%
808
+ \mathsf{K}_\nu(x) =
809
+ (\pi/2)i^{\nu+1} ( \mathsf{J}_\nu(ix)
810
+ + i \mathsf{N}_\nu(ix)
811
+ )
812
+ =
813
+ \left\{
814
+ \begin{array}{cl}
815
+ \displaystyle
816
+ \frac{\pi}{2}
817
+ \frac{\mathsf{I}_{-\nu}(x) - \mathsf{I}_{\nu}(x)}
818
+ {\sin \nu\pi },
819
+ & \mbox{for $x \ge 0$ and non-integral $\nu$}
820
+ \\
821
+ \\
822
+ \displaystyle
823
+ \frac{\pi}{2}
824
+ \lim_{\mu \rightarrow \nu} \frac{\mathsf{I}_{-\mu}(x) - \mathsf{I}_{\mu}(x)}
825
+ {\sin \mu\pi },
826
+ & \mbox{for $x \ge 0$ and integral $\nu$}
827
+ \end{array}
828
+ \right.$$ where $\nu$ is `nu` and x is `x`.
829
+
830
+ *Remarks:* The effect of calling each of these functions is
831
+ *implementation-defined* if `nu >= 128`.
832
+
833
+ See also [[sf.cmath.cyl_bessel_i]], [[sf.cmath.cyl_bessel_j]],
834
+ [[sf.cmath.cyl_neumann]].
835
+
836
+ #### Cylindrical Neumann functions <a id="sf.cmath.cyl_neumann">[[sf.cmath.cyl_neumann]]</a>
837
+
838
+ ``` cpp
839
+ double cyl_neumann(double nu, double x);
840
+ float cyl_neumannf(float nu, float x);
841
+ long double cyl_neumannl(long double nu, long double x);
842
+ ```
843
+
844
+ *Effects:* These functions compute the cylindrical Neumann functions,
845
+ also known as the cylindrical Bessel functions of the second kind, of
846
+ their respective arguments `nu` and `x`.
847
+
848
+ *Returns:* $$%
849
+ \mathsf{N}_\nu(x) =
850
+ \left\{
851
+ \begin{array}{cl}
852
+ \displaystyle
853
+ \frac{\mathsf{J}_\nu(x) \cos \nu\pi - \mathsf{J}_{-\nu}(x)}
854
+ {\sin \nu\pi },
855
+ & \mbox{for $x \ge 0$ and non-integral $\nu$}
856
+ \\
857
+ \\
858
+ \displaystyle
859
+ \lim_{\mu \rightarrow \nu} \frac{\mathsf{J}_\mu(x) \cos \mu\pi - \mathsf{J}_{-\mu}(x)}
860
+ {\sin \mu\pi },
861
+ & \mbox{for $x \ge 0$ and integral $\nu$}
862
+ \end{array}
863
+ \right.$$ where $\nu$ is `nu` and x is `x`.
864
+
865
+ *Remarks:* The effect of calling each of these functions is
866
+ *implementation-defined* if `nu >= 128`.
867
+
868
+ See also [[sf.cmath.cyl_bessel_j]].
869
+
870
+ #### Incomplete elliptic integral of the first kind <a id="sf.cmath.ellint_1">[[sf.cmath.ellint_1]]</a>
871
+
872
+ ``` cpp
873
+ double ellint_1(double k, double phi);
874
+ float ellint_1f(float k, float phi);
875
+ long double ellint_1l(long double k, long double phi);
876
+ ```
877
+
878
+ *Effects:* These functions compute the incomplete elliptic integral of
879
+ the first kind of their respective arguments `k` and `phi` (`phi`
880
+ measured in radians).
881
+
882
+ *Returns:* $$%
883
+ \mathsf{F}(k, \phi) =
884
+ \int_0^\phi \! \frac{\mathsf{d}\theta}
885
+ {\sqrt{1 - k^2 \sin^2 \theta}},
886
+ \quad \mbox{for $|k| \le 1$}$$ where k is `k` and φ is `phi`.
887
+
888
+ #### Incomplete elliptic integral of the second kind <a id="sf.cmath.ellint_2">[[sf.cmath.ellint_2]]</a>
889
+
890
+ ``` cpp
891
+ double ellint_2(double k, double phi);
892
+ float ellint_2f(float k, float phi);
893
+ long double ellint_2l(long double k, long double phi);
894
+ ```
895
+
896
+ *Effects:* These functions compute the incomplete elliptic integral of
897
+ the second kind of their respective arguments `k` and `phi` (`phi`
898
+ measured in radians).
899
+
900
+ *Returns:* $$%
901
+ \mathsf{E}(k, \phi) =
902
+ \int_0^\phi \! \sqrt{1 - k^2 \sin^2 \theta} \, \mathsf{d}\theta,
903
+ \quad \mbox{for $|k| \le 1$}$$ where k is `k` and φ is `phi`.
904
+
905
+ #### Incomplete elliptic integral of the third kind <a id="sf.cmath.ellint_3">[[sf.cmath.ellint_3]]</a>
906
+
907
+ ``` cpp
908
+ double ellint_3(double k, double nu, double phi);
909
+ float ellint_3f(float k, float nu, float phi);
910
+ long double ellint_3l(long double k, long double nu, long double phi);
911
+ ```
912
+
913
+ *Effects:* These functions compute the incomplete elliptic integral of
914
+ the third kind of their respective arguments `k`, `nu`, and `phi` (`phi`
915
+ measured in radians).
916
+
917
+ *Returns:* $$%
918
+ \mathsf{\Pi}(\nu, k, \phi) =
919
+ \int_0^\phi \! \frac{ \mathsf{d}\theta }
920
+ { (1 - \nu \, \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta} },
921
+ \quad \mbox{for $|k| \le 1$}$$ where $\nu$ is `nu`, k is `k`, and
922
+ φ is `phi`.
923
+
924
+ #### Exponential integral <a id="sf.cmath.expint">[[sf.cmath.expint]]</a>
925
+
926
+ ``` cpp
927
+ double expint(double x);
928
+ float expintf(float x);
929
+ long double expintl(long double x);
930
+ ```
931
+
932
+ *Effects:* These functions compute the exponential integral of their
933
+ respective arguments `x`.
934
+
935
+ *Returns:* $$%
936
+ \mathsf{Ei}(x) =
937
+ - \int_{-x}^\infty \frac{e^{-t}}
938
+ {t } \, \mathsf{d}t
939
+ \;$$ where x is `x`.
940
+
941
+ #### Hermite polynomials <a id="sf.cmath.hermite">[[sf.cmath.hermite]]</a>
942
+
943
+ ``` cpp
944
+ double hermite(unsigned n, double x);
945
+ float hermitef(unsigned n, float x);
946
+ long double hermitel(unsigned n, long double x);
947
+ ```
948
+
949
+ *Effects:* These functions compute the Hermite polynomials of their
950
+ respective arguments `n` and `x`.
951
+
952
+ *Returns:* $$%
953
+ \mathsf{H}_n(x) =
954
+ (-1)^n e^{x^2} \frac{ \mathsf{d} ^n}
955
+ { \mathsf{d}x^n} \, e^{-x^2}
956
+ \;$$ where n is `n` and x is `x`.
957
+
958
+ *Remarks:* The effect of calling each of these functions is
959
+ *implementation-defined* if `n >= 128`.
960
+
961
+ #### Laguerre polynomials <a id="sf.cmath.laguerre">[[sf.cmath.laguerre]]</a>
962
+
963
+ ``` cpp
964
+ double laguerre(unsigned n, double x);
965
+ float laguerref(unsigned n, float x);
966
+ long double laguerrel(unsigned n, long double x);
967
+ ```
968
+
969
+ *Effects:* These functions compute the Laguerre polynomials of their
970
+ respective arguments `n` and `x`.
971
+
972
+ *Returns:* $$%
973
+ \mathsf{L}_n(x) =
974
+ \frac{e^x}{n!} \frac{ \mathsf{d} ^ n}
975
+ { \mathsf{d}x ^ n} \, (x^n e^{-x}),
976
+ \quad \mbox{for $x \ge 0$}$$ where n is `n` and x is `x`.
977
+
978
+ *Remarks:* The effect of calling each of these functions is
979
+ *implementation-defined* if `n >= 128`.
980
+
981
+ #### Legendre polynomials <a id="sf.cmath.legendre">[[sf.cmath.legendre]]</a>
982
+
983
+ ``` cpp
984
+ double legendre(unsigned l, double x);
985
+ float legendref(unsigned l, float x);
986
+ long double legendrel(unsigned l, long double x);
987
+ ```
988
+
989
+ *Effects:* These functions compute the Legendre polynomials of their
990
+ respective arguments `l` and `x`.
991
+
992
+ *Returns:* $$%
993
+ \mathsf{P}_\ell(x) =
994
+ \frac{1}
995
+ {2^\ell \, \ell!}
996
+ \frac{ \mathsf{d} ^ \ell}
997
+ { \mathsf{d}x ^ \ell} \, (x^2 - 1) ^ \ell,
998
+ \quad \mbox{for $|x| \le 1$}$$ where l is `l` and x is `x`.
999
+
1000
+ *Remarks:* The effect of calling each of these functions is
1001
+ *implementation-defined* if `l >= 128`.
1002
+
1003
+ #### Riemann zeta function <a id="sf.cmath.riemann_zeta">[[sf.cmath.riemann_zeta]]</a>
1004
+
1005
+ ``` cpp
1006
+ double riemann_zeta(double x);
1007
+ float riemann_zetaf(float x);
1008
+ long double riemann_zetal(long double x);
1009
+ ```
1010
+
1011
+ *Effects:* These functions compute the Riemann zeta function of their
1012
+ respective arguments `x`.
1013
+
1014
+ *Returns:* $$%
1015
+ \mathsf{\zeta}(x) =
1016
+ \left\{
1017
+ \begin{array}{cl}
1018
+ \displaystyle
1019
+ \sum_{k=1}^\infty k^{-x},
1020
+ & \mbox{for $x > 1$}
1021
+ \\
1022
+ \\
1023
+ \displaystyle
1024
+ \frac{1}
1025
+ {1 - 2^{1-x}}
1026
+ \sum_{k=1}^\infty (-1)^{k-1} k^{-x},
1027
+ & \mbox{for $0 \le x \le 1$}
1028
+ \\
1029
+ \\
1030
+ \displaystyle
1031
+ 2^x \pi^{x-1} \sin(\frac{\pi x}{2}) \, \Gamma(1-x) \, \zeta(1-x),
1032
+ & \mbox{for $x < 0$}
1033
+ \end{array}
1034
+ \right.
1035
+ \;$$ where x is `x`.
1036
+
1037
+ #### Spherical Bessel functions of the first kind <a id="sf.cmath.sph_bessel">[[sf.cmath.sph_bessel]]</a>
1038
+
1039
+ ``` cpp
1040
+ double sph_bessel(unsigned n, double x);
1041
+ float sph_besself(unsigned n, float x);
1042
+ long double sph_bessell(unsigned n, long double x);
1043
+ ```
1044
+
1045
+ *Effects:* These functions compute the spherical Bessel functions of the
1046
+ first kind of their respective arguments `n` and `x`.
1047
+
1048
+ *Returns:* $$%
1049
+ \mathsf{j}_n(x) =
1050
+ (\pi/2x)^{1\!/\!2} \mathsf{J}_{n + 1\!/\!2}(x),
1051
+ \quad \mbox{for $x \ge 0$}$$ where n is `n` and x is `x`.
1052
+
1053
+ *Remarks:* The effect of calling each of these functions is
1054
+ *implementation-defined* if `n >= 128`.
1055
+
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
+ double sph_legendre(unsigned l, unsigned m, double theta);
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
1067
+ functions of their respective arguments `l`, `m`, and `theta` (`theta`
1068
+ measured in radians).
1069
+
1070
+ *Returns:* $$%
1071
+ \mathsf{Y}_\ell^m(\theta, 0)
1072
+ \;$$ where $$%
1073
+ \mathsf{Y}_\ell^m(\theta, \phi) =
1074
+ (-1)^m \left[ \frac{(2 \ell + 1)}
1075
+ {4 \pi}
1076
+ \frac{(\ell - m)!}
1077
+ {(\ell + m)!}
1078
+ \right]^{1/2}
1079
+ \mathsf{P}_\ell^m
1080
+ ( \cos\theta ) e ^ {i m \phi},
1081
+ \quad \mbox{for $|m| \le \ell$}$$ and l is `l`, m is `m`, and θ
1082
+ is `theta`.
1083
+
1084
+ *Remarks:* The effect of calling each of these functions is
1085
+ *implementation-defined* if `l >= 128`.
1086
+
1087
+ See also [[sf.cmath.assoc_legendre]].
1088
+
1089
+ #### Spherical Neumann functions <a id="sf.cmath.sph_neumann">[[sf.cmath.sph_neumann]]</a>
1090
+
1091
+ ``` cpp
1092
+ double sph_neumann(unsigned n, double x);
1093
+ float sph_neumannf(unsigned n, float x);
1094
+ long double sph_neumannl(unsigned n, long double x);
1095
+ ```
1096
+
1097
+ *Effects:* These functions compute the spherical Neumann functions, also
1098
+ known as the spherical Bessel functions of the second kind, of their
1099
+ respective arguments `n` and `x`.
1100
+
1101
+ *Returns:* $$%
1102
+ \mathsf{n}_n(x) =
1103
+ (\pi/2x)^{1\!/\!2} \mathsf{N}_{n + 1\!/\!2}(x),
1104
+ \quad \mbox{for $x \ge 0$}$$ where n is `n` and x is `x`.
1105
+
1106
+ *Remarks:* The effect of calling each of these functions is
1107
+ *implementation-defined* if `n >= 128`.
1108
+
1109
+ See also [[sf.cmath.cyl_neumann]].
1110
 
1111
  <!-- Link reference definitions -->
1112
  [accumulate]: #accumulate
1113
  [adjacent.difference]: #adjacent.difference
1114
  [algorithms]: algorithms.md#algorithms
1115
  [bad.alloc]: language.md#bad.alloc
1116
  [basic.fundamental]: basic.md#basic.fundamental
1117
  [basic.stc.thread]: basic.md#basic.stc.thread
1118
  [basic.types]: basic.md#basic.types
1119
  [c.math]: #c.math
1120
+ [c.math.abs]: #c.math.abs
1121
+ [c.math.fpclass]: #c.math.fpclass
1122
+ [c.math.hypot3]: #c.math.hypot3
1123
+ [c.math.rand]: #c.math.rand
1124
  [cfenv]: #cfenv
1125
  [cfenv.syn]: #cfenv.syn
1126
  [class.gslice]: #class.gslice
1127
  [class.gslice.overview]: #class.gslice.overview
1128
  [class.slice]: #class.slice
1129
  [class.slice.overview]: #class.slice.overview
1130
+ [cmath.syn]: #cmath.syn
1131
  [cmplx.over]: #cmplx.over
1132
  [complex]: #complex
1133
  [complex.literals]: #complex.literals
1134
  [complex.member.ops]: #complex.member.ops
1135
  [complex.members]: #complex.members
 
1138
  [complex.special]: #complex.special
1139
  [complex.syn]: #complex.syn
1140
  [complex.transcendentals]: #complex.transcendentals
1141
  [complex.value.ops]: #complex.value.ops
1142
  [cons.slice]: #cons.slice
1143
+ [conv.prom]: conv.md#conv.prom
1144
+ [cpp.pragma]: cpp.md#cpp.pragma
1145
+ [cstdlib.syn]: language.md#cstdlib.syn
1146
+ [dcl.array]: dcl.md#dcl.array
1147
  [dcl.init]: dcl.md#dcl.init
1148
+ [exclusive.scan]: #exclusive.scan
1149
  [function.objects]: utilities.md#function.objects
1150
  [gslice.access]: #gslice.access
1151
  [gslice.array.assign]: #gslice.array.assign
1152
  [gslice.array.comp.assign]: #gslice.array.comp.assign
1153
  [gslice.array.fill]: #gslice.array.fill
1154
  [gslice.cons]: #gslice.cons
1155
+ [implimits]: limits.md#implimits
1156
+ [inclusive.scan]: #inclusive.scan
1157
  [indirect.array.assign]: #indirect.array.assign
1158
  [indirect.array.comp.assign]: #indirect.array.comp.assign
1159
  [indirect.array.fill]: #indirect.array.fill
1160
  [inner.product]: #inner.product
1161
+ [input.iterators]: iterators.md#input.iterators
1162
  [input.output]: input.md#input.output
1163
  [iostate.flags]: input.md#iostate.flags
1164
  [istream.formatted]: input.md#istream.formatted
1165
+ [iterator.requirements.general]: iterators.md#iterator.requirements.general
1166
+ [library.c]: library.md#library.c
1167
  [mask.array.assign]: #mask.array.assign
1168
  [mask.array.comp.assign]: #mask.array.comp.assign
1169
  [mask.array.fill]: #mask.array.fill
 
1170
  [numarray]: #numarray
1171
  [numeric.iota]: #numeric.iota
1172
  [numeric.ops]: #numeric.ops
1173
+ [numeric.ops.gcd]: #numeric.ops.gcd
1174
+ [numeric.ops.lcm]: #numeric.ops.lcm
1175
  [numeric.ops.overview]: #numeric.ops.overview
1176
  [numeric.requirements]: #numeric.requirements
1177
  [numerics]: #numerics
1178
+ [numerics.defns]: #numerics.defns
1179
  [numerics.general]: #numerics.general
1180
+ [output.iterators]: iterators.md#output.iterators
1181
  [partial.sum]: #partial.sum
1182
  [rand]: #rand
1183
  [rand.adapt]: #rand.adapt
1184
  [rand.adapt.disc]: #rand.adapt.disc
1185
  [rand.adapt.general]: #rand.adapt.general
 
1228
  [rand.synopsis]: #rand.synopsis
1229
  [rand.util]: #rand.util
1230
  [rand.util.canonical]: #rand.util.canonical
1231
  [rand.util.seedseq]: #rand.util.seedseq
1232
  [random.access.iterators]: iterators.md#random.access.iterators
1233
+ [reduce]: #reduce
1234
  [res.on.data.races]: library.md#res.on.data.races
1235
+ [sf.cmath]: #sf.cmath
1236
+ [sf.cmath.assoc_laguerre]: #sf.cmath.assoc_laguerre
1237
+ [sf.cmath.assoc_legendre]: #sf.cmath.assoc_legendre
1238
+ [sf.cmath.beta]: #sf.cmath.beta
1239
+ [sf.cmath.comp_ellint_1]: #sf.cmath.comp_ellint_1
1240
+ [sf.cmath.comp_ellint_2]: #sf.cmath.comp_ellint_2
1241
+ [sf.cmath.comp_ellint_3]: #sf.cmath.comp_ellint_3
1242
+ [sf.cmath.cyl_bessel_i]: #sf.cmath.cyl_bessel_i
1243
+ [sf.cmath.cyl_bessel_j]: #sf.cmath.cyl_bessel_j
1244
+ [sf.cmath.cyl_bessel_k]: #sf.cmath.cyl_bessel_k
1245
+ [sf.cmath.cyl_neumann]: #sf.cmath.cyl_neumann
1246
+ [sf.cmath.ellint_1]: #sf.cmath.ellint_1
1247
+ [sf.cmath.ellint_2]: #sf.cmath.ellint_2
1248
+ [sf.cmath.ellint_3]: #sf.cmath.ellint_3
1249
+ [sf.cmath.expint]: #sf.cmath.expint
1250
+ [sf.cmath.hermite]: #sf.cmath.hermite
1251
+ [sf.cmath.laguerre]: #sf.cmath.laguerre
1252
+ [sf.cmath.legendre]: #sf.cmath.legendre
1253
+ [sf.cmath.riemann_zeta]: #sf.cmath.riemann_zeta
1254
+ [sf.cmath.sph_bessel]: #sf.cmath.sph_bessel
1255
+ [sf.cmath.sph_legendre]: #sf.cmath.sph_legendre
1256
+ [sf.cmath.sph_neumann]: #sf.cmath.sph_neumann
1257
  [slice.access]: #slice.access
1258
  [slice.arr.assign]: #slice.arr.assign
1259
  [slice.arr.comp.assign]: #slice.arr.comp.assign
1260
  [slice.arr.fill]: #slice.arr.fill
1261
  [strings]: strings.md#strings
1262
  [tab:RandomDistribution]: #tab:RandomDistribution
1263
  [tab:RandomEngine]: #tab:RandomEngine
1264
  [tab:SeedSequence]: #tab:SeedSequence
1265
+ [tab:UniformRandomBitGenerator]: #tab:UniformRandomBitGenerator
1266
+ [tab:copyassignable]: #tab:copyassignable
1267
+ [tab:copyconstructible]: #tab:copyconstructible
1268
+ [tab:equalitycomparable]: #tab:equalitycomparable
1269
  [tab:iterator.input.requirements]: iterators.md#tab:iterator.input.requirements
1270
+ [tab:moveassignable]: #tab:moveassignable
1271
+ [tab:moveconstructible]: #tab:moveconstructible
 
 
1272
  [tab:numerics.lib.summary]: #tab:numerics.lib.summary
1273
  [template.gslice.array]: #template.gslice.array
1274
  [template.gslice.array.overview]: #template.gslice.array.overview
1275
  [template.indirect.array]: #template.indirect.array
1276
  [template.indirect.array.overview]: #template.indirect.array.overview
 
1279
  [template.slice.array]: #template.slice.array
1280
  [template.slice.array.overview]: #template.slice.array.overview
1281
  [template.valarray]: #template.valarray
1282
  [template.valarray.overview]: #template.valarray.overview
1283
  [thread.thread.class]: thread.md#thread.thread.class
1284
+ [transform.exclusive.scan]: #transform.exclusive.scan
1285
+ [transform.inclusive.scan]: #transform.inclusive.scan
1286
+ [transform.reduce]: #transform.reduce
1287
  [valarray.access]: #valarray.access
1288
  [valarray.assign]: #valarray.assign
1289
  [valarray.binary]: #valarray.binary
1290
  [valarray.cassign]: #valarray.cassign
1291
  [valarray.comparison]: #valarray.comparison
 
1321
  [^6]: The distribution corresponding to this probability density
1322
  function is also known (with a possible change of variable) as the
1323
  Gumbel Type I, the log-Weibull, or the Fisher-Tippett Type I
1324
  distribution.
1325
 
1326
+ [^7]: Annex  [[implimits]] recommends a minimum number of recursively
1327
  nested template instantiations. This requirement thus indirectly
1328
  suggests a minimum allowable complexity for valarray expressions.
1329
 
1330
  [^8]: The intent is to specify an array template that has the minimum
1331
  functionality necessary to address aliasing ambiguities and the
1332
  proliferation of temporaries. Thus, the `valarray` template is
1333
  neither a matrix class nor a field class. However, it is a very
1334
  useful building block for designing such classes.
1335
 
1336
+ [^9]: This default constructor is essential, since arrays of `valarray`
 
 
 
1337
  may be useful. After initialization, the length of an empty array
1338
  can be increased with the `resize` member function.
1339
 
1340
+ [^10]: This constructor is the preferred method for converting a C array
1341
  to a `valarray` object.
1342
 
1343
+ [^11]: This copy constructor creates a distinct array rather than an
1344
  alias. Implementations in which arrays share storage are permitted,
1345
  but they shall implement a copy-on-reference mechanism to ensure
1346
  that arrays are conceptually distinct.
1347
 
1348
+ [^12]: BLAS stands for *Basic Linear Algebra Subprograms.* C++programs
 
 
 
 
1349
  may instantiate this class. See, for example, Dongarra, Du Croz,
1350
  Duff, and Hammerling: *A set of Level 3 Basic Linear Algebra
1351
  Subprograms*; Technical Report MCS-P1-0888, Argonne National
1352
  Laboratory (USA), Mathematics and Computer Science Division, August,
1353
  1988.
1354
 
1355
+ [^13]: The use of fully closed ranges is intentional.
1356
+
1357
+ [^14]: `accumulate` is similar to the APL reduction operator and Common
1358
  Lisp reduce function, but it avoids the difficulty of defining the
1359
  result of reduction on an empty sequence by always requiring an
1360
  initial value.
1361
 
1362
+ [^15]: The use of fully closed ranges is intentional.
1363
 
1364
+ [^16]: The use of fully closed ranges is intentional.
1365
 
1366
+ [^17]: The use of fully closed ranges is intentional.
1367
 
1368
+ [^18]: A mathematical function is mathematically defined for a given set
1369
+ of argument values (a) if it is explicitly defined for that set of
1370
+ argument values, or (b) if its limiting value exists and does not
1371
+ depend on the direction of approach.