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


erfc

You can use the erfc function to perform the complementary error function.

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

erfc(x) = 1.0+-erf(x)

For large positive numbers (around 10), use the function call erfc(x) instead of the expression 1.0 - erf(x). The call erfc(x) produces a more exact result.

EXCEPTIONS
When x is finite and nonzero, either the result of erfc(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-36 shows the results when the argument to the erfc function is a zero, a NaN, or an Infinity.
Special cases for the erfc function
OperationResultExceptions raised
erfc(+0) +1None
erfc(-0) +1None
erfc(NaN) NaNNone[60]
erfc(+ ) +0None
erfc(- ) +2None

EXAMPLES
z = erfc(-INFINITY); /* z = 1 - erf() = 1 - -1 = +2.0 */
z = erfc(0.0);       /* z = 1 - erf(0) = 1 - 0 = 1.0 */

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

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996