rounded-hw-0.2.0: Directed rounding for built-in floating types
Safe HaskellNone
LanguageHaskell2010

Numeric.Rounded.Hardware.Class

Synopsis

Documentation

class Ord a => RoundedRing a where Source #

Rounding-controlled version of Num.

Methods

roundedAdd :: RoundingMode -> a -> a -> a Source #

roundedSub :: RoundingMode -> a -> a -> a Source #

roundedMul :: RoundingMode -> a -> a -> a Source #

roundedFusedMultiplyAdd :: RoundingMode -> a -> a -> a -> a Source #

roundedFromInteger :: RoundingMode -> Integer -> a Source #

intervalAdd :: Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> (Rounded 'TowardNegInf a, Rounded 'TowardInf a) Source #

\x_lo x_hi y_lo y_hi -> intervalAdd (Rounded x_lo) (Rounded x_hi) (Rounded y_lo) (Rounded y_hi) == (Rounded (roundedAdd TowardNegInf x_lo y_lo), Rounded (roundedAdd TowardInf x_hi y_hi))

intervalSub :: Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> (Rounded 'TowardNegInf a, Rounded 'TowardInf a) Source #

\x_lo x_hi y_lo y_hi -> intervalSub (Rounded x_lo) (Rounded x_hi) (Rounded y_lo) (Rounded y_hi) == (Rounded (roundedSub TowardNegInf x_lo y_hi), Rounded (roundedSub TowardInf x_hi y_lo))

intervalMul :: Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> (Rounded 'TowardNegInf a, Rounded 'TowardInf a) Source #

intervalMulAdd :: Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> Rounded 'TowardNegInf a -> Rounded 'TowardInf a -> (Rounded 'TowardNegInf a, Rounded 'TowardInf a) Source #

intervalFromInteger :: Integer -> (Rounded 'TowardNegInf a, Rounded 'TowardInf a) Source #

backendNameT :: Tagged a String Source #

Instances

Instances details
RoundedRing Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing Integer Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Class

RoundedRing LongDouble Source #

Only available on x86/x86_64 systems. Note that LongDouble may not work correctly on Win64.

Instance details

Defined in Numeric.Rounded.Hardware.Backend.X87LongDouble

Methods

roundedAdd :: RoundingMode -> LongDouble -> LongDouble -> LongDouble Source #

roundedSub :: RoundingMode -> LongDouble -> LongDouble -> LongDouble Source #

roundedMul :: RoundingMode -> LongDouble -> LongDouble -> LongDouble Source #

roundedFusedMultiplyAdd :: RoundingMode -> LongDouble -> LongDouble -> LongDouble -> LongDouble Source #

roundedFromInteger :: RoundingMode -> Integer -> LongDouble Source #

intervalAdd :: Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> (Rounded 'TowardNegInf LongDouble, Rounded 'TowardInf LongDouble) Source #

intervalSub :: Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> (Rounded 'TowardNegInf LongDouble, Rounded 'TowardInf LongDouble) Source #

intervalMul :: Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> (Rounded 'TowardNegInf LongDouble, Rounded 'TowardInf LongDouble) Source #

intervalMulAdd :: Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> Rounded 'TowardNegInf LongDouble -> Rounded 'TowardInf LongDouble -> (Rounded 'TowardNegInf LongDouble, Rounded 'TowardInf LongDouble) Source #

intervalFromInteger :: Integer -> (Rounded 'TowardNegInf LongDouble, Rounded 'TowardInf LongDouble) Source #

backendNameT :: Tagged LongDouble String Source #

RoundedRing CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

