- type Interval = Maybe Ball
- fromBallA :: Precision -> Ball -> Interval
- fromBall :: Ball -> Interval
- make :: Dyadic -> Dyadic -> Interval
- makeA :: Precision -> Dyadic -> Dyadic -> Interval
- below :: Interval -> Interval -> Bool
- contains :: Interval -> Dyadic -> Bool
- includes :: Interval -> Interval -> Inclusion
- intersectA :: Precision -> Interval -> Interval -> Interval
- intersect :: Interval -> Interval -> Interval
- neg :: Precision -> Interval -> Interval
- add :: Precision -> Interval -> Interval -> Interval
- mul :: Precision -> Interval -> Interval -> Interval
- sub :: Precision -> Interval -> Interval -> Interval
- div :: Precision -> Interval -> Interval -> Interval
- sqrt :: Precision -> Interval -> Interval
- exp :: Precision -> Interval -> Interval
- log :: Precision -> Interval -> Interval
- compareI :: Interval -> Interval -> POrdering
- maxI :: Precision -> Interval -> Interval -> Interval
- minI :: Precision -> Interval -> Interval -> Interval
- center :: Monad m => Interval -> m Dyadic
- radius :: Monad m => Interval -> m Dyadic
- lower :: Monad m => Interval -> m Dyadic
- upper :: Monad m => Interval -> m Dyadic
- width :: Monad m => Interval -> m Dyadic
- fromDyadic :: Precision -> Dyadic -> Interval
- fromString :: Precision -> String -> Interval
- fromInt :: Precision -> Int -> Interval
- fromWord :: Precision -> Word -> Interval
- toString :: Interval -> String

# Documentation

type Interval = Maybe BallSource

A wrapper around Ball allowing the results of operations like division by interval containing zero to be represented and do not cause errors.

Nothing represents undefined interval.

fromBallA :: Precision -> Ball -> IntervalSource

Make an interval from a ball and normalize it to specified precision.

make :: Dyadic -> Dyadic -> IntervalSource

Make an interval from two endpoints so that no precision is lost.

:: Precision | precision of the interval's center |

-> Dyadic | left endpoint |

-> Dyadic | right endpoint |

-> Interval |

Make an interval from two endpoints.

below :: Interval -> Interval -> BoolSource

Checks if second interval is inside the first. _|_ is above all.

contains :: Interval -> Dyadic -> BoolSource

Checks if interval contains dyadic. _|_ contains everything.

includes :: Interval -> Interval -> InclusionSource

Returns Below if second interval is inside first, Above if converse, NoInclusion otherwise.

intersectA :: Precision -> Interval -> Interval -> IntervalSource

Return the intersection of two intervals. The resulting interval's center has specified precision.

If one of the intervals is _|_ then just return the other (even if it is _|_).

intersect :: Interval -> Interval -> IntervalSource

Return the intersection of two intervals so that no precision is lost.

add :: Precision -> Interval -> Interval -> IntervalSource

Addition. If one of the arguments is _|_, so is the result.

mul :: Precision -> Interval -> Interval -> IntervalSource

Multiplication. If one of the arguments is _|_, so is the result

sub :: Precision -> Interval -> Interval -> IntervalSource

Subtraction. If one of the arguments is _|_, so is the result

div :: Precision -> Interval -> Interval -> IntervalSource

Division. If one of the arguments is _|_ or divisor contains 0 then result is _|_.

sqrt :: Precision -> Interval -> IntervalSource

Square root. If one argument is _|_ or interval contains 0 then result is _|_.

log :: Precision -> Interval -> IntervalSource

Natural logarithm. If one argument is _|_ or interval contains 0 then result is _|_.

compareI :: Interval -> Interval -> POrderingSource

Compare two intervals. If one of them is _|_ the result is incomparable, otherwise result is comparison of balls.

maxI :: Precision -> Interval -> Interval -> IntervalSource

Maximum of intervals. If one interval is _|_ so is the result.

center :: Monad m => Interval -> m DyadicSource

Center of interval. Center on _|_ will result in fail.

radius :: Monad m => Interval -> m DyadicSource

Radius of interval. Radius on _|_ will result in fail.

lower :: Monad m => Interval -> m DyadicSource

Lower endpoint of interval with precision of the center. Lower on _|_ will result in fail.

upper :: Monad m => Interval -> m DyadicSource

Upper endpoint of interval with precision of the center. Upper on _|_ will result in fail.

width :: Monad m => Interval -> m DyadicSource

Width of the interval. Widht on _|_ will result in fail.

fromDyadic :: Precision -> Dyadic -> IntervalSource

fromString :: Precision -> String -> IntervalSource