2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\" References consulted:
9 .\" Linux libc source code
10 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
12 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
13 .\" Modified 2002-07-27 by Walter Harms
14 .\" (walter.harms@informatik.uni-oldenburg.de)
16 .TH erf 3 (date) "Linux man-pages (unreleased)"
18 erf, erff, erfl \- error function
21 .RI ( libm ", " \-lm )
26 .BI "double erf(double " x );
27 .BI "float erff(float " x );
28 .BI "long double erfl(long double " x );
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
38 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
46 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
47 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
48 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
51 These functions return the error function of
57 erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(\-t*t) dt
61 On success, these functions return the value of the error function of
63 a value in the range [\-1,\ 1].
67 is a NaN, a NaN is returned.
71 is +0 (\-0), +0 (\-0) is returned.
75 is positive infinity (negative infinity),
82 and the return value is 2*x/sqrt(pi).
86 for information on how to determine whether an error has occurred
87 when calling these functions.
89 The following errors can occur:
91 Range error: result underflow (\fIx\fP is subnormal)
95 An underflow floating-point exception
99 These functions do not set
101 .\" It is intentional that these functions do not set errno for this case
102 .\" see https://www.sourceware.org/bugzilla/show_bug.cgi?id=6785
104 For an explanation of the terms used in this section, see
110 Interface Attribute Value
117 T} Thread safety MT-Safe
124 The variant returning