From adda6869cb2a07984b48c39fcd70ee76449c353d Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 9 Oct 2023 21:08:25 -0600 Subject: updates 10/9 --- tests/approx.lisp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/approx.lisp') diff --git a/tests/approx.lisp b/tests/approx.lisp index 2fd8124..588b16d 100644 --- a/tests/approx.lisp +++ b/tests/approx.lisp @@ -11,7 +11,7 @@ :in lizfcm-test-suite) (in-suite approx-suite) -(test derivative-at +(test central-derivative-at :description "derivative at is within bounds" (let ((f (lambda (x) (* x x))) (x 2) @@ -19,6 +19,18 @@ (f-prime-at-x 4) (delta 0.01)) (is (within-range-p - (derivative-at f x delta) + (central-derivative-at f x delta) + f-prime-at-x + accepted-delta)))) + +(test fwd-derivative-at + :description "forward derivative at is within bounds" + (let ((f (lambda (x) (* x x))) + (x 2) + (accepted-delta 0.02) + (f-prime-at-x 4) + (delta 0.01)) + (is (within-range-p + (forward-derivative-at f x delta) f-prime-at-x accepted-delta)))) -- cgit v1.2.3-70-g09d2