gammainc
- :
y =gammainc(x, a)¶ - :
y =gammainc(x, a, tail)¶ Regularized incomplete gamma function.
With tail equal to
"lower"(default) the function returnsP(a,x) = 1/gamma(a) * integral_0^x t^(a-1) exp(-t) dt; with"upper"the complementQ(a,x) = 1 - P(a,x), evaluated directly so that tiny upper tails keep their relative accuracy. The options"scaledlower"and"scaledupper"returnPorQmultiplied bygamma(a+1) * exp(x) / x^a, which stays representable whenPorQunderflow.x and a must be real, the same size or scalars, with
x >= 0anda >= 0. The result is single if either input is single.Small a uses the power series and a continued fraction; for
a >= 12the integral is evaluated by Gauss-Legendre quadrature in a variable adapted to the peak of the integrand, which remains accurate for arbitrarily large arguments.