summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-03-11 00:22:26 +0100
committerTom Smeding <tom@tomsmeding.com>2025-03-11 00:25:20 +0100
commit1abb0c11efd2ba650c0a20de8047efbde2cc6adf (patch)
treee60724dbdcb96ae4c5237989c90d8093ca772bf5 /src
parent41f895bb9827f1f0e422e623879a08a0d2412f35 (diff)
test: Split adTestGen into one function per test case
This improves (compactifies) hedgehog output
Diffstat (limited to 'src')
-rw-r--r--src/ForwardAD.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ForwardAD.hs b/src/ForwardAD.hs
index e867d66..af35f91 100644
--- a/src/ForwardAD.hs
+++ b/src/ForwardAD.hs
@@ -85,6 +85,10 @@ tanScalars (STScal STF64) x = [x]
tanScalars (STScal STBool) _ = []
tanScalars STAccum{} _ = error "Accumulators not allowed in input program"
+tanEScalars :: SList STy env -> SList Value (TanE env) -> [Double]
+tanEScalars SNil SNil = []
+tanEScalars (t `SCons` ts) (Value x `SCons` xs) = tanScalars t x ++ tanEScalars ts xs
+
unzipDN :: STy t -> Rep (DN t) -> (Rep t, Rep (Tan t))
unzipDN STNil _ = ((), ())
unzipDN (STPair a b) (d1, d2) =