Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions / Error and Gamma Functions


erf

You can use the erf function to perform the error function.

double_t erf (double_t x);
x
Any floating-point number.
DESCRIPTION
The erf function computes the error function of its argument. This function is antisymmetric.

erf(x) = 2 OVER pi0xe(-t)2dt

EXCEPTIONS
When x is finite and nonzero, either the result of erf(x) is exact or it raises one of the following exceptions:

  • inexact (if the result must be rounded or an underflow occurs)
  • underflow (if the result is inexact and must be represented as a denormalized number or 0)

SPECIAL CASES
Table 10-35 shows the results when the argument to the erf function is a zero, a NaN, or an Infinity.
Special cases for the erf function
OperationResultExceptions raised
erf(+0) +0None
erf(-0) -0 None
erf(NaN) NaNNone[59]
erf(+ ) +1None
erf(- ) -1None

EXAMPLES
z = erf(1.0);     /* z  0.842701. The inexact exception is 
                     raised. */
z = erf(-1.0);    /* z  -0.842701. The inexact exception is 
                     raised. */

[59] If the NaN is a signaling NaN, the invalid exception is raised.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996