Integral a => RoundedRing (Ratio a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Class

(RealFloat a, Num a, RealFloatConstants a) => RoundedRing (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

Methods

roundedAdd :: RoundingMode -> ViaRational a -> ViaRational a -> ViaRational a Source #

roundedSub :: RoundingMode -> ViaRational a -> ViaRational a -> ViaRational a Source #

roundedMul :: RoundingMode -> ViaRational a -> ViaRational a -> ViaRational a Source #

roundedFusedMultiplyAdd :: RoundingMode -> ViaRational a -> ViaRational a -> ViaRational a -> ViaRational a Source #

roundedFromInteger :: RoundingMode -> Integer -> ViaRational a Source #

intervalAdd :: Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> (Rounded 'TowardNegInf (ViaRational a), Rounded 'TowardInf (ViaRational a)) Source #

intervalSub :: Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> (Rounded 'TowardNegInf (ViaRational a), Rounded 'TowardInf (ViaRational a)) Source #

intervalMul :: Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> (Rounded 'TowardNegInf (ViaRational a), Rounded 'TowardInf (ViaRational a)) Source #

intervalMulAdd :: Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> Rounded 'TowardNegInf (ViaRational a) -> Rounded 'TowardInf (ViaRational a) -> (Rounded 'TowardNegInf (ViaRational a), Rounded 'TowardInf (ViaRational a)) Source #

intervalFromInteger :: Integer -> (Rounded 'TowardNegInf (ViaRational a), Rounded 'TowardInf (ViaRational a)) Source #

backendNameT :: Tagged (ViaRational a) String Source #

class RoundedRing a => RoundedFractional a where Source #

Rounding-controlled version of Fractional.

Minimal complete definition

roundedDiv

Instances

Instances details
RoundedFractional Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional Integer Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Class

RoundedFractional LongDouble Source #

Only available on x86/x86_64 systems. Note that LongDouble may not work correctly on Win64.

Instance details

Defined in Numeric.Rounded.Hardware.Backend.X87LongDouble

RoundedFractional CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

Integral a => RoundedFractional (Ratio a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Class

(RealFloat a, Num a, RealFloatConstants a) => RoundedFractional (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

class RoundedRing a => RoundedSqrt a where Source #

Rounding-controlled version of sqrt.

Minimal complete definition

roundedSqrt

Instances

Instances details
RoundedSqrt Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt LongDouble Source #

Only available on x86/x86_64 systems. Note that LongDouble may not work correctly on Win64.

Instance details

Defined in Numeric.Rounded.Hardware.Backend.X87LongDouble

RoundedSqrt CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

(RealFloat a, RealFloatConstants a) => RoundedSqrt (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

class RoundedRing a => RoundedRing_Vector vector a where Source #

Lifted version of RoundedRing

Minimal complete definition

Nothing

Methods

roundedSum :: RoundingMode -> vector a -> a Source #

Equivalent to \r -> foldl (roundedAdd r) 0

default roundedSum :: (Vector vector a, Num a) => RoundingMode -> vector a -> a Source #

zipWith_roundedAdd :: RoundingMode -> vector a -> vector a -> vector a Source #

Equivalent to zipWith . roundedAdd

default zipWith_roundedAdd :: Vector vector a => RoundingMode -> vector a -> vector a -> vector a Source #

zipWith_roundedSub :: RoundingMode -> vector a -> vector a -> vector a Source #

Equivalent to zipWith . roundedSub

default zipWith_roundedSub :: Vector vector a => RoundingMode -> vector a -> vector a -> vector a Source #

zipWith_roundedMul :: RoundingMode -> vector a -> vector a -> vector a Source #

Equivalent to zipWith . roundedMul

default zipWith_roundedMul :: Vector vector a => RoundingMode -> vector a -> vector a -> vector a Source #

zipWith3_roundedFusedMultiplyAdd :: RoundingMode -> vector a -> vector a -> vector a -> vector a Source #

Equivalent to zipWith3 . roundedFusedMultiplyAdd

default zipWith3_roundedFusedMultiplyAdd :: Vector vector a => RoundingMode -> vector a -> vector a -> vector a -> vector a Source #

Instances

Instances details
RoundedRing_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

RoundedRing_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedRing_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedRing_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

(RealFloat a, RealFloatConstants a, Unbox a) => RoundedRing_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

(RealFloat a, RealFloatConstants a, Storable a) => RoundedRing_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

class (RoundedFractional a, RoundedRing_Vector vector a) => RoundedFractional_Vector vector a where Source #

Lifted version of RoundedFractional

Minimal complete definition

Nothing

Methods

zipWith_roundedDiv :: RoundingMode -> vector a -> vector a -> vector a Source #

Equivalent to zipWith . roundedDiv

default zipWith_roundedDiv :: Vector vector a => RoundingMode -> vector a -> vector a -> vector a Source #

Instances

Instances details
RoundedFractional_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

RoundedFractional_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedFractional_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedFractional_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

(RealFloat a, RealFloatConstants a, Unbox a) => RoundedFractional_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

(RealFloat a, RealFloatConstants a, Storable a) => RoundedFractional_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

class (RoundedSqrt a, RoundedRing_Vector vector a) => RoundedSqrt_Vector vector a where Source #

Lifted version of RoundedSqrt

Minimal complete definition

Nothing

Methods

map_roundedSqrt :: RoundingMode -> vector a -> vector a Source #

Equivalent to map . roundedSqrt

default map_roundedSqrt :: Vector vector a => RoundingMode -> vector a -> vector a Source #

Instances

Instances details
RoundedSqrt_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

RoundedSqrt_Vector Vector Double Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt_Vector Vector Float Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.Default

RoundedSqrt_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt_Vector Vector CFloat Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.C

RoundedSqrt_Vector Vector CDouble Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.FastFFI

(RealFloat a, RealFloatConstants a, Unbox a) => RoundedSqrt_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational

(RealFloat a, RealFloatConstants a, Storable a) => RoundedSqrt_Vector Vector (ViaRational a) Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Backend.ViaRational