Last active
August 29, 2015 14:26
-
-
Save Radcliffe/b2ab0f5c7a0fd66108c8 to your computer and use it in GitHub Desktop.
Inverse factorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import log, sqrt, pi, e | |
| from scipy.special import lambertw | |
| fomm numpy import real | |
| # http://mathforum.org/kb/message.jspa?messageID=342551&tstart=0 | |
| def invfactorial(n): | |
| """ Approximate inverse factorial""" | |
| L = log((x + .036534) / sqrt(2*pi)) | |
| return real(L/W(L/e) - .5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment