]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/erf.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[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 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\" 386BSD man pages
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2002-07-27 by Walter Harms
31 .\" (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .TH ERF 3 2010-09-20 "GNU" "Linux Programmer's Manual"
34 .SH NAME
35 erf, erff, erfl, \- error function
36 .SH SYNOPSIS
37 .nf
38 .B #include <math.h>
39
40 .BI "double erf(double " x );
41 .BI "float erff(float " x );
42 .BI "long double erfl(long double " x );
43
44 .fi
45 Link with \fI\-lm\fP.
46 .sp
47 .in -4n
48 Feature Test Macro Requirements for glibc (see
49 .BR feature_test_macros (7)):
50 .in
51 .sp
52 .ad l
53 .BR erf ():
54 .RS 4
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
56 _POSIX_C_SOURCE\ >=\ 200112L;
57 .br
58 or
59 .I cc\ -std=c99
60 .RE
61 .br
62 .BR erff (),
63 .BR erfl ():
64 .RS 4
65 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
66 _POSIX_C_SOURCE\ >=\ 200112L;
67 .br
68 or
69 .I cc\ -std=c99
70 .RE
71 .ad b
72 .SH DESCRIPTION
73 The
74 .BR erf ()
75 function returns the error function of \fIx\fP, defined
76 as
77 .TP
78 erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(\-t*t) dt
79 .SH RETURN VALUE
80 On success, these functions return the error function of
81 .IR x ,
82 a value in the range [\-1,\ 1].
83
84 If
85 .I x
86 is a NaN, a NaN is returned.
87
88 If
89 .I x
90 is +0 (\-0), +0 (\-0) is returned.
91
92 If
93 .I x
94 is positive infinity (negative infinity),
95 +1 (\-1) is returned.
96
97 If
98 .I x
99 is subnormal,
100 a range error occurs,
101 and the return value is 2*x/sqrt(pi).
102 .SH ERRORS
103 See
104 .BR math_error (7)
105 for information on how to determine whether an error has occurred
106 when calling these functions.
107 .PP
108 The following errors can occur:
109 .TP
110 Range error: result underflow (\fIx\fP is subnormal)
111 .\" .I errno
112 .\" is set to
113 .\" .BR ERANGE .
114 An underflow floating-point exception
115 .RB ( FE_UNDERFLOW )
116 is raised.
117 .PP
118 These functions do not set
119 .IR errno .
120 .\" FIXME . Is it intentional that these functions do not set errno?
121 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
122 .SH CONFORMING TO
123 C99, POSIX.1-2001.
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)