TITLE: Ramanujan's approximation to factorial
QUESTION [14 upvotes]: I saw this approximation for the factorial given by Ramanujan as
$$\log(n!) \approx n \log n - n + \frac{\log(n(1+4n(1+2n)))}{6} + \frac{\log(\pi)}{2}$$ in wikipedia, which claims the approximation is superior to Stirling's approximation. I tried to locate the reference but unfortunately I could not.
I would appreciate if someone can throw light on how this asymptotic is obtained and the order of the error.

REPLY [7 votes]: Well, I finally found the formula in 
S. Ramanujan, The Lost Notebook and other Unpublished Papers. S. Raghavan and S. S. Rangachari, editors. Narosa, New Delhi, 1987.  
page 339.