summaryrefslogtreecommitdiff
path: root/Homework/math4610/deprecated-cl/approx,maceps.lisp
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
commit6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch)
treeed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/math4610/deprecated-cl/approx,maceps.lisp
downloadmisc-undergrad-main.tar.gz
misc-undergrad-main.zip
Diffstat (limited to 'Homework/math4610/deprecated-cl/approx,maceps.lisp')
-rw-r--r--Homework/math4610/deprecated-cl/approx,maceps.lisp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Homework/math4610/deprecated-cl/approx,maceps.lisp b/Homework/math4610/deprecated-cl/approx,maceps.lisp
new file mode 100644
index 0000000..e2738e4
--- /dev/null
+++ b/Homework/math4610/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))))
+