# Re: Fast Fibonacci method

**URL:** <https://www.ruby-forum.com/t/re-fast-fibonacci-method/61799>\
**Category:** Ruby\
**Created:** [May 27, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/re-fast-fibonacci-method/61799 "2006-05-27T17:58:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 27, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/re-fast-fibonacci-method/61799/1 "2006-05-27T17:58:56Z")

</div>

Dear Erlercw,

if you want to implement the Fibonacci calculation to show some  
benchmark using the recurrence formula F\_{n+2}=F\_{n+1}+F\_{n},  
this isn’t for you.

But I’d bet that the formula 1.3.3 in

\_[http://www.math.upenn.edu/~wilf/gfology.pdf\_](http://www.math.upenn.edu/~wilf/gfology.pdf_)  
([http://www.math.upenn.edu/~wilf/gfology.pdf](http://www.math.upenn.edu/~wilf/gfology.pdf))

is faster (on any machine/computer language ) as it involves  
multiplying the  
same factors all the time. One could just do one multiplication  
using logarithms, actually, and then convert back the result.

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 28, 2006, 5:53pm UTC](https://www.ruby-forum.com/t/re-fast-fibonacci-method/61799/2 "2006-05-28T17:53:13Z")

</div>

On 27/05/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ([http://www.math.upenn.edu/~wilf/gfology.pdf](http://www.math.upenn.edu/~wilf/gfology.pdf))
> 
> is faster (on any machine/computer language ) as it involves multiplying  
> the  
> same factors all the time. One could just do one multiplication  
> using logarithms, actually, and then convert back the result.
> 
> Best regards,
> 
> Axel

Thanks for your suggestion. I tried various methods of implementing  
that  
formula, taking care to get exact results, but I can’t figure out how to  
speed them up enough.
