lizfcm/src/approx/maceps.lisp

13 lines
318 B
Common Lisp
Raw Normal View History

2023-09-25 12:36:23 -04:00
(in-package :lizfcm.approx)
2023-09-27 11:38:55 -04:00
(defun compute-maceps (f a init)
(let ((h init)
(err init))
2023-09-25 12:36:23 -04:00
(loop while (> err 0)
do
2023-09-27 11:38:55 -04:00
(setf h (/ h 2)
err (abs (- (funcall f (+ a h))
(funcall f a))))
2023-09-27 12:10:33 -04:00
when (> err 0)
2023-09-25 12:36:23 -04:00
collect (list a h err))))