IMSL_ERFC

Syntax | Return Value | Arguments | Keywords | Discussion | Examples | Errors | Version History

The IMSL_ERFC function evaluates the real complementary error function erfc(x). Using a keyword, the inverse complementary error function erfc–1(x) can be evaluated.

Note
This routine requires an IDL Advanced Math and Stats license. For more information, contact your ITT Visual Information Solutions sales or technical support representative.

Syntax

Result = IMSL_ERFC(x [, /DOUBLE] [, /INVERSE])

Return Value

The value of the complementary error function erfc(x).

Arguments

x

Expression for which the complementary error function is to be evaluated.

Keywords

DOUBLE

If present and nonzero, double precision is used.

INVERSE

Evaluates the inverse complementary error function erfc–1(x). The parameter must be in the range 0 < x < 2.

Discussion

The complementary error function erfc(x) is defined as:

IMSL_ERFC-08.jpg

where parameter x must not be so large that the result underflows. Approximately, x should be less than:

IMSL_ERFC-09.jpg

where s is the smallest representable floating-point number.

The inverse complementary error function y = erfc–1(x) is such that x = erfc(y).

Examples

Example 1

Plot the complementary error function over [–3, 3]. The results are shown in Figure 12-3.

x = FINDGEN(100)/99 
PLOT, 6 * x - 3, IMSL_ERFC(6 * x - 3), XTitle = 'x', $ 
   YTitle = 'erfc(x)' 

Figure 12-3: Plot of erf(x)

special03.gif

Example 2

Plot the inverse of the complementary error function over (0, 2). The results are shown in Figure 12-4.

x = FINDGEN(100)/99 
PLOT, 2 * x(1:98), IMSL_ERFC(2 * x(1:98), /Inverse), $ 
   XTitle = 'x', YTitle = 'erfc!E-1!N(x)' 

Figure 12-4: Plot of erfc–1(x)

special04.gif

Errors

Alert Errors

MATH_LARGE_ARG_UNDERFLOW—Parameter x must not be so large that the result underflows. Very approximately, x should be less than:

IMSL_ERFC-10.jpg

where ε is the machine precision.

Warning Errors

MATH_LARGE_ARG_WARN—Parameter |x| should be less than

IMSL_ERFC-11.jpg

where ε is the machine precision, to prevent the answer from being less accurate than half precision.

Fatal Errors

MATH_ERF_ALGORITHM—Algorithm failed to converge.

MATH_SMALL_ARG_OVERFLOW—Computation of:

IMSL_ERFC-12.jpg

must not overflow.

MATH_REAL_OUT_OF_RANGE—Function is defined only for 0 < x < 2.

Version History

6.4

Introduced