xref: /original-bsd/lib/libm/common_source/erf.3 (revision c3e32dec)
1.\" Copyright (c) 1985, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)erf.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt ERF 3
10.Os BSD 4.3
11.Sh NAME
12.Nm erf ,
13.Nm erfc
14.Nd error function operators
15.Sh SYNOPSIS
16.Fd #include <math.h>
17.Ft double
18.Fn erf "double x"
19.Ft double
20.Fn erfc "double x"
21.Sh DESCRIPTION
22These functions calculate the error function of
23.Fa x .
24.Pp
25The
26.Fn erf
27calculates the error function of x; where
28.Bd -filled -offset indent
29.if n \{\
30erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \}
31.if t \{\
32erf\|(x) :=
33(2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \}
34.Ed
35.Pp
36The
37.Fn erfc
38function calculates the complementary error function of
39.Fa x ;
40that is
41.Fn erfc
42subtracts the result of the error function
43.Fn erf x
44from 1.0.
45This is useful, since for large
46.Fa x
47places disappear.
48.Sh SEE ALSO
49.Xr math 3
50.Sh HISTORY
51The
52.Fn erf
53and
54.Fn erfc
55functions appeared in
56.Bx 4.3 .
57