nag_incomplete_gamma (s14bac) computes values for the incomplete gamma functions and .
nag_incomplete_gamma (s14bac) evaluates the incomplete gamma functions in the normalized form
with
and
, to a user-specified accuracy. With this normalization,
.
Several methods are used to evaluate the functions depending on the arguments
and
, the methods including Taylor expansion for
, Legendre's continued fraction for
, and power series for
. When both
and
are large, and
, the uniform asymptotic expansion of
Temme (1987) is employed for greater efficiency – specifically, this expansion is used when
and
.
This function is derived from the function GAM in
Gautschi (1979b).
Temme N M (1987) On the computation of the incomplete gamma functions for large values of the parameters Algorithms for Approximation (eds J C Mason and M G Cox) Oxford University Press
There are rare occasions when the relative accuracy attained is somewhat less than that specified by argument
tol. However, the error should never exceed more than one or two decimal places. Note also that there is a limit of
decimal places on the achievable accuracy, because constants in the function are given to this precision.
Not applicable.
The time taken for a call of nag_incomplete_gamma (s14bac) depends on the precision requested through
tol, and also varies slightly with the input arguments
and
.