You can use the \(\gamma\text{Inv}\) function to calculate the inverse lower gamma function.

You can use the \lowergammainv backslash command to insert this function.

The following variants of this function are available:

  • \(\text{real } \gamma\text{Inv} \left ( \text{<s>}, \text{<y>} \right )\)

The values \(\text{<s>}\) and \(\text{<y>}\) can be any scalar value.

The function returns \(z\) where:

\[y = \gamma \left ( s, z \right ) = \int_{0}^{z} t ^ { s - 1 } e ^ {-t} dt\]

The \(\gamma\text{Inv}\) function calculates the value of \(z\) using Halley’s method with an initial guess value calculated by

\[\begin{split}z _ { initial } = \begin{cases} - \ln \left ( 1 - y \right ) & \text{if } y < 1 \\ 1 & \text{otherwise} \end{cases}\end{split}\]

Halley’s method was selected due to the speed of convergence. Once the first derivative of the lower gamma function with respect to \(z\) is calculated, the additional work to calculate the second derivative is minimal. For small values of \(s\), Halley’s method may not converge. The Aion implementation of \(\gamma\text{Inv}\) includes code to handle this scenario.

The examples below show how you can use the \(\gamma\text{Inv}\) function:

\[z = \gamma\text{Inv} \left ( 1, 1 - \frac{1}{e} \right )\]
\[\text{ z = 1 }\]