Code Review

Compare your solutions

    #| BEGIN (Введите свое решение) |#
(define (average x y)
  (/ (+ x y) 2))

(define (improve guess x)
  (average guess (/ x guess)))

(define (sqrt x)
  (sqrt-iter 1.0 x))

(define (good-enough? guess prev_guess)
  (< (abs (- prev_guess guess))
     0.001))

(define (sqrt-iter guess prev_guess x)
  (if (good-enough? guess prev_guess)
      guess
      (sqrt-iter (improve guess x)
                 guess
                 x)))

(define (square-root x)
  (sqrt-iter 1.0 x x))
#| END |#