Exercise 1.7
Given this procedure:
1 2 | (define (good-enough? guess x) (< (abs (- (square guess) x)) 0.001)) |
We want an improved version of good-enough? that implements the following check:
for a value of
1 2 3 4 5 6 7 | (define (good-enough-improv? oldguess newguess) (< (abs (- newguess oldguess)) (/ newguess 10000))) (define (sqrt-iter-improv oldguess newguess x) (if (good-enough-improv? oldguess newguess) newguess (sqrt-iter-improv newguess (improve newguess x) x))) |

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.