Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gamma function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Approximations == [[File:Mplwp factorial gamma stirling.svg|thumb|right|upright=1.35|Comparison of the gamma function (blue line) with the factorial (blue dots) and Stirling's approximation (red line)]] Complex values of the gamma function can be approximated using [[Stirling's approximation]] or the [[Lanczos approximation]], <math display="block">\Gamma(z) \sim \sqrt{2\pi}z^{z-1/2}e^{-z}\quad\hbox{as }z\to\infty\hbox{ in } \left|\arg(z)\right|<\pi.</math> This is precise in the sense that the ratio of the approximation to the true value approaches 1 in the limit as {{math|{{abs|''z''}}}} goes to infinity. The gamma function can be computed to fixed precision for <math>\operatorname{Re} (z) \in [1, 2]</math> by applying [[integration by parts]] to Euler's integral. For any positive number {{mvar|x}} the gamma function can be written <math display="block">\begin{align} \Gamma(z) &= \int_0^x e^{-t} t^z \, \frac{dt}{t} + \int_x^\infty e^{-t} t^z\, \frac{dt}{t} \\ &= x^z e^{-x} \sum_{n=0}^\infty \frac{x^n}{z(z+1) \cdots (z+n)} + \int_x^\infty e^{-t} t^z \, \frac{dt}{t}. \end{align}</math> When {{math|Re(''z'') ∈ [1,2]}} and <math>x \geq 1</math>, the absolute value of the last integral is smaller than <math>(x + 1)e^{-x}</math>. By choosing a large enough <math>x</math>, this last expression can be made smaller than <math>2^{-N}</math> for any desired value <math>N</math>. Thus, the gamma function can be evaluated to <math>N</math> bits of precision with the above series. A fast algorithm for calculation of the Euler gamma function for any algebraic argument (including rational) was constructed by E.A. Karatsuba.<ref>E.A. Karatsuba, Fast evaluation of transcendental functions. Probl. Inf. Transm. Vol.27, No.4, pp. 339–360 (1991).</ref><ref>E.A. Karatsuba, On a new method for fast evaluation of transcendental functions. Russ. Math. Surv. Vol.46, No.2, pp. 246–247 (1991).</ref><ref>E.A. Karatsuba "[http://www.ccas.ru/personal/karatsuba/algen.htm Fast Algorithms and the FEE Method]".</ref> For arguments that are integer multiples of {{math|{{sfrac|1|24}}}}, the gamma function can also be evaluated quickly using [[arithmetic–geometric mean]] iterations (see [[particular values of the gamma function]]).<ref>{{cite journal |last1=Borwein |first1=J. M. |last2=Zucker |first2=I. J. |title=Fast evaluation of the gamma function for small rational fractions using complete elliptic integrals of the first kind |journal=IMA Journal of Numerical Analysis |date=1992 |volume=12 |issue=4 |pages=519–526 |doi=10.1093/IMANUM/12.4.519}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)