1erf(3)                     Library Functions Manual                     erf(3)
2
3
4

NAME

6       erf, erff, erfl - error function
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

12       #include <math.h>
13
14       double erf(double x);
15       float erff(float x);
16       long double erfl(long double x);
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       erf():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24
25       erff(), erfl():
26           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
27               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
28               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
29

DESCRIPTION

31       These functions return the error function of x, defined as
32
33           erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(-t*t) dt
34

RETURN VALUE

36       On  success,  these functions return the value of the error function of
37       x, a value in the range [-1, 1].
38
39       If x is a NaN, a NaN is returned.
40
41       If x is +0 (-0), +0 (-0) is returned.
42
43       If x is positive infinity (negative infinity), +1 (-1) is returned.
44
45       If x is subnormal, a range  error  occurs,  and  the  return  value  is
46       2*x/sqrt(pi).
47

ERRORS

49       See  math_error(7) for information on how to determine whether an error
50       has occurred when calling these functions.
51
52       The following errors can occur:
53
54       Range error: result underflow (x is subnormal)
55              An underflow floating-point exception (FE_UNDERFLOW) is raised.
56
57       These functions do not set errno.
58

ATTRIBUTES

60       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
61       tributes(7).
62
63       ┌────────────────────────────────────────────┬───────────────┬─────────┐
64Interface                                   Attribute     Value   
65       ├────────────────────────────────────────────┼───────────────┼─────────┤
66erf(), erff(), erfl()                       │ Thread safety │ MT-Safe │
67       └────────────────────────────────────────────┴───────────────┴─────────┘
68

STANDARDS

70       C11, POSIX.1-2008.
71

HISTORY

73       C99, POSIX.1-2001.
74
75       The variant returning double also conforms to SVr4, 4.3BSD.
76

SEE ALSO

78       cerf(3), erfc(3), exp(3)
79
80
81
82Linux man-pages 6.05              2023-07-20                            erf(3)
Impressum