3 ms·
The author of the article is aware of the article you linked to and wrote a response: http://lee-phillips.org/lispmath http://lee-phillips.org/lispmath. The pro
by alecdbrooks 12y ago
The author of the article is aware of the article you linked to and wrote a response: http://lee-phillips.org/lispmath http://lee-phillips.org/lispmath. The problem with the closed form is that once it exceeds the built-in data types, it no longer takes constant time to compute, so it's not actually always faster than doing it iteratively.
Apparently, the ideal method is "none of the above" but to use matrix exponentiation (or a formula derived from it) instead: http://nayuki.eigenstate.org/page/fast-fibonacci-algorithms http://nayuki.eigenstate.org/page/fast-fibonacci-algorithms.