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
Stirling's approximation
(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!
==Versions suitable for calculators== The approximation <math display=block>\Gamma(z) \approx \sqrt{\frac{2 \pi}{z}} \left(\frac{z}{e} \sqrt{z \sinh\frac{1}{z} + \frac{1}{810z^6} } \right)^z</math> and its equivalent form <math display=block>2\ln\Gamma(z) \approx \ln(2\pi) - \ln z + z \left(2\ln z + \ln\left(z\sinh\frac{1}{z} + \frac{1}{810z^6}\right) - 2\right)</math> can be obtained by rearranging Stirling's extended formula and observing a coincidence between the resultant [[power series]] and the [[Taylor series]] expansion of the [[hyperbolic sine]] function. This approximation is good to more than 8 decimal digits for {{mvar|z}} with a real part greater than 8. Robert H. Windschitl suggested it in 2002 for computing the gamma function with fair accuracy on calculators with limited program or register memory.{{r|toth}} GergΕ Nemes proposed in 2007 an approximation which gives the same number of exact digits as the Windschitl approximation but is much simpler:{{r|Nemes2010}} <math display=block>\Gamma(z) \approx \sqrt{\frac{2\pi}{z} } \left(\frac{1}{e} \left(z + \frac{1}{12z - \frac{1}{10z}}\right)\right)^z,</math> or equivalently, <math display=block> \ln\Gamma(z) \approx \tfrac{1}{2} \left(\ln(2\pi) - \ln z\right) + z\left(\ln\left(z + \frac{1}{12z - \frac{1}{10z}}\right) - 1\right). </math> An alternative approximation for the gamma function stated by [[Srinivasa Ramanujan]] in [[Ramanujan's lost notebook]]<ref>{{citation|url=https://archive.org/details/lost-notebook/page/n337/|title=Lost Notebook and Other Unpublished Papers|first=Srinivasa|last=Ramanujan|date=14 August 1920 |author-link=Srinivasa Ramanujan|via=Internet Archive|page=339}}</ref> is <math display=block>\Gamma(1+x) \approx \sqrt{\pi} \left(\frac{x}{e}\right)^x \left( 8x^3 + 4x^2 + x + \frac{1}{30} \right)^{\frac{1}{6}}</math> for {{math|''x'' β₯ 0}}. The equivalent approximation for {{math|ln ''n''!}} has an asymptotic error of {{math|{{sfrac|1|1400''n''<sup>3</sup>}}}} and is given by <math display=block>\ln n! \approx n\ln n - n + \tfrac{1}{6}\ln(8n^3 + 4n^2 + n + \tfrac{1}{30}) + \tfrac{1}{2}\ln\pi .</math> The approximation may be made precise by giving paired upper and lower bounds; one such inequality is{{r|E.A.Karatsuba|Mortici2011-1|Mortici2011-2|Mortici2011-3}} <math display=block> \sqrt{\pi} \left(\frac{x}{e}\right)^x \left( 8x^3 + 4x^2 + x + \frac{1}{100} \right)^{1/6} < \Gamma(1+x) < \sqrt{\pi} \left(\frac{x}{e}\right)^x \left( 8x^3 + 4x^2 + x + \frac{1}{30} \right)^{1/6}.</math>
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)