Computing the Gamma Function Using Contour Integrals and Rational Approximations

Some of the best methods for computing the gamma function are based on numerical evaluation of Hankel’s contour integral. For example, Temme evaluates this integral based on steepest descent contours by the trapezoid rule. Here we investigate a different approach to the integral: the application of the trapezoid rule on Talbot-type contours using optimal parameters recently derived by Weideman for computing inverse Laplace transforms. Relatedly, we also investigate quadrature formulas derived from best approximations to $\exp(z)$ on the negative real axis, following Cody, Meinardus, and Varga. The two methods are closely related, and both converge geometrically. We find that the new methods are competitive with existing ones, even though they are based on generic tools rather than on specific analysis of the gamma function.

[1]  A. Erdélyi,et al.  Higher Transcendental Functions , 1954 .

[2]  Alphonse P. Magnus,et al.  Asymptotics and Super Asymptotics for Best Rational Approximation Error Norms to the Exponential Function (The ‘1/9’ Problem) by the Carathéodory-Fejér Method , 1994 .

[3]  J. A. C. Weideman,et al.  Optimizing Talbot's Contours for the Inversion of the Laplace Transform , 2006, SIAM J. Numer. Anal..

[4]  William H. Press,et al.  Numerical recipes in C , 2002 .

[5]  J. Spouge Computation of the gamma, digamma, and trigamma functions , 1994 .

[6]  L. Trefethen Spectral Methods in MATLAB , 2000 .

[7]  R. Spira Calculation of the Gamma Function by Stirling's Formula , 1971 .

[8]  E. Rakhmanov,et al.  EQUILIBRIUM DISTRIBUTIONS AND DEGREE OF RATIONAL APPROXIMATION OF ANALYTIC FUNCTIONS , 1989 .

[9]  P. Davis Leonhard Euler's Integral: A Historical Profile of the Gamma Function: In Memoriam: Milton Abramowitz , 1959 .

[10]  P. Zweifel Advanced Mathematical Methods for Scientists and Engineers , 1980 .

[11]  Nico M. Temme,et al.  Computing Special Functions by Using Quadrature Rules , 2004, Numerical Algorithms.

[12]  C. Lanczos,et al.  A Precision Approximation of the Gamma Function , 1964 .

[13]  William H. Press,et al.  Numerical Recipes in C, 2nd Edition , 1992 .

[14]  Lloyd N. Trefethen,et al.  Parabolic and hyperbolic contours for computing the Bromwich integral , 2007, Math. Comput..

[15]  L. Trefethen,et al.  Talbot quadratures and rational approximations , 2006 .

[16]  M. Abramowitz,et al.  Handbook of Mathematical Functions With Formulas, Graphs and Mathematical Tables (National Bureau of Standards Applied Mathematics Series No. 55) , 1965 .

[17]  Edward W. Ng A Comparison of Computational Methods and Algorithms for the Complex Gamma Function , 1975, TOMS.

[18]  N. Temme Special Functions: An Introduction to the Classical Functions of Mathematical Physics , 1996 .

[19]  R. Varga,et al.  Extended numerical computations on the “1/9” conjecture in rational approximation theory , 1984 .

[20]  A. Aptekarev Sharp constants for rational approximations of analytic functions , 2002 .

[21]  R. Varga,et al.  Chebyshev rational approximations to e−x in [0, +∞) and applications to heat-conduction problems , 1969 .

[22]  Glendon Ralph Pugh AN ANALYSIS OF THE LANCZOS GAMMA APPROXIMATION , 2004 .

[23]  A. Talbot The Accurate Numerical Inversion of Laplace Transforms , 1979 .