Abstract
A new computational framework for evaluation of the gamma function Γ(z) over the complex plane is developed. The algorithm is based on interpolation by rational functions, and generalizes the classical methods of Lanczos (SIAM J. Numer. Anal. B 1:86–96, (1964) and Spouge (SIAM J. Numer. Anal., 31(3):931–944, (1994) (which we show are also interpolatory). This framework utilizes the exact poles of the gamma function. By relaxing this condition and allowing the poles to vary, a near-optimal rational approximation is possible, which is demonstrated using the adaptive Antoulous Anderson (AAA) algorithm, developed in Nakatsukasa et al. (Appl. Math. Comp., 40:1494-1522, (2016)) and Nakatsukasa and Trefethen (SIAM J. Sci. Comp., 42(5):A3157–A3179, (2020)). The resulting approximations are competitive with Stirling’s formula in terms of overall efficiency.
Similar content being viewed by others
Notes
The integral of the first kind defines the beta function B(α,β) = Γ(α)Γ(β)/Γ(α + β).
Named after Jacob Bernoulli; Daniel was his nephew.
References
Abramowitz, M., Stegun, I.: Handbook of Mathematical Functions, with Formulas, Graphs, and Mathematical Tables. Dover Publications, Inc., New York (1974)
Andrews, G.E., Askey, R., Roy, R.: Special Functions, Encyclopedia of Mathematics and its Applications. Cambridge University Press, Cambridge (2000)
Aptekarev, A.I., Yattselev, M.L.: Pade approximants for functions with branch points — strong asymptotics of Nuttall–Stahl polynomials. Acta Mathematica 215(2), 217–280 (2015)
Artin, E.: The gamma function. Dover (2015)
Bateman, H., Erdélyi, A.: Higher transcendental functions, Higher Transcendental Functions, no. v. 1 Dover Publications (2006)
Berljafa, M., Güttel, S.: The rkfit algorithm for nonlinear rational approximation. SIAM J. Sci. Comp. 39(5), A2049–A2071 (2017)
Borwein, J.M., Corless, R.M.: Gamma and factorial in the monthly. Amer. Math. Monthly 125(5), 400–424 (2018)
Boyd, W.G.C.: Gamma function asymptotics by an extension of the method of steepest descents. Proc. R. Soc. Lond. A 447, 609–630 (1994)
Cardoso, J.R., Sadeghi, A.: Computation of matrix gamma function. BIT Numer. Math., pp. 1–28 (2019)
Carrier, G.F., Krook, M., Pearson, C.E.: Functions of a Complex Variable: Theory and Technique (Classics in Applied Mathematics). SIAM, Philadelphia (2005)
Corless, R.M., Sevyeri, L.R.: Stirling’s original asymptotic series from a formula like one of binet’s and its evaluation by sequence acceleration. Exp. Math. 0(0), 1–8 (2019)
Davis, P.J.: Leonhard Euler’s integral: A historical profile of the gamma function: In memoriam: Milton abramowitz. Amer. Math. Monthly 66(10), 849–869 (1959)
Dubuc, S.: An approximation of the gamma function. J. Math. Anal. Appl. 146(2), 461–468 (1990)
Dutka, J.: The early history of the factorial function. Arch. for Hist. of Ex. Sci. 43(3), 225–249 (1991)
Godfrey, P.: A note on the computation of the convergent lanczos complex gamma approximation. http://my.fit.edu/gabdo/paulbio.html, 2001, Accessed: 2019-03-20
Gronau, D.: Why is the gamma function so as it is. Teach Math. Comput. Sci. 1, 43–53 (2003)
Gustavsen, B., Semlyen, A.: Rational approximation of frequency domain responses by vector fitting. IEEE Trans. on Power Delivery 14(3), 1052–1061 (1999)
Hare, D.E.G.: Computing the principal branch of log-gamma. J. Alg. 25(2), 221–236 (1997)
Lanczos, C.: A precision approximation of the gamma function. SIAM J. Numer. Anal. B 1, 86–96 (1964)
Li, X., Chen, C.P.: Padé approximant related to asymptotics for the gamma function. Jour. Ineq. Appl. 2017(1), 1–13 (2017)
Luke, Y.L.: The special functions and their approximations, ISSN Elsevier Science (1969)
Luke, Y.L.: Mathematical functions and their approximations. Elsevier Science (2014)
Mortici, C.: Best estimates of the generalized stirling formula. Appl. Math. Comp. 215, 4044–4048 (2010)
Nakatsukasa, Y., Sète, O., Trefethen, L.: The aaa algorithm for rational approximation. Siam. J. Sci. Comp. 40, 1494–1522 (2016)
Nakatsukasa, Y., Trefethen, L.N.: An algorithm for real and complex rational minimax approximation. SIAM J. Sci. Comp. 42(5), A3157–A3179 (2020)
Nemes, G.: On the coefficients of the asymptotic expansion of n. J. Int. Seq. 13, 1–5 (2010)
Nemes, G.: Error bounds and exponential improvements for the asymptotic expansions of the gamma function and its reciprocal. Proceedings of the Royal Society of Edinburgh: Section A Mathematics 145(3), 571–596 (2015)
Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes 3Rd Edition: The Art of Scientific Computing, 3rd edn. Cambridge University Press, New York (2007)
Pérez-marco, R.: Notes on the historical bibliography of the gamma function (2020)
Pugh, G.R.: An Analysis of the Lanczos Gamma Approximation. Ph.D. thesis, University of British Columbia (2004)
Reinartz, K.D.: Chebychev interpolations of the gamma and polygamma functions and their analytical properties (2016)
Remmert, R.: Wielandt’s theorem about the γ-function. Amer. Math. Monthly 103(3), 214–220 (1996)
Rump, S.M.: Verified sharp bounds for the real gamma function over the entire floating-point range. Nonlin. Th. Appl., IEICE 5(3), 339–348 (2014)
Schmelzer, T., Trefethen, L.N.: Computing the gamma function using contour integrals and rational approximations. Siam J. Numer. Anal. 45(2), 558–571 (2007)
Sebah, P., Gourdon, X.: Introduction to the gamma function (2002)
Smith, D.M.: Algorithm 814: Fortran 90 software for floating-point multiple precision arithmetic, gamma and related functions. ACM Trans. Math. Softw. 27(4), 377–387 (2001). (English)
Smith, W.: The gamma function revisited. Math. Comp. 58, 1–20 (2006)
Spouge, J.L.: Computation of the gamma, digamma, and trigamma functions. SIAM J. Numer. Anal. 31(3), 931–944 (1994)
Stahl, H.: The convergence of padé approximants to functions with branch points. Jour. Approx. Theory 91(2), 139–204 (1997)
Trefethen, L.N., Weideman, J.A.C., Schmelzer, T.: Talbot quadratures and rational approximations. BIT Numer. Math. 46(3), 653–670 (2006)
Wang, W.: Unified approaches to the approximations of the gamma function. J. Num. Theory 163, 570–595 (2016)
Whittaker, E.T., Watson, G.N.: A course of modern analysis. Cambridge University Press, Cambridge (1996)
Xu, K., Jiang, S.: A bootstrap method for sum-of-poles approximations. J. Sci. Comp. 55(1), 16–39 (2013)
Acknowledgements
The author is very grateful to an anonymous peer reviewer for several key suggestions that greatly improved the quality of this manuscript. The author is especially indebted for the suggestion to examine the AAA algorithm.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Causley, M.F. The gamma function via interpolation. Numer Algor 90, 687–707 (2022). https://doi.org/10.1007/s11075-021-01204-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11075-021-01204-8