I tried to write my own fib function that works for large numbers (over 50) and I had no luck. First I tried the obvious solution but that overflows way to quicly. my next solution was this
$fun fib(a:int, b:int, index:int) = if(index = 1) then
$ (a+b)
$ else
$ fib(b, (a+b), index - 1);
Unfortunatly this also overflows.