xref: /freebsd/lib/msun/man/erf.3 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1.\" Copyright (c) 1985, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd June 23, 2024
29.Dt ERF 3
30.Os
31.Sh NAME
32.Nm erf ,
33.Nm erff ,
34.Nm erfl ,
35.Nm erfc ,
36.Nm erfcf ,
37.Nm erfcl
38.Nd error function operators
39.Sh LIBRARY
40.Lb libm
41.Sh SYNOPSIS
42.In math.h
43.Ft double
44.Fn erf "double x"
45.Ft float
46.Fn erff "float x"
47.Ft "long double"
48.Fn erfl "long double x"
49.Ft double
50.Fn erfc "double x"
51.Ft float
52.Fn erfcf "float x"
53.Ft "long double"
54.Fn erfcl "long double x"
55.Sh DESCRIPTION
56These functions calculate the error function of
57.Fa x .
58.Pp
59The
60.Fn erf ,
61.Fn erff ,
62and
63.Fn erfl
64functions calculate the error function of x; where
65.Bd -ragged -offset indent
66.if n \{\
67erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
68\}
69.if t \{\
70erf\|(x) :=
71(2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
72\}
73.Ed
74.Pp
75The
76.Fn erfc ,
77.Fn erfcf ,
78and
79.Fn erfcl
80functions calculate the complementary error function of
81.Fa x ;
82that is
83.Fn erfc
84subtracts the result of the error function
85.Fn erf x
86from 1.0.
87.Sh SEE ALSO
88.Xr math 3
89.Sh STANDARDS
90The
91.Fn erf ,
92.Fn erff ,
93.Fn erfl ,
94.Fn erfc ,
95.Fn erfcf
96and
97.Fn erfcl
98functions conform to
99.St -isoC-99 .
100.Sh HISTORY
101The
102.Fn erf
103and
104.Fn erfc
105functions appeared in
106.Bx 4.3 .
107