.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" Modified 2002-07-27 by Walter Harms
.\" (walter.harms@informatik.uni-oldenburg.de)
.\"
-.TH ERF 3 2008-08-05 "GNU" "Linux Programmer's Manual"
+.TH ERF 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
-erf, erff, erfl, \- error function
+erf, erff, erfl \- error function
.SH SYNOPSIS
.nf
.B #include <math.h>
-
+.PP
.BI "double erf(double " x );
.BI "float erff(float " x );
.BI "long double erfl(long double " x );
-
+.PP
.fi
Link with \fI\-lm\fP.
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR erf ():
.RS 4
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
-_POSIX_C_SOURCE\ >=\ 200112L;
-.br
-or
-.I cc\ -std=c99
+_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE
+ || /* Since glibc 2.19: */ _DEFAULT_SOURCE
+ || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.RE
.br
.BR erff (),
.BR erfl ():
.RS 4
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
-_POSIX_C_SOURCE\ >=\ 200112L;
-.br
-or
-.I cc\ -std=c99
+_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
+ || /* Since glibc 2.19: */ _DEFAULT_SOURCE
+ || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.RE
.ad b
.SH DESCRIPTION
-The
-.BR erf ()
-function returns the error function of \fIx\fP, defined
-as
+These functions return the error function of
+.IR x ,
+defined as
.TP
- erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(\-t*t) dt
+ erf(x) = 2/sqrt(pi) * integral from 0 to x of exp(\-t*t) dt
.SH RETURN VALUE
-On success, these functions return the error function of
+On success, these functions return the value of the error function of
.IR x ,
a value in the range [\-1,\ 1].
-
+.PP
If
.I x
is a NaN, a NaN is returned.
-
+.PP
If
.I x
is +0 (\-0), +0 (\-0) is returned.
-
+.PP
If
.I x
is positive infinity (negative infinity),
+1 (\-1) is returned.
-
+.PP
If
.I x
is subnormal,
.PP
These functions do not set
.IR errno .
-.\" FIXME . Is it intentional that these functions do not set errno?
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
-.SH "CONFORMING TO"
-C99, POSIX.1-2001.
+.\" It is intentional that these functions do not set errno for this case
+.\" see http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbw21 lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR erf (),
+.BR erff (),
+.BR erfl ()
+T} Thread safety MT-Safe
+.TE
+.SH CONFORMING TO
+C99, POSIX.1-2001, POSIX.1-2008.
+.PP
The variant returning
.I double
also conforms to
SVr4, 4.3BSD.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR cerf (3),
.BR erfc (3),
.BR exp (3)