You're viewing a comment by constant time and its responses.

constant time Permalink
July 07, 2009, 13:52

How about a closed form evaluation?

F(n) = (Phi^n - (1-Phi)^n) / sqrt(5)

Where Phi is the Golden Ratio.
Phi = (1 + sqrt(5)) / 2

Comment Responses

EntropySpark Permalink
February 02, 2014, 04:26

In that case, you'll need phi and sqrt(5) to have enough precision to round correctly. For the 1000th Fibonacci number, you'd need both to have over 200 digits of accuracy. You then have to take your large (data-wise) decimal number and take it to a large power. Computationally, it would be much worse than repeated addition.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.