# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# gammaincinv

Inverse incomplete gamma function

## Syntax

```x = gammaincinv(y,a) x = gammaincinv(y,a,tail) ```

## Description

`x = gammaincinv(y,a)` evaluates the inverse incomplete gamma function for corresponding elements of `y` and `a`, such that` y = gammainc(x,a)`. The elements of `y` must be in the closed interval `[0,1]`, and those of `a` must be nonnegative. `y` and `a` must be real and the same size (or either can be a scalar).

`x = gammaincinv(y,a,tail)` specifies the tail of the incomplete gamma function. Choices are `'lower'` (the default) to use the integral from 0 to `x`, or `'upper'` to use the integral from `x` to infinity.

These two choices are related as:

`gammaincinv(y,a,'upper') = gammaincinv(1-y,a,'lower')`.

When `y` is close to 0, the `'upper'` option provides a way to compute `x` more accurately than by subtracting `y` from 1.

collapse all

### Inverse Incomplete Gamma Function

The lower incomplete gamma function is defined as:

`$\text{gammainc}\left(\text{x,a}\right)=\frac{1}{\Gamma \left(a\right)}{\int }_{0}^{x}{t}^{a-1}{e}^{-t}dt$`
where $\Gamma \left(a\right)$ is the gamma function, `gamma(a)`. The upper incomplete gamma function is defined as:
`$\text{gammainc}\left(\text{x,a,'upper'}\right)=\frac{1}{\Gamma \left(a\right)}\underset{x}{\overset{\infty }{\int }}{t}^{a-1}{e}^{-t}dt$`

`gammaincinv` computes the inverse of the incomplete gamma function with respect to the integration limit `x` using Newton's method.

For any `a>0`, as `y` approaches 1, `gammaincinv(y,a)` approaches infinity. For small `x` and `a`, `gammainc(x,a)`$\cong {x}^{a}$, so ```gammaincinv(1,0) = 0```.

## References

[1] Cody, J., An Overview of Software Development for Special Functions, Lecture Notes in Mathematics, 506, Numerical Analysis Dundee, G. A. Watson (ed.), Springer Verlag, Berlin, 1976.

[2] Abramowitz, M. and I.A. Stegun, Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series #55, Dover Publications, 1965, sec. 6.5.