It is possible to improve Stirling's approximation by keeping more terms in the expansion of the logarithm (B.22). The exponential of the new terms can then be expanded in a Taylor series to yield a polynomial in y multiplied by the same Gaussian as before. Carry out this procedure, consistently keeping all terms that will end up being smaller than the leading term by one power of n. (Since the Gaussian cuts off when y is of order n, you can estimate the sizes of various terms by setting y=n.) When the smoke clears, you should find
n!≈nne−n2πn(1+12n1).
Check the accuracy of this formula for n=1 and for n=10. (In practice, the correction term is rarely needed. But it does provide a handy way to estimate the error in Stirling's approximation.)