stirlingln: Approximates the factorial of n using the approximation given...

Description Usage Arguments Value References Examples

Description

It is often useful to compute the logarithmic form of the factorial and convert it to exponent form to avoid overflow. The approximation is an alternative approach given by Srinivasa Ramanujan (Ramanujan 1988).

ln n! \approx n ln n - n + \frac{1}{6} ln(n(1 + 4n(1 + 2n))) + \frac{1}{2} ln π

Usage

1

Arguments

n

desired integer to approximate factorial

Value

the natural log of the approximated factorial per Stirling's approximation.

References

Stirling's approximation. (2017, March 8). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Stirling

Examples

1
2

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.