News for hackers. Stuff that matters.
Re:It Can Happen to You by desertrider12 on Thursday March 04, 2021 @09:36PM (#26351819)
That's pretty much what I meant by the matrix exponentiation method - applying the map (a, b) -> (a+b, a) repeatedly. Your function definitely uses tail calls, but I was just trying to say more than tail call optimization is needed to transform the trivial recursive version

fibb 0 = 0

fibb 1 = 1

fibb n = + (fibb (- n 1)) (fibb (- n 2))

into that, or any O(n) version.

There are no comments on this comment yet.