(define (search f neg-point pos-point) (let ((midpoint (average neg-point pos-point))) (if (close-enough? neg-point post-point) midpoint (nif (f midpoint) (search f neg-point midpoint) (midpoint) (search f midpoint pos-point)))))