hafar-0.1.1.0: Affine arithmetic library for Haskell

Safe HaskellNone
LanguageHaskell2010

Numeric.AffineForm

Synopsis

Documentation

type AFM t a = AFMT t Identity a Source #

data AF s a Source #

An affine form is defined by its midpoint, list of epsilon coefficients and an error coefficient

Instances
(Floating a, RealFrac a, ExplicitRounding a, Ord a) => Floating (AF s a) Source # 
Instance details

Defined in Numeric.AffineForm.Internal

Methods

pi :: AF s a #

exp :: AF s a -> AF s a #

log :: AF s a -> AF s a #

sqrt :: AF s a -> AF s a #

(**) :: AF s a -> AF s a -> AF s a #

logBase :: AF s a -> AF s a -> AF s a #

sin :: AF s a -> AF s a #

cos :: AF s a -> AF s a #

tan :: AF s a -> AF s a #

asin :: AF s a -> AF s a #

acos :: AF s a -> AF s a #

atan :: AF s a -> AF s a #

sinh :: AF s a -> AF s a #

cosh :: AF s a -> AF s a #

tanh :: AF s a -> AF s a #

asinh :: AF s a -> AF s a #

acosh :: AF s a -> AF s a #

atanh :: AF s a -> AF s a #

log1p :: AF s a -> AF s a #

expm1 :: AF s a -> AF s a #

log1pexp :: AF s a -> AF s a #

log1mexp :: AF s a -> AF s a #

(Fractional a, ExplicitRounding a, Ord a) => Fractional (AF s a) Source # 
Instance details

Defined in Numeric.AffineForm.Internal

Methods

(/) :: AF s a -> AF s a -> AF s a #

recip :: AF s a -> AF s a #

fromRational :: Rational -> AF s a #

(Fractional a, ExplicitRounding a, Ord a) => Num (AF s a) Source # 
Instance details

Defined in Numeric.AffineForm.Internal

Methods

(+) :: AF s a -> AF s a -> AF s a #

(-) :: AF s a -> AF s a -> AF s a #

(*) :: AF s a -> AF s a -> AF s a #

negate :: AF s a -> AF s a #

abs :: AF s a -> AF s a #

signum :: AF s a -> AF s a #

fromInteger :: Integer -> AF s a #

Show a => Show (AF s a) Source # 
Instance details

Defined in Numeric.AffineForm.Internal

Methods

showsPrec :: Int -> AF s a -> ShowS #

show :: AF s a -> String #

showList :: [AF s a] -> ShowS #

(Ord a, Fractional a, ExplicitRounding a) => Subdivisible (AF s a) Source # 
Instance details

Defined in Numeric.AffineForm.Internal

Methods

subdivide :: AF s a -> Int -> [AF s a] Source #

combine2 :: AF s a -> AF s a -> AF s a Source #

combine :: [AF s a] -> AF s a Source #

newEps :: Num a => AFM t (AF t a) Source #

This gives an affine form with midpoint 0 and radius 1. This affine form does not share epsilons with any affine forms created before it. It can be used to instantiate new affine forms.

newFromInterval :: (Eq a, Fractional a, ExplicitRounding a) => Interval a -> AFM t (AF t a) Source #

Creates a new affine form that covers the interval. This affine form does not share epsilons with any affine forms created before it.

singleton :: Num a => a -> AF s a Source #

Creates a new affine form that represents some exact value

evalAFM :: (forall t. AFM t b) -> b Source #

Evaluates the AFM monad. It is not possible to get an AF out of an AFM monad.

radius :: (Num a, ExplicitRounding a) => AF s a -> a Source #

Gives the radius of the affine form

midpoint :: AF s a -> a Source #

Gives the midpoint of the affine form (the first term of the affine form).

inf :: (Num a, ExplicitRounding a) => AF s a -> a Source #

Gives the minimal possible value of the affine form

sup :: (Num a, ExplicitRounding a) => AF s a -> a Source #

Gives the maximal possible value of the affine form

interval :: (Num a, Ord a, ExplicitRounding a) => AF s a -> Interval a Source #

Gives the corresponding interval of the affine form

afError :: AF s a -> a Source #

Returns the value of the error term

member :: (Num a, Ord a, ExplicitRounding a) => a -> AF s a -> Bool Source #

Returns whether the element is representable by the affine form

epscount_ :: AF s a -> Int Source #

Returns the number of noise symbols in the affine form.

setMidpoint :: (Num a, ExplicitRounding a) => a -> AF s a -> AF s a Source #

Sets the midpoint of the affine form

fix :: (Num a, Ord a, ExplicitRounding a) => AF s a -> [a] -> Interval a Source #

Fixes the epsilons of the affine form to the values in the list. The list will be padded with zeroes to match the number of coefficients.

addError :: (Num a, Ord a) => AF s a -> a -> AF s a Source #

Adds the value to the error term of the affine form

(.+) :: (Num a, ExplicitRounding a) => a -> AF s a -> AF s a Source #

Adds a scalar value to the affine form

(.*) :: (Eq a, Num a, Ord a, ExplicitRounding a) => a -> AF s a -> AF s a Source #

Multiplies the affine form by a scalar