Stirling's approximation (or Stirling's formula) is an asymptotic approximation for factorials, or Gamma function

One way of stating the approximation involves the logarithm of the factorial

where is the big O notation

An approximate formula for the factorial itself is that

This formula leads to accurate results even for small values