diff options
Diffstat (limited to 'cl/src')
-rw-r--r-- | cl/src/approx/maceps.lisp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cl/src/approx/maceps.lisp b/cl/src/approx/maceps.lisp index cd24482..ad234e8 100644 --- a/cl/src/approx/maceps.lisp +++ b/cl/src/approx/maceps.lisp @@ -1,13 +1,11 @@ (in-package :lizfcm.approx) -(defun compute-maceps (val f) - (let* ((h val) - (a val) - (err val)) +(defun compute-maceps (f a init) + (let ((h init) + (err init)) (loop while (> err 0) do - (progn - (setf h (/ h 2) - err (abs (- (funcall f (+ a h)) - (funcall f a))))) + (setf h (/ h 2) + err (abs (- (funcall f (+ a h)) + (funcall f a)))) collect (list a h err)))) |