summaryrefslogtreecommitdiff
path: root/tests/approx.lisp
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-10-09 21:08:25 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-10-09 21:08:25 -0600
commitadda6869cb2a07984b48c39fcd70ee76449c353d (patch)
tree3aff88b65292e2ab0e108781206d954a015b2e33 /tests/approx.lisp
parentb35e3998333e8190bf07ade51dba30773b3a3d0b (diff)
downloadcmath-adda6869cb2a07984b48c39fcd70ee76449c353d.tar.gz
cmath-adda6869cb2a07984b48c39fcd70ee76449c353d.zip
updates 10/9
Diffstat (limited to 'tests/approx.lisp')
-rw-r--r--tests/approx.lisp16
1 files changed, 14 insertions, 2 deletions
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))))