fib(n)={ if(n<0,return((-1)^(n+1)*fib(n))); my(a=0,b=1,t); while(n, t=a+b; a=b; b=t; n-- ); a };