diff options
Diffstat (limited to 'src/approx/maceps.lisp')
-rw-r--r-- | src/approx/maceps.lisp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/approx/maceps.lisp b/src/approx/maceps.lisp new file mode 100644 index 0000000..ad234e8 --- /dev/null +++ b/src/approx/maceps.lisp @@ -0,0 +1,11 @@ +(in-package :lizfcm.approx) + +(defun compute-maceps (f a init) + (let ((h init) + (err init)) + (loop while (> err 0) + do + (setf h (/ h 2) + err (abs (- (funcall f (+ a h)) + (funcall f a)))) + collect (list a h err)))) |