1ERF(P) POSIX Programmer's Manual ERF(P)
2
3
4
6 erf, erff, erfl - error functions
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
17 These functions shall compute the error function of their argument x,
18 defined as:
19
20 An application wishing to check for error situations should set errno
21 to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these
22 functions. On return, if errno is non-zero or fetestexcept(FE_INVALID
23 | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has
24 occurred.
25
27 Upon successful completion, these functions shall return the value of
28 the error function.
29
30 If x is NaN, a NaN shall be returned.
31
32 If x is ±0, ±0 shall be returned.
33
34 If x is ±Inf, ±1 shall be returned.
35
36 If x is subnormal, a range error may occur, and 2 * x/ sqrt(pi) should
37 be returned.
38
40 These functions may fail if:
41
42 Range Error
43 The result underflows.
44
45 If the integer expression (math_errhandling & MATH_ERRNO) is non-zero,
46 then errno shall be set to [ERANGE]. If the integer expression
47 (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow
48 floating-point exception shall be raised.
49
50
51 The following sections are informative.
52
54 None.
55
57 Underflow occurs when |x| < DBL_MIN * ( sqrt(pi)/2).
58
59 On error, the expressions (math_errhandling & MATH_ERRNO) and
60 (math_errhandling & MATH_ERREXCEPT) are independent of each other, but
61 at least one of them must be non-zero.
62
64 None.
65
67 None.
68
70 erfc() , feclearexcept() , fetestexcept() , isnan() , the Base Defini‐
71 tions volume of IEEE Std 1003.1-2001, Section 4.18, Treatment of Error
72 Conditions for Mathematical Functions, <math.h>
73
75 Portions of this text are reprinted and reproduced in electronic form
76 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
77 -- Portable Operating System Interface (POSIX), The Open Group Base
78 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
79 Electrical and Electronics Engineers, Inc and The Open Group. In the
80 event of any discrepancy between this version and the original IEEE and
81 The Open Group Standard, the original IEEE and The Open Group Standard
82 is the referee document. The original Standard can be obtained online
83 at http://www.opengroup.org/unix/online.html .
84
85
86
87IEEE/The Open Group 2003 ERF(P)