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