aboutsummaryrefslogtreecommitdiff
path: root/src/CHAD/APIv1.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-11-26 17:44:25 +0100
committerTom Smeding <tom@tomsmeding.com>2025-11-26 17:45:10 +0100
commitae634c056b500a568b2d89b7f8e225404a2c0c62 (patch)
treeec781b151761974362fe9ca5d7862d6b8892db60 /src/CHAD/APIv1.hs
parentb4f07c673b7c710f5861bb84e67233c63336c53d (diff)
APIv1: Some fixesHEADmaster
Diffstat (limited to 'src/CHAD/APIv1.hs')
-rw-r--r--src/CHAD/APIv1.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/CHAD/APIv1.hs b/src/CHAD/APIv1.hs
index 1ba01b1..73d1580 100644
--- a/src/CHAD/APIv1.hs
+++ b/src/CHAD/APIv1.hs
@@ -22,7 +22,7 @@ module CHAD.APIv1 (
-- * Forward derivatives (dual numbers)
jvp, jvpDN,
- Tan, DN, DNE,
+ Tan, TanS, DN, DNS, DNE,
-- * Working with expressions
interpret, interpret1,
@@ -30,6 +30,7 @@ module CHAD.APIv1 (
fullSimplify,
SList(..), Value(..), Rep,
KnownEnv(..), KnownTy(..),
+ SNat(..),
) where
import CHAD.AST
@@ -51,7 +52,7 @@ import CHAD.Interpreter.Rep
vjp :: KnownEnv env => Ex env t -> Ex (D2 t : env) (TPair t (Tup (D2E env)))
vjp = vjp' (chcSetAccum defaultConfig)
--- | Same as 'vjp'', but supply CHAD configuration.
+-- | Same as 'vjp', but supply CHAD configuration.
vjp' :: KnownEnv env => CHADConfig -> Ex env t -> Ex (D2 t : env) (TPair t (Tup (D2E env)))
vjp' config term
| Dict <- styKnown (d2 (typeOf term)) =
@@ -172,6 +173,6 @@ compile1 term = do
f <- Compile.compileStderr knownEnv term
return (\x -> f (Value x `SCons` SNil))
--- | Simpify an expression. The 'vjp'/'jvp' functions already do this automatically.
+-- | Simplify an expression. The 'vjp'/'jvp' functions already do this automatically.
fullSimplify :: KnownEnv env => Ex env t -> Ex env t
fullSimplify = simplifyFix . pruneExpr knownEnv . simplifyFix