home *** CD-ROM | disk | FTP | other *** search
- ; book p.107
-
- (defun newton-search (f df guess)
- (flet ((improve (guess)
- (- guess (/ (funcall f guess) (funcall df guess))))
- (good-enough-p (guess)
- (< (abs (funcall f guess)) .001)))
- (do ((guess guess (improve guess)))
- ((good-enough-p guess) guess))))
-
- (defun make-derivative (f h)
- #'(lambda (x)
- (let ((fx+ (funcall f (+ x h)))
- (fx- (funcall f (- x h)))
- (2h (* 2 h)))
- (/ (- fx+ fx-) 2h))))
-