Skip to main content
Log in

Numerical methods for the computation of the confluent and Gauss hypergeometric functions

  • Original Paper
  • Published:
Numerical Algorithms Aims and scope Submit manuscript

Abstract

The two most commonly used hypergeometric functions are the confluent hypergeometric function and the Gauss hypergeometric function. We review the available techniques for accurate, fast, and reliable computation of these two hypergeometric functions in different parameter and variable regimes. The methods that we investigate include Taylor and asymptotic series computations, Gauss–Jacobi quadrature, numerical solution of differential equations, recurrence relations, and others. We discuss the results of numerical experiments used to determine the best methods, in practice, for each parameter and variable regime considered. We provide “roadmaps” with our recommendation for which methods should be used in each situation.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abad, J., Sesma, J.: Buchholz polynomials: A family of polynomials relating solutions of confluent hypergeometric and Bessel equations. J. Comput. Appl. Math. 101, 237–241 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  2. Abad, J., Sesma, J.: Computation of the regular confluent hypergeometric function. The Mathematica Journal 5, 74–76 (1995)

    Google Scholar 

  3. Abramowitz, M., Stegun, I. (eds.): Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. National Bureau of Standards (1970)

  4. Allasia, G., Besenghi, R.: Numerical computation of Tricomi’s psi function by the trapezoidal rule. Computing 39, 271–279 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  5. Ancarani, L.U., Gasaneo, G.: Derivatives of any order of the confluent hypergeometric function 1 F 1(a,b,z) with respect to the parameter a or b. J. Math. Phys. 49 (2008)

  6. Andrews, G.E., Askey, R., Roy, R.: Special Functions, vol. 71 of Mathematics and its Applications. Cambridge University Press (1999)

  7. Badralexe, R., Marksteiner, P., Oh, Y., Freeman, A.J.: Computation of the Kummer functions and Whittaker functions by using Neumann type series expansions. Comput. Phys. Commun. 71, 47–55 (1992)

    Article  MathSciNet  Google Scholar 

  8. Bell, K.L., Scott, N.S.: Coulomb functions (negative energies). Comput. Phys. Commun. 20, 447–458 (1980)

    Article  Google Scholar 

  9. Berry, M. V.: Asymptotics, superasymptotics, hyperasymptotics.... In: Asymptotics Beyond All Orders, ed. H. Segur, S. Tanveer (Plenum, New York, 1991), pp 1–14 (1992)

  10. Boyle, P., Potapchik, A.: Application of high-precision computing for pricing arithmetic Asian options, pp 39–46. International Conference on Symbolic and Algebraic Computation (2006)

  11. Bühring, W.: An analytic continuation of the hypergeometric series. SIAM J. Math. Anal. 18, 884–889 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  12. Bühring, W.: An analytic continuation formula for the generalized hypergeometric function. SIAM J. Math. Anal. 19, 1249–1251 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  13. Chiocchia, G., Gabutti, B.: A new transformation for computing hypergeometric series and the exact evaluation of the transonic adiabatic flow over a smooth bump. Comput. Fluids 17, 13–23 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  14. Deaño, A., Segura, J.: Transitory minimal solutions of hypergeometric recursions and pseudoconvergence of associated continued fractions. Math. Comput. 76, 879–901 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  15. Deaño, A., Temme, N.M.: On modified asymptotic series involving confluent hypergeometric functions. Electron. Trans. Numer. Anal. 35, 88–103 (2009)

    MathSciNet  MATH  Google Scholar 

  16. Dunster, T.M.: Asymptotic approximations for the Jacobi and ultraspherical polynomials, and related functions. Methods Appl. Anal. 6, 21–56 (1999)

    MathSciNet  MATH  Google Scholar 

  17. Dunster, T.M.: Uniform asymptotic expansions for Whittaker’s confluent hypergeometric function. SIAM J. Math. Anal. 20, 744–760 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  18. Eckart, C.: The penetration of a potential barrier by electrons. Phys. Rev. 35, 1303–1309 (1930)

    Article  MATH  Google Scholar 

  19. Efimov , A.: Intuitive model for the scintillations of a partially coherent beam. Opt. Express 22, 32353–32360 (2014)

    Article  Google Scholar 

  20. Erdélyi, A., Magnus, W., Oberhettinger, F., Tricomi , F.G.: Higher Transcendental Functions, vol. I. McGraw–Hill (1953)

  21. Eremenko, V., Upadhyay, N.J., Thompson, I.J., Elster, C. h., Nunes, F.M., Arbanas, G., Escher, J.E., Hlophe, L.: Coulomb wave functions in momentum space. Comput. Phys. Commun. 187, 195–203 (2015)

    Article  MATH  Google Scholar 

  22. Ferreira, C., López, J. L., Sinusía, E. P.: The Gauss hypergeometric function F(a,b;c;z) for large c. J. Comput. Appl. Math. 197, 568–577 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  23. Forrey, R.C.: Computing the hypergeometric function. J. Comput. Phys. 137, 79–100 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  24. Gautschi, W.: Computational aspects of three-term recurrence relations. SIAM Rev. 9, 24–82 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  25. Gautschi , W.: A computational procedure for incomplete gamma functions. ACM Trans. Math. Softw. 5, 466–481 (1979)

    Article  MATH  Google Scholar 

  26. Gautschi , W.: Gauss quadrature approximations to hypergeometric and confluent hypergeometric functions. J. Comput. Appl. Math. 139, 173–187 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  27. Gavrila , M.: Elastic scattering of photons by a hydrogen atom. Phys. Rev. 163, 147–155 (1967)

    Article  Google Scholar 

  28. Gil, A., Segura, J., Temme, N.M.: The ABC of hyper recursions. J. Comput. Appl. Math. 190, 270–286 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  29. Gil, A., Segura, J.: Algorithm 819: AIZ, BIZ: Two Fortran 77 routines for the computation of complex Airy functions. Trans. Math. Softw. 28, 325–336 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  30. Gil, A., Segura, J.: Algorithm 831: Modified Bessel functions of imaginary order and positive argument. Trans. Math. Softw. 30, 159–164 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  31. Gil, A., Segura, J., Temme, N.M.: Efficient and accurate algorithms for the computation and inversion of the incomplete gamma function ratios. SIAM J. Sci. Comput. 34, A2965–A2981 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  32. Gil, A., Segura, J., Temme, N.M.: Fast and accurate computation of the Weber parabolic cylinder function W(a,x). IMA J. Numer. Anal. 31, 1194–1216 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  33. Gil, A., Segura, J., Temme, N.M.: Numerically satisfactory solutions of hypergeometric recursions. Math. Comput. 76, 1449–1468 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  34. Gil, A., Segura, J., Temme, N.M.: Numerical Methods for Special Functions. Society for Industrial and Applied Mathematics (2007)

  35. Gil, A., Segura, J., Temme, N.M.: Parabolic cylinder function W(a,x) and its derivative. ACM Trans. Math. Softw. 38 (2011). Article 6

  36. Glaser, A., Liu, X., Rokhlin, V.: A fast algorithm for the calculation of the roots of special functions. SIAM J. Sci. Comput. 29, 1420–1438 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  37. Godfrey, P.: A note on the computation of the convergent Lanczos complex gamma approximation (2001), available at http://www.numericana.com/answer/info/godfrey.htm

  38. Golub, G.H., Welsch, J.W.: Calculation of Gauss quadrature rules. Math. Comput. 23, 221–230 (1969)

    Article  MathSciNet  MATH  Google Scholar 

  39. Hale, N., Townsend, A.: Fast and accurate computation of Gauss–Legendre and Gauss–Jacobi quadrature nodes and weights. SIAM J. Sci. Comput. 35, A652–A674 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  40. Hochstadt, H.: The Functions of Mathematical Physics. Wiley (1971)

  41. Hsu , Y. P.: Development of a Gaussian hypergeometric function code in complex domains. Int. J. Modern Phys. C 4, 805–840 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  42. Huang, H.-Z., Liu, J.: NumExp: Numerical epsilon expansion of hypergeometric functions. Comput. Phys. Commun. 184, 1973–1980 (2013)

    Article  MATH  Google Scholar 

  43. Ibrahim, A.K., Rakha, M.A.: Contiguous relations and their computations for 2 F 1 hypergeometric series. Comput. Math. Appl. 56, 1918–1926 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  44. Jones , D. S.: Asymptotics of the hypergeometric function. Math. Methods Appl. Sci. 24, 369–389 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  45. Kalla, S.L.: On the evaluation of the Gauss hypergeometric function. Compt. Rendus l’Acad. Bulgare Sci. 45, 35–36 (1992)

    MathSciNet  MATH  Google Scholar 

  46. Khwaja, F., Olde Daalhuis, A.B.: Uniform asymptotic expansions for hypergeometric functions with large parameters IV. Anal. Appl. 12, 667–710 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  47. Kniehl, B.A., Tarasov, O.V.: Finding new relationships between hypergeometric functions by evaluating Feynman integrals. Nuclear Phys. B 854, 841–852 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  48. Korotkova, O.: Scintillation index of a stochastic electromagnetic beam propagating in random media. Opt. Commun. 281, 2342–2348 (2008)

    Article  Google Scholar 

  49. Lanczos , C.J.: A precision approximation of the gamma function. SIAM J. Numer. Anal. Ser. B 1, 86–96 (1964)

    MathSciNet  MATH  Google Scholar 

  50. López, J.L.: Asymptotic expansions of the Whittaker functions for large order parameter. Methods Appl. Anal. 6, 249–256 (1999)

    MathSciNet  MATH  Google Scholar 

  51. López, J. L., Pagola, P.J: The confluent hypergeometric functions M(a,b;z) and U(a,b;z) for large b and z. J. Comput. Appl. Math. 233, 1570–1576 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  52. López, J. L., Temme, N.M.: New series expansions of the Gauss hypergeometric function. Adv. Comput. Math. 39, 349–365 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  53. Lozier, D.W., Olver, F.W.J.: Numerical evaluation of special functions. In: Mathematics of Computation 1943–1993: A Half-Century of Computational Mathematics, Proceedings of Symposia in Applied Mathematics, American Mathematical Society (1994)

  54. Luke, Y.L.: Algorithms for rational approximations for a confluent hypergeometric function. Utilitas Math. 11, 123–151 (1977)

    MathSciNet  MATH  Google Scholar 

  55. Luke, Y.L.: Algorithms for the Computation of Mathematical Functions. Academic Press (1977)

  56. Luke, Y.L.: Mathematical Functions and their Approximations. Academic Press (1975)

  57. Luke, Y.L.: The Special Functions and their Approximations, vol. I. Academic Press (1969)

  58. Luke , Y.L.: The Special Functions and their Approximations, vol. II. Academic Press (1969)

  59. Mace, R.L., Hellberg, M.A.: A dispersion function for plasmas containing superthermal particles. Phys. Plasmas 2, 2098–2109 (1995)

    Article  Google Scholar 

  60. Mathar, R.J.: Numerical representations of the incomplete gamma function of complex-valued argument. Numer. Algorithms 36, 247–264 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  61. Michel, N., Stoitsov, M.V.: Fast computation of the Gauss hypergeometric function with all its parameters complex with application to the Pöschl–Teller–Ginocchio potential wave functions. Comput. Phys. Commun. 178, 535–551 (2008)

    Article  MATH  Google Scholar 

  62. Moshier, S.L.: Methods and Programs for Mathematical Functions. Ellis Horwood (1989)

  63. Muller, K.E.: Computing the confluent hypergeometric function, M(a,b,x). Numer. Math. 90, 179–196 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  64. Nardin, M., Perger, W.F., Bhalla, A.: Algorithm 707: CONHYP: A numerical evaluator of the confluent hypergeometric function for complex arguments of large magnitudes. ACM Trans. Math. Softw. 18, 345–349 (1992)

    Article  MATH  Google Scholar 

  65. Nardin, M., Perger, W.F., Bhalla, A.: Numerical evaluation of the confluent hypergeometric function for complex arguments of large magnitudes. J. Comput. Appl. Math. 39, 193– 200 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  66. Nieuwveldt, F.D.: A Survey of Computational Methods for Pricing Asian Options. Masters’ thesis, University of Stellenbosch (2009). available at http://scholar.sun.ac.za/handle/10019.1/2118

  67. Noble, C.J., Thompson, I.J.: COULN, a program for evaluating negative energy coulomb functions. Comput. Phys. Commun. 33, 413–419 (1984)

    Article  Google Scholar 

  68. Olde Daalhuis , A. B.: Hyperasymptotic expansions of confluent hypergeometric functions. IMA J. Appl. Math. 49, 203–216 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  69. Olde Daalhuis , A.B.: Uniform asymptotic expansions for hypergeometric functions with large parameters I. Anal. Appl. 1, 111–120 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  70. Olde Daalhuis , A. B.: Uniform asymptotic expansions for hypergeometric functions with large parameters II. Anal. Appl. 1, 121–128 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  71. Olde Daalhuis , A. B.: Uniform asymptotic expansions for hypergeometric functions with large parameters III. Anal. Appl. 8, 199–210 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  72. Olde Daalhuis, A.B., Olver, F.W.J.: Hyperasymptotic solutions of second-order linear differential equations I. Methods Appl. Anal. 2, 173–197 (1995)

    MathSciNet  MATH  Google Scholar 

  73. Olver, F.W.J.: Asymptotics and Special Functions. Academic Press (1974)

  74. Olver, F.W.J.: Exponentially-improved asymptotic solutions of ordinary differential equations I: the confluent hypergeometric function. SIAM J. Math. Anal. 24, 756–767 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  75. Olver, F.W.J.: Numerical solution of second order linear difference equations. J. Res. Nat. Bur. Stand. Sect. B 71, 111–129 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  76. Olver, F.W.J.: On the asymptotic solution of second-order differential equations having an irregular singularity of rank one, with an application to Whittaker functions. J. Soc. Indust. Appl. Math. Ser. B (Numerical Analysis) 2, 225–243 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  77. Olver, F.W.J.: Uniform, exponentially improved, asymptotic expansions for the confluent hypergeometric function and other integral transforms. SIAM J. Math. Anal. 22, 1475–1489 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  78. Olver, F. W. J.: Whittaker functions with both parameters large: uniform approximations in terms of parabolic cylinder functions. Proc. Royal Soc. Edinb. Sect. A 86, 213–234 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  79. Pastor-Satorras, R., Vespignani, A.: Epidemic dynamics and endemic states in complex networks. Phys. Rev. E 63, 066117 (2001)

    Article  Google Scholar 

  80. Pearson, J.: Computation of Hypergeometric Functions, Dissertation, MSc in Mathematical Modelling and Scientific Computing, University of Oxford (2009), available at https://sites.google.com/site/johnpearsonmaths/research

  81. Pierro, V., Pinto, I.M., Spallicci di Filottrano, A.D.A.M.: Computation of hypergeometric functions for gravitationally radiating binary stars. Mon. Not. Royal Astron. Soc. 334, 855–858 (2002)

    Article  Google Scholar 

  82. Potts, P.J.: Computable real arithmetic using linear fractional transformations. Report, Department of Computing, Imperial College of Science, Technology and Medicine, London (1996), available at http://citeseer.ist.psu.edu/potts96computable.html

  83. Press, W.A., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes: The Art of Scientific Computing. 3rd edn. Cambridge University Press (2007)

  84. Rakha, M.A., El-Sedy, E.S.: Application of basic hypergeometric series. Appl. Math. Comput. 148, 717–723 (2004)

    MathSciNet  MATH  Google Scholar 

  85. Roach, K.: Hypergeometric function representations, pp 301–308. Proceedings of the 1996 International Symposium on Symbolic and Algebraic Computation (1996)

  86. Schmelzer, T., Trefethen, L.N: Computing the gamma function using contour integrals and rational approximations. SIAM J. Numer. Anal. 45, 558–571 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  87. Seaborn, J.B.: Hypergeometric Functions and their Applications. Springer-Verlag (1991)

  88. Segura, J., Temme, N.M.: Numerically satisfactory solutions of Kummer recurrence relations. Numer. Math. 111, 109–119 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  89. Spouge, J.L.: Computation of the gamma, digamma, and trigamma functions. SIAM J. Numer. Anal. 31, 931–944 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  90. Slater, L.J.: Confluent Hypergeometric Functions. Cambridge University Press (1960)

  91. Slater, L.J.: Generalized Hypergeometric Functions. Cambridge University Press (1966)

  92. Temme, N.M.: Asymptotic Methods for Integrals. Series in Analysis 6, World Scientific, NJ (2015)

    MATH  Google Scholar 

  93. Temme, N.M.: Large parameter cases of the Gauss hypergeometric function. J. Comput. Appl. Math. 153, 441–462 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  94. Temme, N.M.: Numerical and asymptotic aspects of parabolic cylinder functions. J. Comput. Appl. Math. 121, 221–246 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  95. Temme, N.M.: Numerical aspects of special functions. Acta Numer. 16, 379–478 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  96. Temme, N.M.: The numerical computation of the confluent hypergeometric function U(a,b,z). Numer. Math. 41, 43–82 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  97. Temme, N.M.: Special Functions: An Introduction to the Classical Functions of Mathematical Physics. Wiley (1996)

  98. Temme, N.M.: Uniform asymptotic expansions of confluent hypergeometric functions. J. Inst. Math. Appl. 22, 215–223 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  99. Temme, N.M.: Uniform asymptotics for a class of integrals in terms of modified Bessel functions, with application to confluent hypergeometric functions. SIAM J. Math. Anal. 21, 241– 261 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  100. Torrieri, D., Valenti, M.C.: The outage probability of a finite ad hoc network in Nakagami fading. IEEE Trans. Commun. 60, 3509–3518 (2012)

    Article  Google Scholar 

  101. Trefethen, L.N., Weideman, J.A.C., Schmelzer, T.: Talbot quadratures and rational approximations BIT. Numer. Anal. 46, 653–670 (2006)

    MATH  Google Scholar 

  102. Vitalis, R., Gautier, M., Dawson, K.J., Beaumont, M.A.: Detecting and measuring selection from gene frequency data. Genetics 196, 799–814 (2014)

    Article  Google Scholar 

  103. Wang, X., Duan, J., Li, X., Luan, Y.: Numerical methods for the mean exit time and escape probability of two-dimensional stochastic dynamical systems with non-Gaussian noises. Appl. Math. Comput. 258, 282–295 (2015)

    MathSciNet  MATH  Google Scholar 

  104. Watson, G.N.: The harmonic functions associated with the parabolic cylinder. Proc. Lond. Math. Soc. 2, 116–148 (1918)

    Article  MathSciNet  MATH  Google Scholar 

  105. Weideman, J.A.C: Optimizing Talbot’s contours for the inversion of the Laplace transform. SIAM J. Numer. Anal. 44, 2342–2362 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  106. Weideman, J.A.C., Trefethen, L.N.: Parabolic and hyperbolic contours for computing the Bromwich integral. Math. Comput. 76, 1341–1356 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  107. Wimp, J.: Computation with Recurrence Relations. Pitman (1984)

  108. Zhang, S., Jin, J.: Computation of Special Functions. Wiley (1966)

  109. Zhao, C., Yang, C.: An exact solution for electroosmosis of non-Newtonian fluids in microchannels. J. Non-Newtonian Fluid Mech. 166, 1076–1079 (2011)

    Article  MATH  Google Scholar 

  110. Digital Library of Mathematical Functions, National Institute of Standards and Technology, available at http://dlmf.nist.gov/

  111. Matlab, The Mathworks Inc., Version R2015a (2015)

  112. Mathematica, Wolfram Research, Inc., Mathematica, Version 8.0 (2010)

  113. The NAG Toolbox for Matlab, The Numerical Algorithms Group (2013)

  114. http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric1F1/10/

  115. http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/10/

  116. http://datashare.is.ed.ac.uk/handle/10283/607

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to John W. Pearson.

Additional information

This work was supported by the Numerical Algorithms Group (NAG) and the Engineering and Physical Sciences Research Council (EPSRC).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Pearson, J.W., Olver, S. & Porter, M.A. Numerical methods for the computation of the confluent and Gauss hypergeometric functions. Numer Algor 74, 821–866 (2017). https://doi.org/10.1007/s11075-016-0173-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11075-016-0173-0

Keywords

Mathematics Subject Classification (2010)

Navigation