Exactification of Stirling's Approximation for the Logarithm of the Gamma Function
Exactification is the process of obtaining exact values of a function from its complete asymptotic expansion. Here Stirling's approximation for the logarithm of the gamma function or $\ln \Gamma(z)$ is derived completely whereby it is composed of the standard leading terms and an asymptotic series that is generally truncated. Nevertheless, to obtain values of $\ln \Gamma(z)$, the remainder must undergo regularization. Two regularization techniques are then applied: Borel summation and Mellin-Barnes (MB) regularization. The Borel-summed remainder possesses an infinite convergent sum of exponential integrals and discontinuous logarithmic terms across Stokes sectors and lines, while the MB-regularized remainders possess one MB integral, which is better to compute, and similar logarithmic terms. The MB integrals are valid over overlapping domains of convergence. Hence, two MB-regularized asymptotic forms can be used to evaluate $\ln \Gamma(z)$. Despite having to truncate the Borel-summed remainder, it is found that all the remainders combined with (1) the truncated asymptotic series, (2) the leading terms of Stirling's approximation and (3) their logarithmic terms yield identical values of $\ln \Gamma(z)$. In the few cases where the accuracy falls away, it is mostly due to a very high value for the truncation parameter, which results in the cancellation of redundant decimal places. Where possible, all the asymptotic forms yield the same values as the LogGamma routine in Mathematica.