Safe Haskell | None |
---|---|
Language | Haskell2010 |
For some values, we want to have different kind of extreme values.
Consider a Double
representing an energy. We want near infinities
that do not lead to numeric problems.
TODO benchmark different extremes and their interplay with algebraic operations.
TODO consider the ieee754
package
- class NumericalExtremes x where
- maxFinite :: x
- minFinite :: x
- veryLarge :: x
- verySmall :: x
- extremelyLarge :: x
- extremelySmall :: x
- class NumericalEpsilon x where
- epsilon :: x
Documentation
class NumericalExtremes x where Source
Very large and small numbers with some numerical safety to 1/0
or
maxBound
(depending on if we are Integral
or RealFloat
.
We have:
maxFinite >= extremelyLarge >= veryLarge
veryLarge >= verySmall
verySmall >= extremelySmall >= minFinite
.
TODO the small stuff should actually be around zero, but positive and go
into NumericalEpsilon
. Here we should actually use other names.
Largest finite number
Smallest finite number
Around 1/100
of the largest finite number
Around 1/100
of the smallest finite number
extremelyLarge :: x Source
Around 1/ 10
of the largest finite number
extremelySmall :: x Source
Around 1/ 10
of the smallest finite number
class NumericalEpsilon x where Source
Small numbers.