Question in a nutshell:
Can anyone point me to an algorithm for computing to double-precision floating-point (roughly 16 digits) the inverse of either log gamma or log factorial?
In other words, if y = ln(factorial(x)), and I am given double-precision y, I want to compute double-precision x.
Details of what I have learned so far:
For some engineering work that I am doing, I have implemented both factorial(x) and lnfactorial(x) for non-negative real x using Lanczos Approximation. Now I need to implement the inverses of both. Inversing the Lanczos Approximation that I am using (a 13-element series expansion) is beyond my math-jitsu skills.
The best answer I have found is in a few posts by David W. Cantrell:
Link (Inverse gamma function)
http://mathforum.org/kb/message.jspa?messageID=342644 (23 kt. asymptotic expansion for gamma function)
https://groups.google.com/forum/#!topic/sci.math/EIAf7rQ6A_4 (A new convergent expansion for the gamma function)
I think those will get me the inverse factorial function that I need, once I implement a double-precision Lambert W function. I am working on that now.
My more detailed questions for you:
(1) Those posts are from 2001… what is the latest and greatest info on how to efficiently compute the inverse factorial/gamma?
(2) If that is the latest, how many coefficients are needed to give me 15 decimal digits of precision? And has anybody documented those n coefficients somewhere (given double-precision math is pretty common; I was able to find pre-computed coefficients for Lanczos that work well for double-precision)?
(3a) I am also trying to implement lnfactorial (natural log of the factorial) and its inverse… did Cantrell (or anybody else) develop a similar approximation for that? (3b) Or is anyone's math-jitsu skills strong enough to tell me how to use his inverse gamma approximation to compute inverse lngamma? (lnfactorial was computable with a very similar Lanczos approximation as factorial; so, I am hoping the same will be true of the inverses.)
Any guidance/leads you can give on any of that would be greatly appreciated!
Thanks,
Brian