Exercise 1.35 of SICP

Exercise 1.35: Show that the golden ratio \( \phi \) (section 1.2.2) is a fixed point of the transformation \( x\mapsto 1 + \frac{1}{x} \), and use this fact to compute \( \phi \) by means of the fixed-point procedure.

(define tolerance 0.00001)
(define (fixed-point f first-guess)
  (define (close-enough? v1 v2)
	(< (abs (- v1 v2)) tolerance))
  (define (try guess)
	(let ((next (f guess)))
	  (if (close-enough? guess next)
		  next
		  (try next))))
  (try first-guess))
> (fixed-point (lambda (x) (+ 1 (/ 1 x))) 1.0)
1.6180327868852458

Actual value of golden ratio: 1.61803399

Tolerance: 0.0001

$$ \epsilon = \left|1.61803399-1.6180327868852458\right| = .0000012031147542 < 0.0001 $$

Clearly \( \epsilon \) is in the defined error tolerance.