[REBOL] Re: Fibonaccio - Was: Report on WinCE Rebol --- Speed Comparison
From: bard:papegaaij:austarnet:au at: 29-Jun-2001 15:59
David Ness wrote:
>Bard Papegaaij wrote:
>>
>> Hi,
>>
>> I noticed you are using a recursive fibonaccio function to measure speed
on
>> different platforms. Some time ago I implemented a fibonaccio generator
as a
>> way of learning various aspects of REBOL. Features I used are:
>> - an object to store the function and some house-keeping variables;
>> - an iterating definition instead of the recursive one to get rid of
stack
>> overflows;
>[snip]
>...
>
>If one were actually interested in generating fibonacci numbers then
neither
>recursion nor iteration nor memory functions are needed as there is, IIRC,
>a straightforward closed form for the fibonnaci which would evaluate for
>any N at the cost of a couple of logs and a couple of exponentials.
Mmmmm. I didn't know about that one? Any pointers I could follow up? As far
as
I know, the fibanoccio series approximates - but never quite reaches - a
true
logarithmic progression. A solution using logs and exponentials sounds
interesting.
>The objective here was, of course, to compare the machines and thus we
wanted
>to use functions that consumed some detectable amount of time. Trying to
>make those functions `efficient' doesn't, it is clear, make sense for that
>purpose.
I understand completely. It was just that I saw you using the fib function,
and
thought it would be nice to share my attempts at coding the same function
using
a number of different 'solutions' for some of the problems posed by that
simple
recursive definition (speed, inability to calculate higher than fib 42,
stack overflow).
Sorry if I have thrown you off track by 'hi-jacking' your thread for
something like
this. It won't happen again I ('m not sure I can) promise ;-).
Regards,
Bard