SICP习题1.39解答

可推导出 tanx的公式为 tanx = Fn(k)(x) / x
其中Fn(k)(x) = x^2 /  (2(n-k) - Fn(k - 1)(x))

(define (tan-cf x k)
  (define (tan-helper k N)
    (cond ((= k 0) 0)
          (else (/ (square x)
                   (- (+ (* 2 (- N k)) 1) (tan-helper (- k 1) N))))))
  (/ (tan-helper k k) x))

(define (square x)
  (* x x))

 

 

posted @ 2007-01-05 22:22  浅蓝の天   阅读(144)  评论(0编辑  收藏  举报