-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Log-domain arithmetic
--   
--   This package provides log-domain floats, doubles and complex numbers.
@package log-domain
@version 0.13.2

module Numeric.Log

-- | Log-domain Float and Double values.
newtype Log a
Exp :: a -> Log a
[ln] :: Log a -> a

-- | Efficiently and accurately compute the sum of a set of log-domain
--   numbers
--   
--   While folding with (+) accomplishes the same end, it requires
--   an additional n-2 logarithms to sum n terms. In
--   addition, here we introduce fewer opportunities for round-off error.
--   
--   While for small quantities the naive sum accumulates error,
--   
--   
--   >>> let xs = Prelude.replicate 40000 (Exp 1e-4) :: [Log Float]
--   
--   >>> Prelude.sum xs ~= 4.00e4
--   True
--   
--   
--   This sum gives a more accurate result,
--   
--   
--   >>> Numeric.Log.sum xs ~= 4.00e4
--   True
--   
--   
--   NB: This does require two passes over the data.
sum :: (RealFloat a, Foldable f) => f (Log a) -> Log a
instance GHC.Internal.Base.Applicative Numeric.Log.Log
instance Data.Functor.Bind.Class.Apply Numeric.Log.Log
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Numeric.Log.Log a)
instance Data.Functor.Bind.Class.Bind Numeric.Log.Log
instance Control.Comonad.ComonadApply Numeric.Log.Log
instance Control.Comonad.Comonad Numeric.Log.Log
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Numeric.Log.Log a)
instance Data.Distributive.Distributive Numeric.Log.Log
instance (GHC.Internal.Float.RealFloat a, GHC.Internal.Enum.Enum a) => GHC.Internal.Enum.Enum (Numeric.Log.Log a)
instance Data.Functor.Classes.Eq1 Numeric.Log.Log
instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.Log.Log a)
instance Data.Functor.Extend.Extend Numeric.Log.Log
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Numeric.Log.Log a)
instance Data.Foldable1.Foldable1 Numeric.Log.Log
instance GHC.Internal.Data.Foldable.Foldable Numeric.Log.Log
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Real.Fractional (Numeric.Log.Log a)
instance GHC.Internal.Base.Functor Numeric.Log.Log
instance GHC.Internal.Generics.Generic (Numeric.Log.Log a)
instance Data.Hashable.Class.Hashable1 Numeric.Log.Log
instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Numeric.Log.Log a)
instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (Numeric.Log.Log a)
instance GHC.Internal.Base.Monad Numeric.Log.Log
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Base.Monoid (Numeric.Log.Log a)
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Numeric.Log.Log a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Num.Num (Numeric.Log.Log a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Numeric.Log.Log a)
instance (GHC.Internal.Float.Floating a, GHC.Internal.Read.Read a) => GHC.Internal.Read.Read (Numeric.Log.Log a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Real.RealFrac (Numeric.Log.Log a)
instance (GHC.Internal.Float.RealFloat a, GHC.Classes.Ord a) => GHC.Internal.Real.Real (Numeric.Log.Log a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Base.Semigroup (Numeric.Log.Log a)
instance Data.Bytes.Serial.Serial1 Numeric.Log.Log
instance Data.Bytes.Serial.Serial a => Data.Bytes.Serial.Serial (Numeric.Log.Log a)
instance Data.Serialize.Serialize a => Data.Serialize.Serialize (Numeric.Log.Log a)
instance (GHC.Internal.Float.Floating a, GHC.Internal.Show.Show a) => GHC.Internal.Show.Show (Numeric.Log.Log a)
instance GHC.Internal.Foreign.Storable.Storable a => GHC.Internal.Foreign.Storable.Storable (Numeric.Log.Log a)
instance Data.Semigroup.Traversable.Class.Traversable1 Numeric.Log.Log
instance GHC.Internal.Data.Traversable.Traversable Numeric.Log.Log
instance (GHC.Internal.Float.RealFloat a, Data.Vector.Unboxed.Base.Unbox a) => Data.Vector.Unboxed.Base.Unbox (Numeric.Log.Log a)
instance (GHC.Internal.Float.RealFloat a, Data.Vector.Unboxed.Base.Unbox a) => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (Numeric.Log.Log a)

module Numeric.Log.Signed

-- | Log-domain Float and Double values, with a
--   sign bit.
data SignedLog a
SLExp :: Bool -> a -> SignedLog a
[signSL] :: SignedLog a -> Bool
[lnSL] :: SignedLog a -> a
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Numeric.Log.Signed.SignedLog a)
instance (GHC.Classes.Eq a, GHC.Internal.Real.Fractional a) => GHC.Classes.Eq (Numeric.Log.Signed.SignedLog a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Numeric.Log.Signed.SignedLog a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Real.Fractional (Numeric.Log.Signed.SignedLog a)
instance GHC.Internal.Generics.Generic (Numeric.Log.Signed.SignedLog a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Num.Num (Numeric.Log.Signed.SignedLog a)
instance (GHC.Classes.Ord a, GHC.Internal.Real.Fractional a) => GHC.Classes.Ord (Numeric.Log.Signed.SignedLog a)
instance (GHC.Internal.Float.RealFloat a, GHC.Internal.Read.Read a) => GHC.Internal.Read.Read (Numeric.Log.Signed.SignedLog a)
instance GHC.Internal.Float.RealFloat a => GHC.Internal.Real.RealFrac (Numeric.Log.Signed.SignedLog a)
instance (GHC.Internal.Float.RealFloat a, GHC.Classes.Ord a) => GHC.Internal.Real.Real (Numeric.Log.Signed.SignedLog a)
instance (GHC.Internal.Show.Show a, GHC.Internal.Float.RealFloat a, GHC.Classes.Eq a, GHC.Internal.Real.Fractional a) => GHC.Internal.Show.Show (Numeric.Log.Signed.SignedLog a)
