Code Review

Compare your solutions

    #| BEGIN (Write your solution here) |#
(define (cont-frac n d k)
  (define (f c)
    (if (> c k)
        0
        (/ (n c) (- (d c) (f (+ c 1))))))
  (f 1))

(define (tan-cf x k)
  (let ((d (lambda (i) (- (* 2 i) 1)))
        (n (lambda (i) (if (= i 1) x (* x x)))))
    (cont-frac n d k)))
#| END |#