naginterfaces.library.specfun.gamma_incomplete¶
- naginterfaces.library.specfun.gamma_incomplete(a, x, tol)[source]¶
gamma_incomplete
computes values for the incomplete gamma functions and .For full information please refer to the NAG Library document for s14ba
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/s/s14baf.html
- Parameters
- afloat
The argument of the functions.
- xfloat
The argument of the functions.
- tolfloat
The relative accuracy required by you in the results. If
gamma_incomplete
is entered with greater than or less than machine precision, then the value of machine precision is used instead.
- Returns
- pfloat
The value of
- qfloat
The value of
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
Algorithm fails to terminate in iterations.
- Notes
gamma_incomplete
evaluates the incomplete gamma functions in the normalized formwith 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 .
Once either or is computed, the other is obtained by subtraction from . In order to avoid loss of relative precision in this subtraction, the smaller of and is computed first.
This function is derived from the function GAM in Gautschi (1979b).
- References
Gautschi, W, 1979, A computational procedure for incomplete gamma functions, ACM Trans. Math. Software (5), 466–481
Gautschi, W, 1979, Algorithm 542: Incomplete gamma functions, ACM Trans. Math. Software (5), 482–489
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