ACM Home Page
Please provide us with feedback. Feedback
A Note on a Method of Computing the Gamma Function
Full text PdfPdf (66 KB)
Source Journal of the ACM (JACM) archive
Volume 7 ,  Issue 4  (October 1960) table of contents
Pages: 387 - 388  
Year of Publication: 1960
ISSN:0004-5411
Authors
N. L. Gordon  RCA Laboratories, Princeton, New Jersey
A. H. Flasterstein  RCA Laboratories, Princeton, New Jersey
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 2,   Downloads (12 Months): 21,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/321043.321050
What is a DOI?

ABSTRACT

Numerous formulas are available for the computation of the Gamma function [1, 2]. The purpose of this note is to indicate the value of a well-known method that is easily extended for higher accuracy requirements. Using the recursion formula for the Gamma function, &Ggr;(x + 1) = x&Ggr;(x), (1) and Stirling's asymptotic expansion for ln &Ggr;(x) [3], we have ln &Ggr;(x) ∼ (x - 1/2) ln x - x + 1/2 ln 2&pgr; + ∑Nr=1 Cr/x2r-1. (2) It follows that, if k and N are appropriately selected positive integers, &Ggr;(x + 1) can be represented by &Ggr;(x + 1) ∼ √2&pgr; exp (x + k - 1/2) ln (x + k) - (x + k) exp ∑Nr=1 Cr/(x + k)2r-1/(x + 1)(x + 2) ··· (x + k - 1) (3) where Cr = (- 1)r-1 Br/(2r - 1)(2r), Br being the Bernoulli numbers [4]. These coefficients have been published by Uhler [5]. Requiring the range 0 ≦ x ≦ 1 is no restriction since, if necessary, &Ggr;(x + 1) can be generated for other arguments using (1). For a given N, the error in (2) can be estimated from |&egr;| < |CN+1|/x2N+1. (4) The curves of Figure 1 show contours of constant error bound as a function of N and x. These curves represent single and double-precision floating-arithmetic requirements of &egr; < 5·10-9 and &egr; < 5·10-17. For a given N, k is defined as the minimum integral x greater than or equal to those on the curves. Then N and k can be chosen to minimize round-off and computing time. For N and k equal to 4, formula (3) yields &Ggr;(x + 1) ∼ &radic2&pgr; exp (x + 4 - 1/2) ln (x + 4) - (x + 4) exp ∑4r=1Cr/(x + 4)2r-1/(x + 1)(x + 2)(x + 3). (5) A similar expression suitable for double precision results for N = 8 and k = 9. The exponents in (5) are split to reduce roundoff. Various algebraic manipulations might result in a further reduction of roundoff.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
 
2
C. LANCZOS, Trigonometric interpolation of empirical and analytic functions J Math Phys 17 (1938), 123-199
 
3
M. E SHERRY AND S FULDA, Calculation of Gamma functions to high accuracy, Math Tables Azds Compz~t 13 (1959), 314-315
 
4
F T WHITTAKER AND G N. WATSON, A Course. of Modern Analysis, p 125 Cambridge University Press, Cambridge, Englund.
 
5
HORACE S UHLER, The coefficients of Stirling's serms for log F(x), Proc Nat. Acad Scz. 28 (1942), 59-62

Collaborative Colleagues:
N. L. Gordon: colleagues
A. H. Flasterstein: colleagues