From 1a8c81d07efe55c5a6909aff32359d4b8866af1c Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Wed, 27 Sep 2023 09:53:37 -0600 Subject: keep unit tests but make directory structure more consistent with requirements i did not read --- tests/maceps.lisp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/maceps.lisp (limited to 'tests/maceps.lisp') diff --git a/tests/maceps.lisp b/tests/maceps.lisp new file mode 100644 index 0000000..cd5ced9 --- /dev/null +++ b/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)))) -- cgit v1.2.3-70-g09d2