logoalt Hacker News

pkayetoday at 3:42 PM2 repliesview on HN

There is a algorithm call Prime Swing Factorial that can compute large factorials exactly in arbitrary precision math using prime factorization. Like 10000000! in under second depending of how optimized the math library it. Probably like 100x faster than the normal method.


Replies

anthktoday at 5:44 PM

With Lisp you can use iterative algos and get that under a second too. SBCL can be ridiculously fast; and if you optimize the compilation for integers... the speed gets really close to your solution.

flcikfindertoday at 3:59 PM

[flagged]