blob: 5cb3f6e7187881c03baa619460f07b567618aa2b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
# https://en.wikipedia.org/wiki/Sterling_Approximation
# An alternative approximation for the Gamma function stated by Srinivasa
# Ramanujan (Ramanujan 1988) is
Gamma(1+x) ~= sqrt(pi)((x/e)^x)(8x^3 + 4x^2 + x + 1/30)^(1/6)
# for x >= 0. The equivalent approximation for ln(n!) has an asymptotic error
# of 1/(1400*n^3) ...
|