EXPINT

The EXPINT function returns the value of the exponential integral E n ( x ).

EXPINT is based on the routine expint described in section 6.3 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.

Calling Sequence

Result = EXPINT( N, X )

Arguments

N

An integer specifying the order of E n ( x ). N can be either a scalar or an array.

X

The value at which E n ( x ) is evaluated. X can be either a scalar or an array.

Note: If an array is specified for both N and X , then EXPINT evaluates E n ( x ) for each N i and X i . If either N or X is a scalar and the other an array, the scalar is paired with each array element in turn.

Keywords

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

ITMAX

An input integer specifying the maximum allowed number of iterations. The default value is 100.

EPS

Use this keyword to specify a number close to the desired relative error. For single-precision calculations, the default value is 1.0  ¥  10 -7 . For double-precision calculations, the default value is 1.0  ¥  10 -14 .

Example

To compute the value of the exponential integral at the following X values:

X = [1.00, 1.05, 1.27, 1.34, 1.38, 1.50]

; Define the parametric X values.

result = EXPINT(1, X) ; Compute the exponential integral of order 1.

PRINT, result ; Print the result.

IDL prints:

  0.219384 0.201873 0.141911 0.127354 0.119803 0.100020

This is the exact solution vector to six-decimal accuracy.

See Also

ERRORF