aboutsummaryrefslogtreecommitdiff
path: root/src/PPL/Internal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PPL/Internal.hs')
-rw-r--r--src/PPL/Internal.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PPL/Internal.hs b/src/PPL/Internal.hs
index 201a3aa..d927508 100644
--- a/src/PPL/Internal.hs
+++ b/src/PPL/Internal.hs
@@ -18,7 +18,7 @@ import Control.Monad.IO.Class
-- Reimplementation of the LazyPPL monads to avoid some dependencies
-data Tree = Tree Double [Tree]
+data Tree = Tree !Double [Tree]
split :: Tree -> (Tree, Tree)
split (Tree r (t : ts)) = (t, Tree r ts)
@@ -61,7 +61,7 @@ newtype Meas a = Meas (WriterT (Product (Log Double)) Prob a)
score :: Double -> Meas ()
score = scoreLog . Exp . log . max eps
where
- eps = $(TH.lift (until ((== 1) . (1 +)) (/ 2) (1 :: Double))) -- machine epsilon, force compile time eval
+ eps = $(TH.lift (2 * until ((== 1) . (1 +)) (/ 2) (1 :: Double))) -- machine epsilon, force compile time eval
{-# INLINE scoreLog #-}
scoreLog :: Log Double -> Meas ()