Published June 1, 1994 | Version v1
Journal article Open

Computation of the Gamma, Digamma, and Trigamma Functions

Description

This paper gives an approximation for the gamma function that, while different, has the same form as one by Lanczos [SIAM J. Numer. Anal., B1 (1964), pp. 86–96]. Both approximations correct Stirling's approximation with contributions from the gamma function's poles, and both require O(logϵ) time independent of z to calculate z! with a relative error ϵ. At comparable accuracies, this paper's approximation requires slightly more computation than Lanczos' but is clearly superior in two ways; its coefficients are given by simple formulas and the error estimates apply not only to the gamma function, but also to its derivatives. Thus approximations for the digamma and trigamma functions are also given. Let Fa,1/2(z)=z!(z+a)z(1/2)ez+a(2π)(1/2) and fa(z)=lnFa,1/2(z), with z complex and a real. Several lemmas in the paper require "Stirling inequalities," i.e., bounds on |Fa,1/2(z)|. To this end, the classical Binet integral for f0(z) is generalized from a=0 to all real a. Since the generalized Binet integral is a Laplace transform, the requisite Stirling inequalities follow from the complete monotonicity of such transforms. The proof of the main theorem uses the calculus of residues and presents a lemma generalizing Plana's theorem, which, like the Euler–Maclaurin sum formula, evaluates the difference between a sum and the corresponding integral. This paper also presents a factorial approximation that is both simpler and more accurate than Stirling's approximation.

Files

article.pdf

Files (1.5 MB)

Name Size Download all
md5:f2ab99170f51bcc02d182dd116377c1a
1.5 MB Preview Download