Previous IDL Analyst Reference Guide: Special Functions Next

IMSL_ERF

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

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


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

Syntax

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

Return Value

The value of the error function erf(x).

Arguments

x

Expression for which the error function is to be evaluated.

Keywords

DOUBLE

If present and nonzero, double precision is used.

INVERSE

Evaluates the real inverse error function erf–1(x). The inverse error function is defined only for –1 < x < 1.

Discussion

The error function erf(x) is defined below:

All values of x are legal. The inverse error function y = erf –1(x) is such that x = erf (y).

Examples

Example 1

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

x = 6 * FINDGEN(100)/99 - 3  
PLOT, x, IMSL_ERF(x), XTitle = 'x', YTitle = 'erf(x)'  

 

Figure 12-1: Plot of erf(x)

Figure 12-1: Plot of erf(x)

Example 2

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

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

 

Figure 12-2: Plot of erf–1(x)

Figure 12-2: Plot of erf–1(x)

Version History

6.4
Introduced

  IDL Online Help (March 06, 2007)