In article <pan.2009.02.10.22.26...@remove.this.cybersource.com.au>,
Steven D'Aprano  <ste...@remove.this.cybersource.com.au> wrote:
                        .
                        .
                        .
>> And now for my version (which admitedly isn't really mine, and returns
>> slightly incorrect fib(n) for large values of n, due to the limited
>> floating point precision).
>
>The floating point version is nice, but it starts giving incorrect 
>answers relatively early, from n=71. But if you don't need accurate 
>results (a relative error of 3e-15 for n=71), it is very fast.
                        .
                        .
                        .
While my personal opinion is that it's silly to 
characterize an error of 3e-15 as not "accurate",
I think more constructive is to focus on the fact
that the closed-form solution can be touched up
to give a precise integral solution, while re-
taining its (approximately) O(log n) run-time
cost.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to