Commit | Line | Data |
---|---|---|
f984ed4a | 1 | From Prof. Kahan at UC at Berkeley |
f9628029 KM |
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 | |
f984ed4a MAN |
10 | .SH NAME |
11 | erf, 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 | |
e4b02bf2 MAN |
23 | Erf\|(x) returns the error function of x; where |
24 | .if n \{\ | |
f984ed4a | 25 | .PP |
e4b02bf2 MAN |
26 | erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \} |
27 | .if t \{\ | |
28 | erf\|(x) := | |
29 | (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \} | |
f984ed4a | 30 | .PP |
e4b02bf2 | 31 | Erfc\|(x) returns 1.0\-erf\|(x). |
f984ed4a | 32 | .PP |
e4b02bf2 MAN |
33 | The entry for erfc is provided because of the extreme loss |
34 | of relative accuracy if erf\|(x) is called for large x | |
f984ed4a | 35 | and the result subtracted from 1. |
e4b02bf2 | 36 | (e.g. for x = 10, 12 places are lost). |
f984ed4a MAN |
37 | .SH SEE ALSO |
38 | intro(3M) |