summaryrefslogtreecommitdiff
path: root/rfib.icl
blob: a48344bada3baeb1ca5e485e35d1b304ed3e4ca3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module rfib

/*
The Nfib function using reals.

To obtain maximum performance guards are used instead of
pattern matching.

To generate an application for this program the Clean 0.8
application should be set to at least 1.1 Mb. To launch the
generated application another 150K of free memory is needed.

On a machine without a math coprocessor the execution of this
program might take a (very) long time. Use a smaller start value.
*/

import StdReal

Nfib::Real -> Real
Nfib n	| n < 1.5	=  1.0
					=	Nfib (n - 1.0) + Nfib (n - 2.0) + 1.0
					  
Start::Real
Start = Nfib 26.0