-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Various number types -- -- Instances of the numerical classes for a variety of different numbers: -- (computable) real numbers, arbitrary precion fixed numbers, -- differentiable numbers, symbolic numbers. @package numbers @version 2007.4.29 module Data.Number.Interval data Interval a ival :: (Ord a) => a -> a -> Interval a getIval :: Interval a -> (a, a) instance (Ord a, Fractional a) => Fractional (Interval a) instance (Ord a, Num a) => Num (Interval a) instance (Eq a, Show a) => Show (Interval a) instance (Ord a) => Ord (Interval a) instance (Ord a) => Eq (Interval a) module Data.Number.Fixed data Fixed e class Epsilon e data Eps1 data EpsDiv10 p data Prec10 data Prec50 data PrecPlus20 e convertFixed :: (Epsilon e, Epsilon f) => Fixed e -> Fixed f dynamicEps :: Rational -> (forall e. (Epsilon e) => Fixed e -> a) -> Rational -> a instance Eq (Fixed e) instance Ord (Fixed e) instance Enum (Fixed e) instance (Epsilon e) => Real (Fixed e) instance (Epsilon e) => RealFrac (Fixed e) instance (Epsilon e) => RealFloat (Fixed e) instance (Epsilon e) => Floating (Fixed e) instance (Epsilon e) => Read (Fixed e) instance (Epsilon e) => Show (Fixed e) instance (Epsilon e) => Fractional (Fixed e) instance (Epsilon e) => Num (Fixed e) instance (Epsilon e) => Epsilon (PrecPlus20 e) instance Epsilon Prec500 instance Epsilon Prec50 instance Epsilon Prec10 instance (Epsilon e) => Epsilon (EpsDiv10 e) instance Epsilon Eps1 module Data.Number.CReal -- | The CReal type implements (constructive) real numbers. -- -- Note that the comparison operations on CReal may diverge since -- it is (by necessity) impossible to implementent them correctly and -- always terminating. -- -- This implementation is really David Lester's ERA package. data CReal -- | The showCReal function connverts a CReal to a -- String. showCReal :: Int -> CReal -> String instance Show CReal instance Read CReal instance RealFloat CReal instance RealFrac CReal instance Real CReal instance Enum CReal instance Floating CReal instance Fractional CReal instance Num CReal instance Ord CReal instance Eq CReal -- | The Data.Number.Dif module contains a data type, Dif, -- that allows for automatic forward differentiation. -- -- All the ideas are from Jerzy Karczmarczuk's work, see -- http://users.info.unicaen.fr/~karczma/arpap/diffalg.pdf. -- -- A simple example, if we define -- --
--   foo x = x*x
--   
-- -- then the function -- --
--   foo' = deriv foo
--   
-- -- will behave as if its body was 2*x. module Data.Number.Dif -- | The Dif type is the type of differentiable numbers. It's an -- instance of all the usual numeric classes. The computed derivative of -- a function is is correct except where the function is discontinuous, -- at these points the derivative should be a Dirac pulse, but it isn't. -- -- The Dif numbers are printed with a trailing ~~ to indicate that -- there is a "tail" of derivatives. data Dif a -- | The val function takes a Dif number back to a normal -- number, thus forgetting about all the derivatives. val :: Dif a -> a -- | The df takes a Dif number and returns its first -- derivative. The function can be iterated to to get higher derivaties. df :: (Num a) => Dif a -> Dif a -- | The mkDif takes a value and Dif value and makes a -- Dif number that has the given value as its normal value, and -- the Dif number as its derivatives. mkDif :: a -> Dif a -> Dif a -- | The dCon function turns a normal number into a Dif -- number with the same value. Not that numeric literals do not need an -- explicit conversion due to the normal Haskell overloading of literals. dCon :: (Num a) => a -> Dif a -- | The dVar function turns a number into a variable number. This -- is the number with with respect to which the derivaticve is computed. dVar :: (Num a) => a -> Dif a -- | The deriv function is a simple utility to take the derivative -- of a (single argument) function. It is simply defined as -- --
--   deriv f = val . df . f . dVar
--   
deriv :: (Num a, Num b) => (Dif a -> Dif b) -> (a -> b) -- | Convert a Dif function to an ordinary function. unDif :: (Num a) => (Dif a -> Dif b) -> (a -> b) instance (RealFloat a) => RealFloat (Dif a) instance (RealFrac a) => RealFrac (Dif a) instance (Real a) => Real (Dif a) instance (Floating a) => Floating (Dif a) instance (Fractional a) => Fractional (Dif a) instance (Num a) => Num (Dif a) instance (Ord a) => Ord (Dif a) instance (Eq a) => Eq (Dif a) instance (Read a) => Read (Dif a) instance (Show a) => Show (Dif a) module Data.Number.Symbolic data Sym a var :: String -> Sym a con :: a -> Sym a subst :: (Num a) => String -> Sym a -> Sym a -> Sym a unSym :: (Show a) => Sym a -> a instance (RealFloat a) => RealFloat (Sym a) instance (Floating a) => Floating (Sym a) instance (RealFrac a) => RealFrac (Sym a) instance (Real a) => Real (Sym a) instance (Enum a) => Enum (Sym a) instance (Integral a) => Integral (Sym a) instance (Fractional a) => Fractional (Sym a) instance (Num a) => Num (Sym a) instance (Show a) => Show (Sym a) instance (Ord a) => Ord (Sym a) instance (Eq a) => Eq (Sym a)