arithmoi-0.9.0.0: Efficient basic number-theoretic functions.

Copyright(c) 2016 Andrew Lelechenko
LicenseMIT
MaintainerAndrew Lelechenko <andrew.lelechenko@gmail.com>
Safe HaskellSafe
LanguageHaskell2010

Math.NumberTheory.Recurrencies.Bilinear

Description

Deprecated: Use Bilinear instead.

Bilinear recurrent sequences and Bernoulli numbers, roughly covering Ch. 5-6 of Concrete Mathematics by R. L. Graham, D. E. Knuth and O. Patashnik.

Note on memory leaks and memoization. Top-level definitions in this module are polymorphic, so the results of computations are not retained in memory. Make them monomorphic to take advantages of memoization. Compare

>>> :set +s
>>> binomial !! 1000 !! 1000 :: Integer
1
(0.01 secs, 1,385,512 bytes)
>>> binomial !! 1000 !! 1000 :: Integer
1
(0.01 secs, 1,381,616 bytes)

against

>>> let binomial' = binomial :: [[Integer]]
>>> binomial' !! 1000 !! 1000 :: Integer
1
(0.01 secs, 1,381,696 bytes)
>>> binomial' !! 1000 !! 1000 :: Integer
1
(0.01 secs, 391,152 bytes)

Documentation