-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interval Arithmetic -- -- A Numeric.Interval.Interval is a closed, convex set of floating -- point values. -- -- We do not control the rounding mode of the end points of the interval -- when using floating point arithmetic, so be aware that in order to get -- precise containment of the result, you will need to use an underlying -- type with both lower and upper bounds like CReal @package intervals @version 0.9 module Numeric.Interval.Exception data EmptyInterval EmptyInterval :: EmptyInterval data AmbiguousComparison AmbiguousComparison :: AmbiguousComparison instance Data.Data.Data Numeric.Interval.Exception.AmbiguousComparison instance GHC.Classes.Ord Numeric.Interval.Exception.AmbiguousComparison instance GHC.Classes.Eq Numeric.Interval.Exception.AmbiguousComparison instance Data.Data.Data Numeric.Interval.Exception.EmptyInterval instance GHC.Classes.Ord Numeric.Interval.Exception.EmptyInterval instance GHC.Classes.Eq Numeric.Interval.Exception.EmptyInterval instance GHC.Show.Show Numeric.Interval.Exception.AmbiguousComparison instance GHC.Exception.Type.Exception Numeric.Interval.Exception.AmbiguousComparison instance GHC.Show.Show Numeric.Interval.Exception.EmptyInterval instance GHC.Exception.Type.Exception Numeric.Interval.Exception.EmptyInterval -- | Interval arithmetic module Numeric.Interval.Internal data Interval a I :: !a -> !a -> Interval a Empty :: Interval a (...) :: Ord a => a -> a -> Interval a infix 3 ... (+/-) :: (Num a, Ord a) => a -> a -> Interval a infixl 6 +/- interval :: Ord a => a -> a -> Maybe (Interval a) -- | The whole real number line -- --
--   >>> whole
--   -Infinity ... Infinity
--   
whole :: Fractional a => Interval a -- | An empty interval -- --
--   >>> empty
--   Empty
--   
empty :: Interval a -- | Check if an interval is empty -- --
--   >>> null (1 ... 5)
--   False
--   
-- --
--   >>> null (1 ... 1)
--   False
--   
-- --
--   >>> null empty
--   True
--   
null :: Interval a -> Bool -- | A singleton point -- --
--   >>> singleton 1
--   1 ... 1
--   
singleton :: a -> Interval a -- | Determine if a point is in the interval. -- --
--   >>> member 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> member 5 empty
--   False
--   
member :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notMember 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notMember 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notMember 5 empty
--   True
--   
notMember :: Ord a => a -> Interval a -> Bool -- | Determine if a point is in the interval. -- --
--   >>> elem 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> elem 5 empty
--   False
--   
-- | Deprecated: Use member instead. elem :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notElem 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notElem 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notElem 5 empty
--   True
--   
-- | Deprecated: Use notMember instead. notElem :: Ord a => a -> Interval a -> Bool -- | The infimum (lower bound) of an interval -- --
--   >>> inf (1.0 ... 20.0)
--   1.0
--   
-- --
--   >>> inf empty
--   *** Exception: empty interval
--   
inf :: Interval a -> a -- | The supremum (upper bound) of an interval -- --
--   >>> sup (1.0 ... 20.0)
--   20.0
--   
-- --
--   >>> sup empty
--   *** Exception: empty interval
--   
sup :: Interval a -> a -- | Is the interval a singleton point? N.B. This is fairly fragile and -- likely will not hold after even a few operations that only involve -- singletons -- --
--   >>> singular (singleton 1)
--   True
--   
-- --
--   >>> singular (1.0 ... 20.0)
--   False
--   
singular :: Ord a => Interval a -> Bool -- | Calculate the width of an interval. -- --
--   >>> width (1 ... 20)
--   19
--   
-- --
--   >>> width (singleton 1)
--   0
--   
-- --
--   >>> width empty
--   0
--   
width :: Num a => Interval a -> a -- | Nearest point to the midpoint of the interval. -- --
--   >>> midpoint (10.0 ... 20.0)
--   15.0
--   
-- --
--   >>> midpoint (singleton 5.0)
--   5.0
--   
-- --
--   >>> midpoint empty
--   *** Exception: empty interval
--   
midpoint :: Fractional a => Interval a -> a -- | Calculate the intersection of two intervals. -- --
--   >>> intersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   5.0 ... 10.0
--   
intersection :: Ord a => Interval a -> Interval a -> Interval a -- | Calculate the convex hull of two intervals -- --
--   >>> hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   0.0 ... 15.0
--   
-- --
--   >>> hull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double)
--   0.0 ... 85.0
--   
hull :: Ord a => Interval a -> Interval a -> Interval a -- | Bisect an interval at its midpoint. -- --
--   >>> bisect (10.0 ... 20.0)
--   (10.0 ... 15.0,15.0 ... 20.0)
--   
-- --
--   >>> bisect (singleton 5.0)
--   (5.0 ... 5.0,5.0 ... 5.0)
--   
-- --
--   >>> bisect Empty
--   (Empty,Empty)
--   
bisect :: Fractional a => Interval a -> (Interval a, Interval a) bisectIntegral :: Integral a => Interval a -> (Interval a, Interval a) -- | Magnitude -- --
--   >>> magnitude (1 ... 20)
--   20
--   
-- --
--   >>> magnitude (-20 ... 10)
--   20
--   
-- --
--   >>> magnitude (singleton 5)
--   5
--   
-- -- throws EmptyInterval if the interval is empty. -- --
--   >>> magnitude empty
--   *** Exception: empty interval
--   
magnitude :: (Num a, Ord a) => Interval a -> a -- | "mignitude" -- --
--   >>> mignitude (1 ... 20)
--   1
--   
-- --
--   >>> mignitude (-20 ... 10)
--   0
--   
-- --
--   >>> mignitude (singleton 5)
--   5
--   
-- -- throws EmptyInterval if the interval is empty. -- --
--   >>> mignitude empty
--   *** Exception: empty interval
--   
mignitude :: (Num a, Ord a) => Interval a -> a -- | Hausdorff distance between intervals. -- --
--   >>> distance (1 ... 7) (6 ... 10)
--   0
--   
-- --
--   >>> distance (1 ... 7) (15 ... 24)
--   8
--   
-- --
--   >>> distance (1 ... 7) (-10 ... -2)
--   3
--   
-- --
--   >>> distance Empty (1 ... 1)
--   *** Exception: empty interval
--   
distance :: (Num a, Ord a) => Interval a -> Interval a -> a -- | Inflate an interval by enlarging it at both ends. -- --
--   >>> inflate 3 (-1 ... 7)
--   -4 ... 10
--   
-- --
--   >>> inflate (-2) (0 ... 4)
--   -2 ... 6
--   
-- --
--   >>> inflate 1 empty
--   Empty
--   
inflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Deflate an interval by shrinking it from both ends. -- --
--   >>> deflate 3.0 (-4.0 ... 10.0)
--   -1.0 ... 7.0
--   
-- --
--   >>> deflate 2.0 (-1.0 ... 1.0)
--   Empty
--   
-- --
--   >>> deflate 1.0 empty
--   Empty
--   
deflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Scale an interval about its midpoint. -- --
--   >>> scale 1.1 (-6.0 ... 4.0)
--   -6.5 ... 4.5
--   
-- --
--   >>> scale (-2.0) (-1.0 ... 1.0)
--   Empty
--   
-- --
--   >>> scale 3.0 empty
--   Empty
--   
scale :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Construct a symmetric interval. -- --
--   >>> symmetric 3
--   -3 ... 3
--   
-- --
--   >>> symmetric (-2)
--   -2 ... 2
--   
symmetric :: (Num a, Ord a) => a -> Interval a -- | Check if interval X totally contains interval Y -- --
--   >>> (20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)
--   False
--   
contains :: Ord a => Interval a -> Interval a -> Bool -- | Flipped version of contains. Check if interval X a -- subset of interval Y -- --
--   >>> (25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)
--   False
--   
isSubsetOf :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- op y certainly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- < y -- --
--   >>> (5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)
--   False
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)
--   False
--   
( Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- <= y -- --
--   >>> (5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)
--   False
--   
(<=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- == y -- -- Only singleton intervals or empty intervals can return true -- --
--   >>> (singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)
--   False
--   
(==!) :: Eq a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- >= y -- --
--   >>> (20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)
--   False
--   
(>=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- > y -- --
--   >>> (20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)
--   False
--   
(>!) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x op y? possibly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x < y? ( Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x <= y? (<=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x == y? (==?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x >= y? (>=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x > y? (>?) :: Ord a => Interval a -> Interval a -> Bool -- | id function. Useful for type specification -- --
--   >>> :t idouble (1 ... 3)
--   idouble (1 ... 3) :: Interval Double
--   
idouble :: Interval Double -> Interval Double -- | id function. Useful for type specification -- --
--   >>> :t ifloat (1 ... 3)
--   ifloat (1 ... 3) :: Interval Float
--   
ifloat :: Interval Float -> Interval Float -- | an interval containing all x quot y >>> (5 quot -- 3) member ((4...6) iquot (2...4)) True >>> -- (1...10) iquot ((-5)...4) *** Exception: divide by zero iquot :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x rem y >>> (5 rem -- 3) member ((4...6) irem (2...4)) True >>> -- (1...10) irem ((-5)...4) *** Exception: divide by zero irem :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x div y >>> (5 div -- 3) member ((4...6) idiv (2...4)) True >>> -- (1...10) idiv ((-5)...4) *** Exception: divide by zero idiv :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x mod y >>> (5 mod -- 3) member ((4...6) imod (2...4)) True >>> -- (1...10) imod ((-5)...4) *** Exception: divide by zero imod :: Integral a => Interval a -> Interval a -> Interval a instance GHC.Generics.Generic1 Numeric.Interval.Internal.Interval instance GHC.Generics.Generic (Numeric.Interval.Internal.Interval a) instance Data.Data.Data a => Data.Data.Data (Numeric.Interval.Internal.Interval a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Numeric.Interval.Internal.Interval a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.Interval.Internal.Interval a) instance GHC.Show.Show a => GHC.Show.Show (Numeric.Interval.Internal.Interval a) instance (GHC.Num.Num a, GHC.Classes.Ord a) => GHC.Num.Num (Numeric.Interval.Internal.Interval a) instance GHC.Real.Real a => GHC.Real.Real (Numeric.Interval.Internal.Interval a) instance (GHC.Real.Fractional a, GHC.Classes.Ord a) => GHC.Real.Fractional (Numeric.Interval.Internal.Interval a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Numeric.Interval.Internal.Interval a) instance (GHC.Float.RealFloat a, GHC.Classes.Ord a) => GHC.Float.Floating (Numeric.Interval.Internal.Interval a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Numeric.Interval.Internal.Interval a) -- | Interval arithmetic module Numeric.Interval data Interval a (...) :: Ord a => a -> a -> Interval a infix 3 ... (+/-) :: (Num a, Ord a) => a -> a -> Interval a infixl 6 +/- interval :: Ord a => a -> a -> Maybe (Interval a) -- | The whole real number line -- --
--   >>> whole
--   -Infinity ... Infinity
--   
whole :: Fractional a => Interval a -- | An empty interval -- --
--   >>> empty
--   Empty
--   
empty :: Interval a -- | Check if an interval is empty -- --
--   >>> null (1 ... 5)
--   False
--   
-- --
--   >>> null (1 ... 1)
--   False
--   
-- --
--   >>> null empty
--   True
--   
null :: Interval a -> Bool -- | A singleton point -- --
--   >>> singleton 1
--   1 ... 1
--   
singleton :: a -> Interval a -- | Determine if a point is in the interval. -- --
--   >>> member 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> member 5 empty
--   False
--   
member :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notMember 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notMember 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notMember 5 empty
--   True
--   
notMember :: Ord a => a -> Interval a -> Bool -- | Determine if a point is in the interval. -- --
--   >>> elem 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> elem 5 empty
--   False
--   
-- | Deprecated: Use member instead. elem :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notElem 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notElem 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notElem 5 empty
--   True
--   
-- | Deprecated: Use notMember instead. notElem :: Ord a => a -> Interval a -> Bool -- | The infimum (lower bound) of an interval -- --
--   >>> inf (1.0 ... 20.0)
--   1.0
--   
-- --
--   >>> inf empty
--   *** Exception: empty interval
--   
inf :: Interval a -> a -- | The supremum (upper bound) of an interval -- --
--   >>> sup (1.0 ... 20.0)
--   20.0
--   
-- --
--   >>> sup empty
--   *** Exception: empty interval
--   
sup :: Interval a -> a -- | Is the interval a singleton point? N.B. This is fairly fragile and -- likely will not hold after even a few operations that only involve -- singletons -- --
--   >>> singular (singleton 1)
--   True
--   
-- --
--   >>> singular (1.0 ... 20.0)
--   False
--   
singular :: Ord a => Interval a -> Bool -- | Calculate the width of an interval. -- --
--   >>> width (1 ... 20)
--   19
--   
-- --
--   >>> width (singleton 1)
--   0
--   
-- --
--   >>> width empty
--   0
--   
width :: Num a => Interval a -> a -- | Nearest point to the midpoint of the interval. -- --
--   >>> midpoint (10.0 ... 20.0)
--   15.0
--   
-- --
--   >>> midpoint (singleton 5.0)
--   5.0
--   
-- --
--   >>> midpoint empty
--   *** Exception: empty interval
--   
midpoint :: Fractional a => Interval a -> a -- | Calculate the intersection of two intervals. -- --
--   >>> intersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   5.0 ... 10.0
--   
intersection :: Ord a => Interval a -> Interval a -> Interval a -- | Calculate the convex hull of two intervals -- --
--   >>> hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   0.0 ... 15.0
--   
-- --
--   >>> hull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double)
--   0.0 ... 85.0
--   
hull :: Ord a => Interval a -> Interval a -> Interval a -- | Bisect an interval at its midpoint. -- --
--   >>> bisect (10.0 ... 20.0)
--   (10.0 ... 15.0,15.0 ... 20.0)
--   
-- --
--   >>> bisect (singleton 5.0)
--   (5.0 ... 5.0,5.0 ... 5.0)
--   
-- --
--   >>> bisect Empty
--   (Empty,Empty)
--   
bisect :: Fractional a => Interval a -> (Interval a, Interval a) bisectIntegral :: Integral a => Interval a -> (Interval a, Interval a) -- | Magnitude -- --
--   >>> magnitude (1 ... 20)
--   20
--   
-- --
--   >>> magnitude (-20 ... 10)
--   20
--   
-- --
--   >>> magnitude (singleton 5)
--   5
--   
-- -- throws EmptyInterval if the interval is empty. -- --
--   >>> magnitude empty
--   *** Exception: empty interval
--   
magnitude :: (Num a, Ord a) => Interval a -> a -- | "mignitude" -- --
--   >>> mignitude (1 ... 20)
--   1
--   
-- --
--   >>> mignitude (-20 ... 10)
--   0
--   
-- --
--   >>> mignitude (singleton 5)
--   5
--   
-- -- throws EmptyInterval if the interval is empty. -- --
--   >>> mignitude empty
--   *** Exception: empty interval
--   
mignitude :: (Num a, Ord a) => Interval a -> a -- | Hausdorff distance between intervals. -- --
--   >>> distance (1 ... 7) (6 ... 10)
--   0
--   
-- --
--   >>> distance (1 ... 7) (15 ... 24)
--   8
--   
-- --
--   >>> distance (1 ... 7) (-10 ... -2)
--   3
--   
-- --
--   >>> distance Empty (1 ... 1)
--   *** Exception: empty interval
--   
distance :: (Num a, Ord a) => Interval a -> Interval a -> a -- | Inflate an interval by enlarging it at both ends. -- --
--   >>> inflate 3 (-1 ... 7)
--   -4 ... 10
--   
-- --
--   >>> inflate (-2) (0 ... 4)
--   -2 ... 6
--   
-- --
--   >>> inflate 1 empty
--   Empty
--   
inflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Deflate an interval by shrinking it from both ends. -- --
--   >>> deflate 3.0 (-4.0 ... 10.0)
--   -1.0 ... 7.0
--   
-- --
--   >>> deflate 2.0 (-1.0 ... 1.0)
--   Empty
--   
-- --
--   >>> deflate 1.0 empty
--   Empty
--   
deflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Scale an interval about its midpoint. -- --
--   >>> scale 1.1 (-6.0 ... 4.0)
--   -6.5 ... 4.5
--   
-- --
--   >>> scale (-2.0) (-1.0 ... 1.0)
--   Empty
--   
-- --
--   >>> scale 3.0 empty
--   Empty
--   
scale :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Construct a symmetric interval. -- --
--   >>> symmetric 3
--   -3 ... 3
--   
-- --
--   >>> symmetric (-2)
--   -2 ... 2
--   
symmetric :: (Num a, Ord a) => a -> Interval a -- | Check if interval X totally contains interval Y -- --
--   >>> (20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)
--   False
--   
contains :: Ord a => Interval a -> Interval a -> Bool -- | Flipped version of contains. Check if interval X a -- subset of interval Y -- --
--   >>> (25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)
--   False
--   
isSubsetOf :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- op y certainly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- < y -- --
--   >>> (5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)
--   False
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)
--   False
--   
( Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- <= y -- --
--   >>> (5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)
--   False
--   
(<=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- == y -- -- Only singleton intervals or empty intervals can return true -- --
--   >>> (singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)
--   False
--   
(==!) :: Eq a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- >= y -- --
--   >>> (20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)
--   False
--   
(>=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- > y -- --
--   >>> (20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)
--   False
--   
(>!) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x op y? possibly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x < y? ( Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x <= y? (<=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x == y? (==?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x >= y? (>=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x > y? (>?) :: Ord a => Interval a -> Interval a -> Bool -- | id function. Useful for type specification -- --
--   >>> :t idouble (1 ... 3)
--   idouble (1 ... 3) :: Interval Double
--   
idouble :: Interval Double -> Interval Double -- | id function. Useful for type specification -- --
--   >>> :t ifloat (1 ... 3)
--   ifloat (1 ... 3) :: Interval Float
--   
ifloat :: Interval Float -> Interval Float -- | an interval containing all x quot y >>> (5 quot -- 3) member ((4...6) iquot (2...4)) True >>> -- (1...10) iquot ((-5)...4) *** Exception: divide by zero iquot :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x rem y >>> (5 rem -- 3) member ((4...6) irem (2...4)) True >>> -- (1...10) irem ((-5)...4) *** Exception: divide by zero irem :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x div y >>> (5 div -- 3) member ((4...6) idiv (2...4)) True >>> -- (1...10) idiv ((-5)...4) *** Exception: divide by zero idiv :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x mod y >>> (5 mod -- 3) member ((4...6) imod (2...4)) True >>> -- (1...10) imod ((-5)...4) *** Exception: divide by zero imod :: Integral a => Interval a -> Interval a -> Interval a -- | "Directed" Interval arithmetic module Numeric.Interval.Kaucher data Interval a I :: !a -> !a -> Interval a -- | Create a directed interval. (...) :: a -> a -> Interval a infix 3 ... -- | Try to create a non-empty interval. interval :: Ord a => a -> a -> Maybe (Interval a) -- | The whole real number line -- --
--   >>> whole
--   -Infinity ... Infinity
--   
whole :: Fractional a => Interval a -- | An empty interval -- --
--   >>> empty
--   NaN ... NaN
--   
empty :: Fractional a => Interval a -- | negation handles NaN properly -- --
--   >>> null (1 ... 5)
--   False
--   
-- --
--   >>> null (1 ... 1)
--   False
--   
-- --
--   >>> null empty
--   True
--   
null :: Ord a => Interval a -> Bool -- | A singleton point -- --
--   >>> singleton 1
--   1 ... 1
--   
singleton :: a -> Interval a -- | Determine if a point is in the interval. -- --
--   >>> member 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> member 5 empty
--   False
--   
member :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notMember 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notMember 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notMember 5 empty
--   True
--   
notMember :: Ord a => a -> Interval a -> Bool -- | Determine if a point is in the interval. -- --
--   >>> elem 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 8 (1.0 ... 5.0)
--   False
--   
-- --
--   >>> elem 5 empty
--   False
--   
-- | Deprecated: Use member instead. elem :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notElem 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notElem 1.4 (1.0 ... 5.0)
--   False
--   
-- -- And of course, nothing is a member of the empty interval. -- --
--   >>> notElem 5 empty
--   True
--   
-- | Deprecated: Use notMember instead. notElem :: Ord a => a -> Interval a -> Bool -- | The infinumum (lower bound) of an interval -- --
--   >>> inf (1 ... 20)
--   1
--   
inf :: Interval a -> a -- | The supremum (upper bound) of an interval -- --
--   >>> sup (1 ... 20)
--   20
--   
sup :: Interval a -> a -- | Is the interval a singleton point? N.B. This is fairly fragile and -- likely will not hold after even a few operations that only involve -- singletons -- --
--   >>> singular (singleton 1)
--   True
--   
-- --
--   >>> singular (1.0 ... 20.0)
--   False
--   
singular :: Ord a => Interval a -> Bool -- | Calculate the width of an interval. -- --
--   >>> width (1 ... 20)
--   19
--   
-- --
--   >>> width (singleton 1)
--   0
--   
-- --
--   >>> width empty
--   NaN
--   
width :: Num a => Interval a -> a -- | Nearest point to the midpoint of the interval. -- --
--   >>> midpoint (10.0 ... 20.0)
--   15.0
--   
-- --
--   >>> midpoint (singleton 5.0)
--   5.0
--   
-- --
--   >>> midpoint empty
--   NaN
--   
midpoint :: Fractional a => Interval a -> a -- | Calculate the intersection of two intervals. -- --
--   >>> intersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   5.0 ... 10.0
--   
intersection :: (Fractional a, Ord a) => Interval a -> Interval a -> Interval a -- | Calculate the convex hull of two intervals -- --
--   >>> hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   0.0 ... 15.0
--   
-- --
--   >>> hull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double)
--   0.0 ... 85.0
--   
hull :: Ord a => Interval a -> Interval a -> Interval a -- | Bisect an interval at its midpoint. -- --
--   >>> bisect (10.0 ... 20.0)
--   (10.0 ... 15.0,15.0 ... 20.0)
--   
-- --
--   >>> bisect (singleton 5.0)
--   (5.0 ... 5.0,5.0 ... 5.0)
--   
-- --
--   >>> bisect empty
--   (NaN ... NaN,NaN ... NaN)
--   
bisect :: Fractional a => Interval a -> (Interval a, Interval a) -- | Magnitude -- --
--   >>> magnitude (1 ... 20)
--   20
--   
-- --
--   >>> magnitude (-20 ... 10)
--   20
--   
-- --
--   >>> magnitude (singleton 5)
--   5
--   
magnitude :: (Num a, Ord a) => Interval a -> a -- | "mignitude" -- --
--   >>> mignitude (1 ... 20)
--   1
--   
-- --
--   >>> mignitude (-20 ... 10)
--   0
--   
-- --
--   >>> mignitude (singleton 5)
--   5
--   
-- --
--   >>> mignitude empty
--   NaN
--   
mignitude :: (Num a, Ord a) => Interval a -> a -- | Hausdorff distance between non-empty intervals. -- --
--   >>> distance (1 ... 7) (6 ... 10)
--   0
--   
-- --
--   >>> distance (1 ... 7) (15 ... 24)
--   8
--   
-- --
--   >>> distance (1 ... 7) (-10 ... -2)
--   3
--   
-- --
--   >>> distance empty (1 ... 1)
--   NaN
--   
distance :: (Num a, Ord a) => Interval a -> Interval a -> a -- | Inflate an interval by enlarging it at both ends. -- --
--   >>> inflate 3 (-1 ... 7)
--   -4 ... 10
--   
-- --
--   >>> inflate (-2) (0 ... 4)
--   2 ... 2
--   
inflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Deflate an interval by shrinking it from both ends. -- --
--   >>> deflate 3.0 (-4.0 ... 10.0)
--   -1.0 ... 7.0
--   
-- --
--   >>> deflate 2.0 (-1.0 ... 1.0)
--   1.0 ... -1.0
--   
deflate :: Fractional a => a -> Interval a -> Interval a -- | Scale an interval about its midpoint. -- --
--   >>> scale 1.1 (-6.0 ... 4.0)
--   -6.5 ... 4.5
--   
-- --
--   >>> scale (-2.0) (-1.0 ... 1.0)
--   2.0 ... -2.0
--   
scale :: Fractional a => a -> Interval a -> Interval a -- | Construct a symmetric interval. -- --
--   >>> symmetric 3
--   -3 ... 3
--   
-- --
--   >>> symmetric (-2)
--   2 ... -2
--   
symmetric :: Num a => a -> Interval a -- | Check if interval X totally contains interval Y -- --
--   >>> (20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)
--   False
--   
contains :: Ord a => Interval a -> Interval a -> Bool -- | Flipped version of contains. Check if interval X a -- subset of interval Y -- --
--   >>> (25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)
--   False
--   
isSubsetOf :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- op y certainly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- < y -- --
--   >>> (5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)
--   False
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)
--   False
--   
( Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- <= y -- --
--   >>> (5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)
--   False
--   
(<=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- == y -- -- Only singleton intervals return true -- --
--   >>> (singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)
--   False
--   
(==!) :: Eq a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- >= y -- --
--   >>> (20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)
--   False
--   
(>=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- > y -- --
--   >>> (20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)
--   False
--   
(>!) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x op y? possibly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x < y? ( Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x <= y? (<=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x == y? (==?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x >= y? (>=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x > y? (>?) :: Ord a => Interval a -> Interval a -> Bool -- | The nearest value to that supplied which is contained in the interval. clamp :: Ord a => Interval a -> a -> a -- | id function. Useful for type specification -- --
--   >>> :t idouble (1 ... 3)
--   idouble (1 ... 3) :: Interval Double
--   
idouble :: Interval Double -> Interval Double -- | id function. Useful for type specification -- --
--   >>> :t ifloat (1 ... 3)
--   ifloat (1 ... 3) :: Interval Float
--   
ifloat :: Interval Float -> Interval Float -- | an interval containing all x quot y >>> (5 quot -- 3) member ((4...6) iquot (2...4)) True >>> -- (1...10) iquot ((-5)...4) *** Exception: divide by zero iquot :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x rem y >>> (5 rem -- 3) member ((4...6) irem (2...4)) True >>> -- (1...10) irem ((-5)...4) *** Exception: divide by zero irem :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x div y >>> (5 div -- 3) member ((4...6) idiv (2...4)) True >>> -- (1...10) idiv ((-5)...4) *** Exception: divide by zero idiv :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x mod y >>> (5 mod -- 3) member ((4...6) imod (2...4)) True >>> -- (1...10) imod ((-5)...4) *** Exception: divide by zero imod :: Integral a => Interval a -> Interval a -> Interval a instance GHC.Generics.Generic1 Numeric.Interval.Kaucher.Interval instance GHC.Generics.Generic (Numeric.Interval.Kaucher.Interval a) instance Data.Data.Data a => Data.Data.Data (Numeric.Interval.Kaucher.Interval a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Numeric.Interval.Kaucher.Interval a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.Interval.Kaucher.Interval a) instance GHC.Base.Functor Numeric.Interval.Kaucher.Interval instance Data.Foldable.Foldable Numeric.Interval.Kaucher.Interval instance Data.Traversable.Traversable Numeric.Interval.Kaucher.Interval instance GHC.Base.Applicative Numeric.Interval.Kaucher.Interval instance GHC.Base.Monad Numeric.Interval.Kaucher.Interval instance Data.Distributive.Distributive Numeric.Interval.Kaucher.Interval instance GHC.Show.Show a => GHC.Show.Show (Numeric.Interval.Kaucher.Interval a) instance (GHC.Num.Num a, GHC.Classes.Ord a) => GHC.Num.Num (Numeric.Interval.Kaucher.Interval a) instance GHC.Real.Real a => GHC.Real.Real (Numeric.Interval.Kaucher.Interval a) instance (GHC.Real.Fractional a, GHC.Classes.Ord a) => GHC.Real.Fractional (Numeric.Interval.Kaucher.Interval a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Numeric.Interval.Kaucher.Interval a) instance (GHC.Float.RealFloat a, GHC.Classes.Ord a) => GHC.Float.Floating (Numeric.Interval.Kaucher.Interval a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Numeric.Interval.Kaucher.Interval a) -- | Interval arithmetic module Numeric.Interval.NonEmpty.Internal data Interval a I :: !a -> !a -> Interval a -- | Create a non-empty interval, turning it around if necessary (...) :: Ord a => a -> a -> Interval a infix 3 ... -- | Try to create a non-empty interval. interval :: Ord a => a -> a -> Maybe (Interval a) -- | The whole real number line -- --
--   >>> whole
--   -Infinity ... Infinity
--   
-- --
--   (x :: Double) `elem` whole
--   
whole :: Fractional a => Interval a -- | A singleton point -- --
--   >>> singleton 1
--   1 ... 1
--   
-- --
--   x `elem` (singleton x)
--   
-- --
--   x /= y ==> y `notElem` (singleton x)
--   
singleton :: a -> Interval a -- | Determine if a point is in the interval. -- --
--   >>> member 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 8 (1.0 ... 5.0)
--   False
--   
member :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notMember 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notMember 1.4 (1.0 ... 5.0)
--   False
--   
notMember :: Ord a => a -> Interval a -> Bool -- | Determine if a point is in the interval. -- --
--   >>> elem 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 8 (1.0 ... 5.0)
--   False
--   
-- | Deprecated: Use member instead. elem :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notElem 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notElem 1.4 (1.0 ... 5.0)
--   False
--   
-- | Deprecated: Use notMember instead. notElem :: Ord a => a -> Interval a -> Bool -- | The infinumum (lower bound) of an interval -- --
--   >>> inf (1 ... 20)
--   1
--   
-- --
--   min x y == inf (x ... y)
--   
-- --
--   inf x <= sup x
--   
inf :: Interval a -> a -- | The supremum (upper bound) of an interval -- --
--   >>> sup (1 ... 20)
--   20
--   
-- --
--   sup x `elem` x
--   
-- --
--   max x y == sup (x ... y)
--   
-- --
--   inf x <= sup x
--   
sup :: Interval a -> a -- | Is the interval a singleton point? N.B. This is fairly fragile and -- likely will not hold after even a few operations that only involve -- singletons -- --
--   >>> singular (singleton 1)
--   True
--   
-- --
--   >>> singular (1.0 ... 20.0)
--   False
--   
singular :: Ord a => Interval a -> Bool -- | Calculate the width of an interval. -- --
--   >>> width (1 ... 20)
--   19
--   
-- --
--   >>> width (singleton 1)
--   0
--   
-- --
--   0 <= width x
--   
width :: Num a => Interval a -> a -- | Nearest point to the midpoint of the interval. -- --
--   >>> midpoint (10.0 ... 20.0)
--   15.0
--   
-- --
--   >>> midpoint (singleton 5.0)
--   5.0
--   
-- --
--   midpoint x `elem` (x :: Interval Double)
--   
midpoint :: Fractional a => Interval a -> a -- | Hausdorff distance between intervals. -- --
--   >>> distance (1 ... 7) (6 ... 10)
--   0
--   
-- --
--   >>> distance (1 ... 7) (15 ... 24)
--   8
--   
-- --
--   >>> distance (1 ... 7) (-10 ... -2)
--   3
--   
-- --
--   commutative (distance :: Interval Double -> Interval Double -> Double)
--   
-- --
--   0 <= distance x y
--   
distance :: (Num a, Ord a) => Interval a -> Interval a -> a -- | Calculate the intersection of two intervals. -- --
--   >>> intersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   Just (5.0 ... 10.0)
--   
intersection :: Ord a => Interval a -> Interval a -> Maybe (Interval a) -- | Calculate the convex hull of two intervals -- --
--   >>> hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   0.0 ... 15.0
--   
-- --
--   >>> hull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double)
--   0.0 ... 85.0
--   
-- --
--   conservative2 const hull
--   
-- --
--   conservative2 (flip const) hull
--   
hull :: Ord a => Interval a -> Interval a -> Interval a -- | Bisect an interval at its midpoint. -- --
--   >>> bisect (10.0 ... 20.0)
--   (10.0 ... 15.0,15.0 ... 20.0)
--   
-- --
--   >>> bisect (singleton 5.0)
--   (5.0 ... 5.0,5.0 ... 5.0)
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in sup a == inf b
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in inf a == inf x
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in sup b == sup x
--   
bisect :: Fractional a => Interval a -> (Interval a, Interval a) bisectIntegral :: Integral a => Interval a -> (Interval a, Interval a) -- | Magnitude -- --
--   >>> magnitude (1 ... 20)
--   20
--   
-- --
--   >>> magnitude (-20 ... 10)
--   20
--   
-- --
--   >>> magnitude (singleton 5)
--   5
--   
-- --
--   0 <= magnitude x
--   
magnitude :: (Num a, Ord a) => Interval a -> a -- | "mignitude" -- --
--   >>> mignitude (1 ... 20)
--   1
--   
-- --
--   >>> mignitude (-20 ... 10)
--   0
--   
-- --
--   >>> mignitude (singleton 5)
--   5
--   
-- --
--   0 <= mignitude x
--   
mignitude :: (Num a, Ord a) => Interval a -> a -- | Check if interval X totally contains interval Y -- --
--   >>> (20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)
--   False
--   
contains :: Ord a => Interval a -> Interval a -> Bool -- | Flipped version of contains. Check if interval X a -- subset of interval Y -- --
--   >>> (25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)
--   False
--   
isSubsetOf :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- op y certainly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- < y -- --
--   >>> (5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)
--   False
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)
--   False
--   
( Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- <= y -- --
--   >>> (5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)
--   False
--   
(<=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- == y -- -- Only singleton intervals or empty intervals can return true -- --
--   >>> (singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)
--   False
--   
(==!) :: Eq a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- >= y -- --
--   >>> (20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)
--   False
--   
(>=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- > y -- --
--   >>> (20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)
--   False
--   
(>!) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x op y? possibly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x < y? ( Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x <= y? (<=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x == y? (==?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x >= y? (>=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x > y? (>?) :: Ord a => Interval a -> Interval a -> Bool -- | The nearest value to that supplied which is contained in the interval. -- --
--   (clamp xs y) `elem` xs
--   
clamp :: Ord a => Interval a -> a -> a -- | Inflate an interval by enlarging it at both ends. -- --
--   >>> inflate 3 (-1 ... 7)
--   -4 ... 10
--   
-- --
--   >>> inflate (-2) (0 ... 4)
--   -2 ... 6
--   
-- --
--   inflate x i `contains` i
--   
inflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Deflate an interval by shrinking it from both ends. Note that in cases -- that would result in an empty interval, the result is a singleton -- interval at the midpoint. -- --
--   >>> deflate 3.0 (-4.0 ... 10.0)
--   -1.0 ... 7.0
--   
-- --
--   >>> deflate 2.0 (-1.0 ... 1.0)
--   0.0 ... 0.0
--   
deflate :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Scale an interval about its midpoint. -- --
--   >>> scale 1.1 (-6.0 ... 4.0)
--   -6.5 ... 4.5
--   
-- --
--   >>> scale (-2.0) (-1.0 ... 1.0)
--   -2.0 ... 2.0
--   
-- --
--   abs x >= 1 ==> (scale (x :: Double) i) `contains` i
--   
-- --
--   forAll (choose (0,1)) $ \x -> abs x <= 1 ==> i `contains` (scale (x :: Double) i)
--   
scale :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Construct a symmetric interval. -- --
--   >>> symmetric 3
--   -3 ... 3
--   
-- --
--   >>> symmetric (-2)
--   -2 ... 2
--   
-- --
--   x `elem` symmetric x
--   
-- --
--   0 `elem` symmetric x
--   
symmetric :: (Num a, Ord a) => a -> Interval a -- | id function. Useful for type specification -- --
--   >>> :t idouble (1 ... 3)
--   idouble (1 ... 3) :: Interval Double
--   
idouble :: Interval Double -> Interval Double -- | id function. Useful for type specification -- --
--   >>> :t ifloat (1 ... 3)
--   ifloat (1 ... 3) :: Interval Float
--   
ifloat :: Interval Float -> Interval Float -- | an interval containing all x quot y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x quot y) member (xs iquot ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- iquot ys)); return $ z === Left DivideByZero iquot :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x rem y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x rem y) member (xs irem ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- irem ys)); return $ z === Left DivideByZero irem :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x div y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x div y) member (xs idiv ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- idiv ys)); return $ z === Left DivideByZero idiv :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x mod y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x mod y) member (xs imod ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- imod ys)); return $ z === Left DivideByZero imod :: Integral a => Interval a -> Interval a -> Interval a instance GHC.Generics.Generic1 Numeric.Interval.NonEmpty.Internal.Interval instance GHC.Generics.Generic (Numeric.Interval.NonEmpty.Internal.Interval a) instance Data.Data.Data a => Data.Data.Data (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Show.Show a => GHC.Show.Show (Numeric.Interval.NonEmpty.Internal.Interval a) instance (GHC.Num.Num a, GHC.Classes.Ord a) => GHC.Num.Num (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Real.Real a => GHC.Real.Real (Numeric.Interval.NonEmpty.Internal.Interval a) instance (GHC.Real.Fractional a, GHC.Classes.Ord a) => GHC.Real.Fractional (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Numeric.Interval.NonEmpty.Internal.Interval a) instance (GHC.Float.RealFloat a, GHC.Classes.Ord a) => GHC.Float.Floating (Numeric.Interval.NonEmpty.Internal.Interval a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Numeric.Interval.NonEmpty.Internal.Interval a) -- | Interval arithmetic module Numeric.Interval.NonEmpty data Interval a -- | Create a non-empty interval, turning it around if necessary (...) :: Ord a => a -> a -> Interval a infix 3 ... -- | Try to create a non-empty interval. interval :: Ord a => a -> a -> Maybe (Interval a) -- | The whole real number line -- --
--   >>> whole
--   -Infinity ... Infinity
--   
-- --
--   (x :: Double) `elem` whole
--   
whole :: Fractional a => Interval a -- | A singleton point -- --
--   >>> singleton 1
--   1 ... 1
--   
-- --
--   x `elem` (singleton x)
--   
-- --
--   x /= y ==> y `notElem` (singleton x)
--   
singleton :: a -> Interval a -- | Determine if a point is in the interval. -- --
--   >>> member 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> member 8 (1.0 ... 5.0)
--   False
--   
member :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notMember 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notMember 1.4 (1.0 ... 5.0)
--   False
--   
notMember :: Ord a => a -> Interval a -> Bool -- | Determine if a point is in the interval. -- --
--   >>> elem 3.2 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 5 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 1 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> elem 8 (1.0 ... 5.0)
--   False
--   
-- | Deprecated: Use member instead. elem :: Ord a => a -> Interval a -> Bool -- | Determine if a point is not included in the interval -- --
--   >>> notElem 8 (1.0 ... 5.0)
--   True
--   
-- --
--   >>> notElem 1.4 (1.0 ... 5.0)
--   False
--   
-- | Deprecated: Use notMember instead. notElem :: Ord a => a -> Interval a -> Bool -- | The infinumum (lower bound) of an interval -- --
--   >>> inf (1 ... 20)
--   1
--   
-- --
--   min x y == inf (x ... y)
--   
-- --
--   inf x <= sup x
--   
inf :: Interval a -> a -- | The supremum (upper bound) of an interval -- --
--   >>> sup (1 ... 20)
--   20
--   
-- --
--   sup x `elem` x
--   
-- --
--   max x y == sup (x ... y)
--   
-- --
--   inf x <= sup x
--   
sup :: Interval a -> a -- | Is the interval a singleton point? N.B. This is fairly fragile and -- likely will not hold after even a few operations that only involve -- singletons -- --
--   >>> singular (singleton 1)
--   True
--   
-- --
--   >>> singular (1.0 ... 20.0)
--   False
--   
singular :: Ord a => Interval a -> Bool -- | Calculate the width of an interval. -- --
--   >>> width (1 ... 20)
--   19
--   
-- --
--   >>> width (singleton 1)
--   0
--   
-- --
--   0 <= width x
--   
width :: Num a => Interval a -> a -- | Nearest point to the midpoint of the interval. -- --
--   >>> midpoint (10.0 ... 20.0)
--   15.0
--   
-- --
--   >>> midpoint (singleton 5.0)
--   5.0
--   
-- --
--   midpoint x `elem` (x :: Interval Double)
--   
midpoint :: Fractional a => Interval a -> a -- | Hausdorff distance between intervals. -- --
--   >>> distance (1 ... 7) (6 ... 10)
--   0
--   
-- --
--   >>> distance (1 ... 7) (15 ... 24)
--   8
--   
-- --
--   >>> distance (1 ... 7) (-10 ... -2)
--   3
--   
-- --
--   commutative (distance :: Interval Double -> Interval Double -> Double)
--   
-- --
--   0 <= distance x y
--   
distance :: (Num a, Ord a) => Interval a -> Interval a -> a -- | Calculate the intersection of two intervals. -- --
--   >>> intersection (1 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   Just (5.0 ... 10.0)
--   
intersection :: Ord a => Interval a -> Interval a -> Maybe (Interval a) -- | Calculate the convex hull of two intervals -- --
--   >>> hull (0 ... 10 :: Interval Double) (5 ... 15 :: Interval Double)
--   0.0 ... 15.0
--   
-- --
--   >>> hull (15 ... 85 :: Interval Double) (0 ... 10 :: Interval Double)
--   0.0 ... 85.0
--   
-- --
--   conservative2 const hull
--   
-- --
--   conservative2 (flip const) hull
--   
hull :: Ord a => Interval a -> Interval a -> Interval a -- | Bisect an interval at its midpoint. -- --
--   >>> bisect (10.0 ... 20.0)
--   (10.0 ... 15.0,15.0 ... 20.0)
--   
-- --
--   >>> bisect (singleton 5.0)
--   (5.0 ... 5.0,5.0 ... 5.0)
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in sup a == inf b
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in inf a == inf x
--   
-- --
--   let (a, b) = bisect (x :: Interval Double) in sup b == sup x
--   
bisect :: Fractional a => Interval a -> (Interval a, Interval a) bisectIntegral :: Integral a => Interval a -> (Interval a, Interval a) -- | Magnitude -- --
--   >>> magnitude (1 ... 20)
--   20
--   
-- --
--   >>> magnitude (-20 ... 10)
--   20
--   
-- --
--   >>> magnitude (singleton 5)
--   5
--   
-- --
--   0 <= magnitude x
--   
magnitude :: (Num a, Ord a) => Interval a -> a -- | "mignitude" -- --
--   >>> mignitude (1 ... 20)
--   1
--   
-- --
--   >>> mignitude (-20 ... 10)
--   0
--   
-- --
--   >>> mignitude (singleton 5)
--   5
--   
-- --
--   0 <= mignitude x
--   
mignitude :: (Num a, Ord a) => Interval a -> a -- | Check if interval X totally contains interval Y -- --
--   >>> (20 ... 40 :: Interval Double) `contains` (25 ... 35 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `contains` (15 ... 35 :: Interval Double)
--   False
--   
contains :: Ord a => Interval a -> Interval a -> Bool -- | Flipped version of contains. Check if interval X a -- subset of interval Y -- --
--   >>> (25 ... 35 :: Interval Double) `isSubsetOf` (20 ... 40 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 40 :: Interval Double) `isSubsetOf` (15 ... 35 :: Interval Double)
--   False
--   
isSubsetOf :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- op y certainly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- < y -- --
--   >>> (5 ... 10 :: Interval Double) <! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <! (10 ... 30 :: Interval Double)
--   False
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <! (5 ... 10 :: Interval Double)
--   False
--   
( Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- <= y -- --
--   >>> (5 ... 10 :: Interval Double) <=! (20 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) <=! (10 ... 30 :: Interval Double)
--   True
--   
-- --
--   >>> (20 ... 30 :: Interval Double) <=! (5 ... 10 :: Interval Double)
--   False
--   
(<=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- == y -- -- Only singleton intervals or empty intervals can return true -- --
--   >>> (singleton 5 :: Interval Double) ==! (singleton 5 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 10 :: Interval Double) ==! (5 ... 10 :: Interval Double)
--   False
--   
(==!) :: Eq a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- >= y -- --
--   >>> (20 ... 40 :: Interval Double) >=! (10 ... 20 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >=! (15 ... 40 :: Interval Double)
--   False
--   
(>=!) :: Ord a => Interval a -> Interval a -> Bool -- | For all x in X, y in Y. x -- > y -- --
--   >>> (20 ... 40 :: Interval Double) >! (10 ... 19 :: Interval Double)
--   True
--   
-- --
--   >>> (5 ... 20 :: Interval Double) >! (15 ... 40 :: Interval Double)
--   False
--   
(>!) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x op y? possibly :: Ord a => (forall b. Ord b => b -> b -> Bool) -> Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x < y? ( Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x <= y? (<=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x == y? (==?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x >= y? (>=?) :: Ord a => Interval a -> Interval a -> Bool -- | Does there exist an x in X, y in Y -- such that x > y? (>?) :: Ord a => Interval a -> Interval a -> Bool -- | The nearest value to that supplied which is contained in the interval. -- --
--   (clamp xs y) `elem` xs
--   
clamp :: Ord a => Interval a -> a -> a -- | Inflate an interval by enlarging it at both ends. -- --
--   >>> inflate 3 (-1 ... 7)
--   -4 ... 10
--   
-- --
--   >>> inflate (-2) (0 ... 4)
--   -2 ... 6
--   
-- --
--   inflate x i `contains` i
--   
inflate :: (Num a, Ord a) => a -> Interval a -> Interval a -- | Deflate an interval by shrinking it from both ends. Note that in cases -- that would result in an empty interval, the result is a singleton -- interval at the midpoint. -- --
--   >>> deflate 3.0 (-4.0 ... 10.0)
--   -1.0 ... 7.0
--   
-- --
--   >>> deflate 2.0 (-1.0 ... 1.0)
--   0.0 ... 0.0
--   
deflate :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Scale an interval about its midpoint. -- --
--   >>> scale 1.1 (-6.0 ... 4.0)
--   -6.5 ... 4.5
--   
-- --
--   >>> scale (-2.0) (-1.0 ... 1.0)
--   -2.0 ... 2.0
--   
-- --
--   abs x >= 1 ==> (scale (x :: Double) i) `contains` i
--   
-- --
--   forAll (choose (0,1)) $ \x -> abs x <= 1 ==> i `contains` (scale (x :: Double) i)
--   
scale :: (Fractional a, Ord a) => a -> Interval a -> Interval a -- | Construct a symmetric interval. -- --
--   >>> symmetric 3
--   -3 ... 3
--   
-- --
--   >>> symmetric (-2)
--   -2 ... 2
--   
-- --
--   x `elem` symmetric x
--   
-- --
--   0 `elem` symmetric x
--   
symmetric :: (Num a, Ord a) => a -> Interval a -- | id function. Useful for type specification -- --
--   >>> :t idouble (1 ... 3)
--   idouble (1 ... 3) :: Interval Double
--   
idouble :: Interval Double -> Interval Double -- | id function. Useful for type specification -- --
--   >>> :t ifloat (1 ... 3)
--   ifloat (1 ... 3) :: Interval Float
--   
ifloat :: Interval Float -> Interval Float -- | an interval containing all x quot y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x quot y) member (xs iquot ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- iquot ys)); return $ z === Left DivideByZero iquot :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x rem y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x rem y) member (xs irem ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- irem ys)); return $ z === Left DivideByZero irem :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x div y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x div y) member (xs idiv ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- idiv ys)); return $ z === Left DivideByZero idiv :: Integral a => Interval a -> Interval a -> Interval a -- | an interval containing all x mod y prop> forAll (memberOf -- xs) $ x -> forAll (memberOf ys) $ y -> 0 notMember ys -- ==> (x mod y) member (xs imod ys) prop> 0 -- member ys ==> ioProperty $ do z <- try (evaluate (xs -- imod ys)); return $ z === Left DivideByZero imod :: Integral a => Interval a -> Interval a -> Interval a