What's the advantage of this approximation in python/code? I can see it being useful analytically, but what's the advantage in code? The formula has an ^n in it, so doesn't it have the same complexity as n! ?
There are efficient ways to compute x^n. Eg. you want to compute x^8. Instead of multiplying x eight times by itself, you can do ((x^2)^2)^2, which is just three multiplications.
To be fair, I’m not sure whether similar optimizations exist for computing the factorial, but I don’t think so.