| 1 | From 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 |
| 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 |
| 23 | Erf\|(x) returns the error function of x; where |
| 24 | .if n \{\ |
| 25 | .PP |
| 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. \} |
| 30 | .PP |
| 31 | Erfc\|(x) returns 1.0\-erf\|(x). |
| 32 | .PP |
| 33 | The entry for erfc is provided because of the extreme loss |
| 34 | of relative accuracy if erf\|(x) is called for large x |
| 35 | and the result subtracted from 1. |
| 36 | (e.g. for x = 10, 12 places are lost). |
| 37 | .SH SEE ALSO |
| 38 | intro(3M) |