summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-11-10 22:39:05 +0100
committerTom Smeding <tom@tomsmeding.com>2024-11-10 22:39:05 +0100
commit4d573fa32997a8e4824bf8326fb675d0c195b1ac (patch)
treeb09ebda92ed78065720da385a9954454899af1fd
parent013e01e28aba090c065ed584671a65aa339ea51b (diff)
Fix forward derivative of 'exp'
-rw-r--r--src/ForwardAD/DualNumbers.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ForwardAD/DualNumbers.hs b/src/ForwardAD/DualNumbers.hs
index 0a08926..e8b140e 100644
--- a/src/ForwardAD/DualNumbers.hs
+++ b/src/ForwardAD/DualNumbers.hs
@@ -79,7 +79,7 @@ dop = \case
EPair ext (recip' t x)
(mul t (neg t (recip' t (mul t x x))) dx))
OExp t -> floatingDual t $ unFloat (\(x, dx) ->
- EPair ext (EOp ext (OExp t) x) (EOp ext (OExp t) dx))
+ EPair ext (EOp ext (OExp t) x) (mul t (EOp ext (OExp t) x) dx))
OLog t -> floatingDual t $ unFloat (\(x, dx) ->
EPair ext (EOp ext (OLog t) x)
(mul t (recip' t x) dx))