Dan Weston wrote:
A thing of beauty is a joy forever. Simple, fast, elegant.

factorial :: Integer -> Integer
factorial = product . zipWith (^) . factorisedFactorial

Well... The zipWith (^) should be map (uncurry (^)).

And the performance of this approach is strongly dependent on the efficiency of your prime sieve, so you're moving the complexity around, not eliminating it.

The binary splitting method doesn't need a source of primes, and performs half decently on numbers such as fact 1e6 (5.5 million digits computed in about 5 seconds).

        <b
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to