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 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
21 _POSIX_C_SOURCE >= 200112L;
22 or cc -std=c99
23 erff(), erfl():
24 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
25 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
26 or cc -std=c99
27
29 The erf() function returns the error function of x, defined as
30
31 erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(-t*t) dt
32
34 On success, these functions return the error function of x, a value in
35 the range [-1, 1].
36
37 If x is a NaN, a NaN is returned.
38
39 If x is +0 (-0), +0 (-0) is returned.
40
41 If x is positive infinity (negative infinity), +1 (-1) is returned.
42
43 If x is subnormal, a range error occurs, and the return value is
44 2*x/sqrt(pi).
45
47 See math_error(7) for information on how to determine whether an error
48 has occurred when calling these functions.
49
50 The following errors can occur:
51
52 Range error: result underflow (x is subnormal)
53 An underflow floating-point exception (FE_UNDERFLOW) is raised.
54
55 These functions do not set errno.
56
58 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
59 4.3BSD.
60
62 cerf(3), erfc(3), exp(3)
63
65 This page is part of release 3.53 of the Linux man-pages project. A
66 description of the project, and information about reporting bugs, can
67 be found at http://www.kernel.org/doc/man-pages/.
68
69
70
71GNU 2010-09-20 ERF(3)