]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/erf.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / erf.3
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>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .\" References consulted:
8 .\" Linux libc source code
9 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" 386BSD man pages
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)
14 .\"
15 .TH ERF 3 2021-03-22 "Linux man-pages (unreleased)"
16 .SH NAME
17 erf, erff, erfl \- error function
18 .SH LIBRARY
19 Math library
20 .RI ( libm ", " \-lm )
21 .SH SYNOPSIS
22 .nf
23 .B #include <math.h>
24 .PP
25 .BI "double erf(double " x );
26 .BI "float erff(float " x );
27 .BI "long double erfl(long double " x );
28 .PP
29 .fi
30 .RS -4
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
33 .RE
34 .PP
35 .BR erf ():
36 .nf
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
40 .fi
41 .PP
42 .BR erff (),
43 .BR erfl ():
44 .nf
45 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
46 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
47 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
48 .fi
49 .SH DESCRIPTION
50 These functions return the error function of
51 .IR x ,
52 defined as
53 .PP
54 .in +4n
55 .EX
56 erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(\-t*t) dt
57 .EE
58 .in
59 .SH RETURN VALUE
60 On success, these functions return the value of the error function of
61 .IR x ,
62 a value in the range [\-1,\ 1].
63 .PP
64 If
65 .I x
66 is a NaN, a NaN is returned.
67 .PP
68 If
69 .I x
70 is +0 (\-0), +0 (\-0) is returned.
71 .PP
72 If
73 .I x
74 is positive infinity (negative infinity),
75 +1 (\-1) is returned.
76 .PP
77 If
78 .I x
79 is subnormal,
80 a range error occurs,
81 and the return value is 2*x/sqrt(pi).
82 .SH ERRORS
83 See
84 .BR math_error (7)
85 for information on how to determine whether an error has occurred
86 when calling these functions.
87 .PP
88 The following errors can occur:
89 .TP
90 Range error: result underflow (\fIx\fP is subnormal)
91 .\" .I errno
92 .\" is set to
93 .\" .BR ERANGE .
94 An underflow floating-point exception
95 .RB ( FE_UNDERFLOW )
96 is raised.
97 .PP
98 These functions do not set
99 .IR errno .
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
102 .SH ATTRIBUTES
103 For an explanation of the terms used in this section, see
104 .BR attributes (7).
105 .ad l
106 .nh
107 .TS
108 allbox;
109 lbx lb lb
110 l l l.
111 Interface Attribute Value
112 T{
113 .BR erf (),
114 .BR erff (),
115 .BR erfl ()
116 T} Thread safety MT-Safe
117 .TE
118 .hy
119 .ad
120 .sp 1
121 .SH STANDARDS
122 C99, POSIX.1-2001, POSIX.1-2008.
123 .PP
124 The variant returning
125 .I double
126 also conforms to
127 SVr4, 4.3BSD.
128 .SH SEE ALSO
129 .BR cerf (3),
130 .BR erfc (3),
131 .BR exp (3)