[Haskell-cafe] speeding up fibonacci with memoizing
Yitzchak Gale
gale at sefer.org
Sun Feb 18 07:50:48 EST 2007
Besides memoizing, you might want to use the fact
that:
fib (2*k) == (fib (k+1))^2 - (fib (k-1))^2
fib (2*k-1) == (fib k)^2 + (fib (k-1))^2
Regards,
Yitz
More information about the Haskell-Cafe
mailing list