summaryrefslogtreecommitdiff
path: root/Homework/math4610/deprecated-cl/tests,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/tests,maceps.lisp
downloadmisc-undergrad-main.tar.gz
misc-undergrad-main.zip
Diffstat (limited to 'Homework/math4610/deprecated-cl/tests,maceps.lisp')
-rw-r--r--Homework/math4610/deprecated-cl/tests,maceps.lisp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Homework/math4610/deprecated-cl/tests,maceps.lisp b/Homework/math4610/deprecated-cl/tests,maceps.lisp
new file mode 100644
index 0000000..cd5ced9
--- /dev/null
+++ b/Homework/math4610/deprecated-cl/tests,maceps.lisp
@@ -0,0 +1,27 @@
+(defpackage lizfcm/tests.maceps
+ (:use :cl
+ :fiveam
+ :lizfcm.approx
+ :lizfcm.utils
+ :lizfcm/tests)
+ (:export :approx-suite))
+(in-package :lizfcm/tests.maceps)
+
+(def-suite maceps-suite
+ :in lizfcm-test-suite)
+(in-suite maceps-suite)
+
+(test maceps
+ :description "double precision provides precision about (mac eps of single precision) squared"
+ (let* ((maceps-computation-double (compute-maceps (lambda (x) x)
+ 1.0d0
+ 1.0d0))
+ (maceps-computation-single (compute-maceps (lambda (x) x)
+ 1.0
+ 1.0))
+ (last-double-h (cadar (last maceps-computation-double)))
+ (last-single-h (cadar (last maceps-computation-single))))
+ (is (within-range-p
+ (- last-double-h (* last-single-h last-single-h))
+ 0
+ last-single-h))))