felipernb/algorithms.js — pull request #69 by eush77 (2014-07-10 19:27:53+00:00)
Title: Add logarithmic Fibonacci numbers algorithm

Recently added fast exponentiation algorithm (#64) makes it possible to implement another method proposed in #26. The algorithm is based on matrix exponentiation and is O(log N) in time and O(1) in space.

This algorithm is somewhat superior to Binet's formula (#66), since it does not rely on double arithmetics precision.