Blame


1 665c255d 2023-08-04 jrmu (define (search f neg-point pos-point)
2 665c255d 2023-08-04 jrmu (let ((midpoint (average neg-point pos-point)))
3 665c255d 2023-08-04 jrmu (if (close-enough? neg-point pos-point)
4 665c255d 2023-08-04 jrmu midpoint
5 665c255d 2023-08-04 jrmu (let ((test-value (f midpoint)))
6 665c255d 2023-08-04 jrmu (cond ((positive? test-value)
7 665c255d 2023-08-04 jrmu (search f neg-point midpoint))
8 665c255d 2023-08-04 jrmu ((negative? test-value)
9 665c255d 2023-08-04 jrmu (search f midpoint pos-point))
10 665c255d 2023-08-04 jrmu (else midpoint))))))