# Spouge's approximation

Spouge's approximation

In mathematics, Spouge's approximation is a formula for the gamma function due to John L. Spouge. The formula is a modification of Stirling's approximation, and has the form

:$Gamma\left(z+1\right) = \left(z+a\right)^\left\{z+1/2\right\} e^\left\{-\left(z+a\right)\right\} left \left[ c_0 + sum_\left\{k=1\right\}^\left\{a-1\right\} frac\left\{c_k\right\}\left\{z+k\right\} + epsilon_a\left(z\right) ight\right]$

where "a" is an arbitrary positive integer and the coefficients are given by

:$c_0 = sqrt\left\{2 pi\right\},$:$c_k = frac\left\{\left(-1\right)^\left\{k-1\left\{\left(k-1\right)!\right\} \left(-k+a\right)^\left\{k-1/2\right\} e^\left\{-k+a\right\} quad k=1,2,dots, a-1.$

Spouge has proved that, if Re("z") > 0 and "a" > 2, the relative error is bounded by

:$epsilon_a\left(z\right) le a^\left\{-1/2\right\} \left(2 pi\right)^\left\{-\left(a+1/2\right)\right\}.$

The formula is similar to the Lanczos approximation, but has some distinct features. Whereas the Lanczos formula exhibits faster convergence, Spouge's coefficients are much easier to calculate and the error can be set arbitrarily low. The formula is therefore feasible for arbitrary-precision evaluation of the gamma function. However, special care must be taken to use sufficient precision when computing the sum due to the large size of the coefficients c_k, as well as their alternating sign. For example, for a=49, you must compute the sum using about 65 decimal digits of precision in order to obtain the promised 40 decimal digits of accuracy.

References

* Spouge, John L. "Computation of the gamma, digamma, and trigamma functions", SIAM Journal on Numerical Analysis 31 (1994), no. 3, 931-944.

* [http://en.literateprograms.org/Gamma_function_with_Spouge's_formula_(Mathematica) Gamma function with Spouge's formula] - Mathematica implementation at LiteratePrograms

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Stirling's approximation — In mathematics, Stirling s approximation (or Stirling s formula) is an approximation for large factorials. It is named in honour of James Stirling.The formula is written as:n! approx sqrt{2pi n}, left(frac{n}{e} ight)^{n}.Roughly, this means that …   Wikipedia

• List of numerical analysis topics — This is a list of numerical analysis topics, by Wikipedia page. Contents 1 General 2 Error 3 Elementary and special functions 4 Numerical linear algebra …   Wikipedia

• List of mathematics articles (S) — NOTOC S S duality S matrix S plane S transform S unit S.O.S. Mathematics SA subgroup Saccheri quadrilateral Sacks spiral Sacred geometry Saddle node bifurcation Saddle point Saddle surface Sadleirian Professor of Pure Mathematics Safe prime Safe… …   Wikipedia