diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-27 09:38:55 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-27 09:38:55 -0600 |
commit | 5e85a662d21081bc27adc1142759659cca59cd62 (patch) | |
tree | 5838ae4172d971db11d386a06a3ca10870fdb807 /cl/src/approx/maceps.lisp | |
parent | 58c73fd511b77cb94124b71a4bb75c7ab6a6d8bc (diff) | |
download | cmath-5e85a662d21081bc27adc1142759659cca59cd62.tar.gz cmath-5e85a662d21081bc27adc1142759659cca59cd62.zip |
fix compute-maceps arguments
Diffstat (limited to 'cl/src/approx/maceps.lisp')
-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)))) |