;;; This is the Scheme code that was used to generate
;;; the times reported in TIMES.
;;;

(define (reference-fib-loop n count)
  (let ((saved-n (+ n -2)))
    (let main-loop ((pos count)
		    (t 1))
      (if (>= 0 pos)
	  t
	  (main-loop (- pos 1)
		     (let inner-loop ((x saved-n)
				      (tn1 1)
				      (tn2 1))
		       (if (>= 0 x)
			   tn1
			   (inner-loop (- x 1)
				       (+ tn1 tn2)
				       tn1))))))))


