1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" References consulted:
8 .\" Linux libc source code
9 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
11 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
12 .\" Modified 2002-07-27 by Walter Harms
13 .\" (walter.harms@informatik.uni-oldenburg.de)
15 .TH ERF 3 2021-03-22 "GNU" "Linux Programmer's Manual"
17 erf, erff, erfl \- error function
20 .RI ( libm ", " \-lm )
25 .BI "double erf(double " x );
26 .BI "float erff(float " x );
27 .BI "long double erfl(long double " x );
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
45 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
46 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
47 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
50 These functions return the error function of
56 erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(\-t*t) dt
60 On success, these functions return the value of the error function of
62 a value in the range [\-1,\ 1].
66 is a NaN, a NaN is returned.
70 is +0 (\-0), +0 (\-0) is returned.
74 is positive infinity (negative infinity),
81 and the return value is 2*x/sqrt(pi).
85 for information on how to determine whether an error has occurred
86 when calling these functions.
88 The following errors can occur:
90 Range error: result underflow (\fIx\fP is subnormal)
94 An underflow floating-point exception
98 These functions do not set
100 .\" It is intentional that these functions do not set errno for this case
101 .\" see http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
103 For an explanation of the terms used in this section, see
111 Interface Attribute Value
116 T} Thread safety MT-Safe
122 C99, POSIX.1-2001, POSIX.1-2008.
124 The variant returning