(define (cont-frac-rec n d k) (define (rec i) (if (= i k) (/ (n i) (d i)) (/ (n i) (+ (d i) (rec (+ i 1)))))) (rec 1)) (define (cont-frac-iter n d k) (define (iter i res) (if (= i 0) res (iter (- i 1) (/ (n i) (+ res (d i)))))) (iter k 0)) (define phi (/ (+ 1 (sqrt 5)) 2)) ; 10 iterations needed to approximate phi using ; (lambda (i) 1.0) for n and d.