úÎ € *Haskell98 + CPP provisionalwren@community.haskell.org6Exact factorial numbers. For a fast approximation see  .math-functions:Numeric.SpecFunctions.factorial instead. The / naive definition of the factorial numbers is:   factorial n  | n < 0 = 0 " | otherwise = product [1..n] DHowever, we use a fast algorithm based on the split-recursive form:  factorial n = ? 2^(n - popCount n) * product [(q k)^k | forall k, k >= 1]  where E q k = product [j | forall j, n*2^(-k) < j <= n*2^(-k+1), odd j]  Haskell98 provisionalwren@community.haskell.org6The prime numbers. Implemented with the algorithm in:  Colin Runciman (1997)  'Lazy Wheel Sieves and Spirals of Primes, Functional Pearl, : Journal of Functional Programming, 7(2). pp.219--225.  ISSN 0956-7968   ?http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.7096  Haskell98 provisionalwren@community.haskell.org:Exact binomial coefficients. For a fast approximation see  +math-functions:Numeric.SpecFunctions.choose instead. The naive - definition of the binomial coefficients is:   n `choose` k  | k < 0 = 0  | k > n = 0 E | otherwise = factorial n `div` (factorial k * factorial (n-k)) ?However, we use a fast implementation based on the prime-power < factorization of the result (Goetgheluck, 1987). Each time n @ is larger than the previous calls, there will be some slowdown @ as the prime numbers must be computed (though it is still much B faster than the naive implementation); however, subsequent calls 6 will be extremely fast, since we memoize the list of . @ Do note, however, that this will result in a space leak if you  call choose for an extremely large n and then don't need @ that many primes in the future. Hopefully future versions will  correct this issue.  P. Goetgheluck (1987)  Computing Binomial Coefficients, 7 American Mathematical Monthly, 94(4). pp.360--365.   #http://www.jstor.org/stable/2323099,   'http://dl.acm.org/citation.cfm?id=26272  combinatorics-0.1.0Math.Combinatorics.FactorialMath.Combinatorics.PrimesMath.Combinatorics.Binomial factorialprimeschoosehighestBitPosition_IntWheel