SICP Solutions: 1.8
July 7th, 2008Here’s my solution for 1.8:
Scheme:
This is pretty simple. All we have to do is update the improve function to use our new equation, and change the names of the sqrt-* functions to crt-*:
> (define (improve guess x)
(/ (+ (* 2 guess) (/ x (square guess))) 3)
)
> (my-crt 27)
3.0000005410641766