;3.65
(define (ln2x n)
(cons-stream (/ 1.0 n)
(stream-map - (ln2x (+ 1 n)))))
(define ln2-stream
(scale-stream (patial (ln2x 1)) 4))
(define (euler-transform s)
(let ((s0 (stream-ref s 0))
(s1 (stream-ref s 1))
(s2 (stream-ref s 2)))
(cons-stream (- s2 (/ (square (- s2 s1))
(+ s0 (* -2 s1) s2)))
(euler-transform (stream-cdr s)))))
(define ln2
(euler-transform ln2-stream))
3.65
最新推荐文章于 2024-04-29 17:04:39 发布