Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Math and Science (http://www.chiefdelphi.com/forums/forumdisplay.php?f=70)
-   -   Fibonacci Sequence (http://www.chiefdelphi.com/forums/showthread.php?t=68172)

tennispro9911 23-06-2008 22:42

Re: Fibonacci Sequence
 
I'll try to. I think I found a way to make my program significantly faster. With a new algorithm and my desktop computer it took ~9 sec to get the millionth term and 3:22:000 for the 5,000,000th. I'll try 100 mil. My guess is about 15-20 hour run time.

Ian Curtis 23-06-2008 23:39

Re: Fibonacci Sequence
 
Quote:

Originally Posted by tennispro9911 (Post 754074)
I'll try to. I think I found a way to make my program significantly faster. With a new algorithm and my desktop computer it took ~9 sec to get the millionth term and 3:22:000 for the 5,000,000th. I'll try 100 mil. My guess is about 15-20 hour run time.

If you're going for speed, wouldn't it be a little bit faster to just use the explicit definition? :p

tennispro9911 23-06-2008 23:45

Re: Fibonacci Sequence
 
I tried that, but it didn't work for me, with such large numbers. Feel free to see if you can get it to work yourself.

ComradeNikolai 24-06-2008 11:19

Re: Fibonacci Sequence
 
Would you care to share this new algorithm? I'm interested to see it.

bobwrit 11-11-2008 21:55

Re: Fibonacci Sequence
 
I found a mathimatical function to define it, thus eliminating recursion. Have fun...
Code:

((x^n)-(-x)^(-n))/sqrt(5)
where x is (1+sqrt(5))/2 and n is the Nth term of the sequence.


All times are GMT -5. The time now is 07:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi