summaryrefslogtreecommitdiff
path: root/src/ForwardAD/DualNumbers.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-11-10 10:04:27 +0100
committerTom Smeding <tom@tomsmeding.com>2024-11-10 10:04:27 +0100
commit42d59947356ab51e5a4070b930f02f4909208d35 (patch)
tree3c8afab888e61c4e3157a257f0a40ae2fd4eb9c1 /src/ForwardAD/DualNumbers.hs
parent33e0ed21603cbd85d6aba6548811db27480647db (diff)
Complete GMM implementation
Diffstat (limited to 'src/ForwardAD/DualNumbers.hs')
-rw-r--r--src/ForwardAD/DualNumbers.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ForwardAD/DualNumbers.hs b/src/ForwardAD/DualNumbers.hs
index 9ed04bb..0a08926 100644
--- a/src/ForwardAD/DualNumbers.hs
+++ b/src/ForwardAD/DualNumbers.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
@@ -32,7 +33,7 @@ convIdx IZ = IZ
convIdx (IS i) = IS (convIdx i)
scalTyCase :: SScalTy t
- -> ((ScalIsNumeric t ~ True, Fractional (ScalRep t), DN (TScal t) ~ TPair (TScal t) (TScal t)) => r)
+ -> ((ScalIsNumeric t ~ True, ScalIsFloating t ~ True, Fractional (ScalRep t), DN (TScal t) ~ TPair (TScal t) (TScal t)) => r)
-> (DN (TScal t) ~ TScal t => r)
-> r
scalTyCase STF32 k1 _ = k1
@@ -82,6 +83,9 @@ dop = \case
OLog t -> floatingDual t $ unFloat (\(x, dx) ->
EPair ext (EOp ext (OLog t) x)
(mul t (recip' t x) dx))
+ OIDiv t -> scalTyCase t
+ (case t of {})
+ (EOp ext (OIDiv t))
where
add :: ScalIsNumeric t ~ True
=> SScalTy t -> Ex env' (TScal t) -> Ex env' (TScal t) -> Ex env' (TScal t)