matrix-fib ( m -- n )


Vocabulary
benchmark.fib7

Inputs
man object


Outputs
nan object


Definition


:: matrix-fib ( m -- n )
m 0 >= [ m throw ] unless m 2 >base [ 49 = ] { } map-as
:> bits 1 :> a! 0 :> b! 1 :> c! bits [
[ a c + b * b sq c sq + ] [ a sq b sq + a c + b * ] if
b! a! a b + c!
] each b ;