Hart, ., et al. 1968, Computer Approximations (New York: Wiley). Hastings, C. 1955, Approximations for Digital Computers (Princeton: Princeton University Press). Luke, . 1975, Mathematical Functions and Their Approximations (New York: Academic Press). Gamma Function, Beta Function, Factorials, Binomial Coefficients | Gamma Beta and Related Functions 213 Hart . et al. 1968 Computer Approximations New York Wiley . Hastings C. 1955 Approximations forDigital Computers Princeton Princeton University Press . Luke . 1975 Mathematical Functions and TheirApproximations New York Academic Press . Gamma Function Beta Function Factorials Binomial Coefficients The gamma function is defined by the integral r z Í J0 tz- 1e tdt When the argument z is an integer the gamma function is just the familiar factorial function but offset by one n r n 1 The gamma function satisfies the recurrence relation r z 1 zr z If the function is known for arguments z 1 or more generally in the half complex plane Re z 1 it can be obtained for z 1 or Re z 1 by the reflection formula r i _Z V . - f z sin z r 1 z sin z Notice that r z has a pole at z 0 and at all negative integer values of z. There are a variety of methods in use for calculating the function T z numerically but none is quite as neat as the approximation derived by Lanczos 1 . This scheme is entirely specific to the gamma function seemingly plucked from thin air. We will not attempt to derive the approximation but only state the resulting formula For certain integer choices of y and N and for certain coefficients c1 c2 . cN the gamma function is given by r z 1 z Y 1 z 2 e- z Y 2 x p2 C0 ci z 1 C2 z 2 CN e z 0 You can see that this is a sort of take-off on Stirling s approximation but with a series of corrections that take into account the first few poles in the left complex plane. The constant c0 is very nearly equal to 1. The error term is parametrized by e. For y 5 N 6 and a certain set of c s the error is smaller than e 2 x 10-10. Impressed If not then perhaps you will be impressed by the fact that with these same parameters the formula and bound on e apply for the complex gamma function everywhere in the half complex plane Re z 0. Sample page from NUMERICAL RECIPES IN C THE ART OF SCIENTIFIC .