can multi-core improve single funciton?

Cameron Laird claird at
Tue Feb 17 15:30:27 CET 2009

In article <pan.2009. at>,
Steven D'Aprano  <steven at> 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

More information about the Python-list mailing list