regularizedGammaQ

Computes the upper regularized incomplete gamma function Q(a, x), the complement of regularizedGammaP.

This gives the probability that a gamma-distributed random variable with shape parameter a exceeds x. Equivalent to 1 - P(a, x), but computed directly for better numerical precision in the upper tail.

Example:

regularizedGammaQ(1.0, 1.0) // 0.3678... (e^(-1))
regularizedGammaQ(1.0, 0.0) // 1.0

Return

the value of Q(a, x), in the range 0, 1.

Parameters

a

the shape parameter. Must be positive.

x

the lower integration limit. Returns 1.0 for non-positive values.

Throws

if the iterative computation does not converge.