Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. (define (square x) (* x x))
  2.  
  3. (define (cont-frac n d combiner k)
  4. (define (cont-frac-aux n d a k)
  5. (if (> a k)
  6. 0
  7. (/ (n a) (combiner (d a) (cont-frac-aux n d (+ a 1) k)))))
  8. (cont-frac-aux n d 1.0 k))
  9.  
  10. (define (tan-cf x k)
  11. (cont-frac (lambda (i)
  12. (if (= i 1)
  13. x
  14. (square x)))
  15. (lambda (i) (- (* 2 i) 1))
  16. -
  17. k))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement