1 USING: math kernel hints prettyprint io combinators ;
2 IN: benchmark.recursive
5 dup 2 < [ drop 1 ] [ [ 1 - fib ] [ 2 - fib ] bi + ] if ;
10 { [ over zero? ] [ nip 1+ ] }
11 { [ dup zero? ] [ drop 1- 1 ack ] }
12 [ [ drop 1- ] [ 1- ack ] 2bi ack ]
13 } cond ; inline recursive
24 ] if ; inline recursive
27 [ 3 swap ack . flush ]
28 [ 27.0 + fib . flush ]
29 [ 1- [ 3 * ] [ 2 * ] [ ] tri tak . flush ] tri
31 3.0 2.0 1.0 tak . flush ;
33 HINTS: recursive fixnum ;
35 : recursive-main ( -- ) 11 recursive ;