IGAMMA

The IGAMMA function computes the incomplete gamma function.

IGAMMA uses either a power series representation or a continued fractions method. If X is less than or equal to A +1, a power series representation is used. If X is greater than A +1, a continued fractions method is used.

This routine is written in the IDL language. Its source code can be found in the file igamma.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = IGAMMA( A, X )

Arguments

A

A positive integer, single-, or double-precision floating-point scalar that specifies the parametric exponent of the integrand.

X

An integer, single-, or double-precision floating-point scalar that spe`eFcifies the upper limit of integration.

Keywords

METHOD

Set this keyword to a named variable that will contain the method used to compute the incomplete gamma function. A value of 0 indicates that a power series representation was used. A value of 1 indicates that a continued fractions method was used.

Example

Compute the incomplete gamma function for the corresponding elements of A and X.

Define an array of parametric exponents.

A = [0.10, 0.50, 1.00, 1.10, 6.00, 26.00]

Define the upper limits of integration.

X = [0.0316228, 0.0707107, 5.00000, 1.04881, 2.44949, 25.4951]

Allocate an array to store the results.

result = FLTARR(N_ELEMENTS(A))

Compute the incomplete gamma functions. Note that the result for each element in the input arrays must be computed individually.

FOR K = 0, N_ELEMENTS(A)-1 DO $

result[K] = IGAMMA(A[K], X[K])

PRINT, result

IDL prints:

[0.742026, 0.293128, 0.993262, 0.607646, 0.0387318, 0.486387]

See Also

BETA , GAMMA , IBETA , LNGAMMA