3 ms·
I computed Fibonacci(20*10^6) using Binet's formula. The answer has 4179753 digits. I computed sqrt(5) to 4179753 digits and applied the formula. The result
by irchans 7y ago
I computed Fibonacci(20*10^6) using Binet's formula. The answer has 4179753 digits. I computed sqrt(5) to 4179753 digits and applied the formula. The result was correct.
The time to compute sqrt(5) was 0.23 sec. The time compute the formula (I dropped the insignificant 1-sqrt(5) term) was 2.8 seconds. When I used the built in Mathematica function to compute the Fibonacci number, it took 0.12 seconds.