Credits Overview Plotting Styles Commands Terminals

Igamma

igamma(a, z) returns the lower incomplete gamma function P(a, z), [Abramowitz and Stegun (6.5.1); NIST DLMF 8.2.4]. If complex function support is present a and z may be complex values; real(a) > 0; For the complementary upper incomplete gamma function, see uigamma.

One of four algorithms is used depending on a and z. Case (1) When a is large (>100) and (z-a)/a is small (<0.2) use Gauss-Legendre quadrature with coefficients from Numerical Recipes 3rd Edition section 6.2, Press et al (2007). Case (2) When z > 1 and z > (a+2) use a continued fraction following Shea (1988) J. Royal Stat. Soc. Series C (Applied Statistics) 37:466-473. Case (3) When z < 0 and a < 75 and imag(a) == 0 use the series from Abramowitz & Stegun (6.5.29). Otherwise (Case 4) use Pearson's series expansion.

Note that convergence is poor in some regions of the full domain. If the chosen algorithm does not converge to within 1.E-14 the function returns NaN and prints a warning.

If no complex function support is present the domain is limited to real arguments a > 0, z >= 0.