|Portability||BangPatterns, DeriveDataTypeable, Rank2Types|
Variable precision software floating point based on
(Integer, Int) as
decodeFloat. Supports infinities and NaN, but not negative
zero or denormalization.
Accuracy has not been extensively verified, and termination of numerical algorithms has not been proven.
- data VFloat p
- class HasPrecision t => Normed t where
- effectivePrecisionWith :: (Num t, RealFloat r) => (t -> r) -> t -> t -> Int
- effectivePrecision :: (NaturalNumber p, HasPrecision t, Normed t, Num (t p)) => t p -> t p -> Int
- (-@?) :: (NaturalNumber p, HasPrecision t, Normed t, Num (t p)) => t p -> t p -> Int
- data DFloat
- toDFloat :: NaturalNumber p => VFloat p -> DFloat
- fromDFloat :: NaturalNumber p => DFloat -> Maybe (VFloat p)
- withDFloat :: DFloat -> (forall p. NaturalNumber p => VFloat p -> r) -> r
- positive infinity (
- negative infinity (
- not a number (
Floating instance so far only implements algorithms for:
floatRange is arbitrarily limited to mitigate the problems that
occur when enormous integers might be needed during some number
type conversions (worst case consequence: program abort in gmp).
A selection of norms.
A measure of meaningful precision in the difference of two finite non-zero values.
Values of very different magnitude have little meaningful
a + b when
|a| >> |b|.
Very close values have little meaningful difference,
a + (a - b) as
|a| >> |a - b|.
effectivePrecisionWith attempts to quantify this.
An alias for
A concrete format suitable for storage or wire transmission.