1ERF(3) Linux Programmer's Manual ERF(3)
2
3
4
6 erf, erff, erfl - error function
7
9 #include <math.h>
10
11 double erf(double x);
12 float erff(float x);
13 long double erfl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 erf():
20 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
21 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
22 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
23
24 erff(), erfl():
25 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
26 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
27 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
28
30 These functions return the error function of x, defined as
31
32 erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(-t*t) dt
33
35 On success, these functions return the value of the error function of
36 x, a value in the range [-1, 1].
37
38 If x is a NaN, a NaN is returned.
39
40 If x is +0 (-0), +0 (-0) is returned.
41
42 If x is positive infinity (negative infinity), +1 (-1) is returned.
43
44 If x is subnormal, a range error occurs, and the return value is
45 2*x/sqrt(pi).
46
48 See math_error(7) for information on how to determine whether an error
49 has occurred when calling these functions.
50
51 The following errors can occur:
52
53 Range error: result underflow (x is subnormal)
54 An underflow floating-point exception (FE_UNDERFLOW) is raised.
55
56 These functions do not set errno.
57
59 For an explanation of the terms used in this section, see at‐
60 tributes(7).
61
62 ┌────────────────────────────────────────────┬───────────────┬─────────┐
63 │Interface │ Attribute │ Value │
64 ├────────────────────────────────────────────┼───────────────┼─────────┤
65 │erf(), erff(), erfl() │ Thread safety │ MT-Safe │
66 └────────────────────────────────────────────┴───────────────┴─────────┘
67
69 C99, POSIX.1-2001, POSIX.1-2008.
70
71 The variant returning double also conforms to SVr4, 4.3BSD.
72
74 cerf(3), erfc(3), exp(3)
75
77 This page is part of release 5.13 of the Linux man-pages project. A
78 description of the project, information about reporting bugs, and the
79 latest version of this page, can be found at
80 https://www.kernel.org/doc/man-pages/.
81
82
83
84GNU 2021-03-22 ERF(3)