module AERN2.MP.Float
(
module Precision
, module Auxi
, module Type
, module Arithmetic
, distUp, distDown, avgUp, avgDown
, module Conversions
, module Operators
, module Tests
)
where
import MixedTypesNumPrelude
import AERN2.MP.Precision as Precision
import AERN2.MP.Float.Auxi as Auxi
import AERN2.MP.Float.Type as Type
import AERN2.MP.Float.Arithmetic as Arithmetic
import AERN2.MP.Float.Conversions as Conversions
import AERN2.MP.Float.Operators as Operators
import AERN2.MP.Float.Tests as Tests
distUp :: MPFloat -> MPFloat -> MPFloat
distUp :: MPFloat -> MPFloat -> MPFloat
distUp MPFloat
x MPFloat
y = if MPFloat
x MPFloat -> MPFloat -> OrderCompareType MPFloat MPFloat
forall a b.
HasOrderAsymmetric a b =>
a -> b -> OrderCompareType a b
>= MPFloat
y then MPFloat
x MPFloat -> MPFloat -> MPFloat
-^ MPFloat
y else MPFloat
y MPFloat -> MPFloat -> MPFloat
-^ MPFloat
x
distDown :: MPFloat -> MPFloat -> MPFloat
distDown :: MPFloat -> MPFloat -> MPFloat
distDown MPFloat
x MPFloat
y = if MPFloat
x MPFloat -> MPFloat -> OrderCompareType MPFloat MPFloat
forall a b.
HasOrderAsymmetric a b =>
a -> b -> OrderCompareType a b
>= MPFloat
y then MPFloat
x MPFloat -> MPFloat -> MPFloat
-. MPFloat
y else MPFloat
y MPFloat -> MPFloat -> MPFloat
-. MPFloat
x
avgUp :: MPFloat -> MPFloat -> MPFloat
avgUp :: MPFloat -> MPFloat -> MPFloat
avgUp MPFloat
x MPFloat
y = (MPFloat
x MPFloat -> MPFloat -> MPFloat
+^ MPFloat
y) MPFloat -> MPFloat -> MPFloat
/^ (Integer -> MPFloat
forall t. CanBeMPFloat t => t -> MPFloat
mpFloat Integer
2)
avgDown :: MPFloat -> MPFloat -> MPFloat
avgDown :: MPFloat -> MPFloat -> MPFloat
avgDown MPFloat
x MPFloat
y = (MPFloat
x MPFloat -> MPFloat -> MPFloat
+. MPFloat
y) MPFloat -> MPFloat -> MPFloat
/. (Integer -> MPFloat
forall t. CanBeMPFloat t => t -> MPFloat
mpFloat Integer
2)