Copyright © 1997 The Open Group

erf, erfc - error and complementary error functions

`#include <math.h> double erf(double`

x); double erfc(doublex);

Theerf()function computes the error function ofx, defined as:

The

erfc()function computes 1.0 -erf (x)An application wishing to check for error situations should set

errnoto 0 before callingerf(). Iferrnois non-zero on return, or the return value is NaN, an error has occurred.

Upon successful completion,erf()anderfc()return the value of the error function and complementary error function, respectively.If

xis NaN, NaN is returned anderrnomay be set to [EDOM].If the correct value would cause underflow, 0 is returned and

errnomay be set to [ERANGE].

Theerf()anderfc()functions may fail if:

- [EDOM]
- The value of
xis NaN.- [ERANGE]
- The result underflows.
No other errors will occur.

None.

Theerfc()function is provided because of the extreme loss of relative accuracy iferf ( x )is called for largexand the result subtracted from 1.0.

None.

isnan(),<math.h>.

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]