lizfcm/deprecated-cl/approx,maceps.lisp

13 lines
294 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-10-09 23:08:25 -04:00
(loop collect (list a h err)
2023-09-25 12:36:23 -04:00
do
2023-09-27 11:38:55 -04:00
(setf h (/ h 2)
err (abs (- (funcall f (+ a h))
(funcall f a))))
2023-10-09 23:08:25 -04:00
while (> err 0))))