4.3BSD version dated 09/12/85.
[unix-history] / usr / src / lib / libm / common_source / erf.3
... / ...
CommitLineData
1From Prof. Kahan at UC at Berkeley
2.\" Copyright (c) 1985 Regents of the University of California.
3.\" All rights reserved. The Berkeley software License Agreement
4.\" specifies the terms and conditions for redistribution.
5.\"
6.\" @(#)erf.3 6.1 (Berkeley) %G%
7.\"
8.TH ERF 3M ""
9.UC 6
10.SH NAME
11erf, erfc \- error functions
12.SH SYNOPSIS
13.nf
14.B #include <math.h>
15.PP
16.B double erf(x)
17.B double x;
18.PP
19.B double erfc(x)
20.B double x;
21.fi
22.SH DESCRIPTION
23Erf\|(x) returns the error function of x; where
24.if n \{\
25.PP
26erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \}
27.if t \{\
28erf\|(x) :=
29(2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \}
30.PP
31Erfc\|(x) returns 1.0\-erf\|(x).
32.PP
33The entry for erfc is provided because of the extreme loss
34of relative accuracy if erf\|(x) is called for large x
35and the result subtracted from 1.
36(e.g. for x = 10, 12 places are lost).
37.SH SEE ALSO
38intro(3M)