Fast2Diff

# Library Fast2Diff

`Require Export EFast2Sum.
Section EDiff.
Variable b : Fbound.
Variable precision : nat.
Let radix := 2%Z.
Coercion Local FtoRradix := FtoR radix.
Hypothesis precisionGreaterThanOne : 1 < precision.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix precision.
Variable Iplus : float -> float -> float.
Hypothesis
IplusCorrect :
forall p q : float,
Fbounded b p -> Fbounded b q -> Closest b radix (p + q) (Iplus p q).
Hypothesis
IplusComp :
forall p q r s : float,
Fbounded b p ->
Fbounded b q ->
Fbounded b r ->
Fbounded b s -> p = r :>R -> q = s :>R -> Iplus p q = Iplus r s :>R.
Hypothesis IplusSym : forall p q : float, Iplus p q = Iplus q p.
Hypothesis
IplusOp : forall p q : float, Fopp (Iplus p q) = Iplus (Fopp p) (Fopp q).
Variable Iminus : float -> float -> float.
Hypothesis IminusPlus : forall p q : float, Iminus p q = Iplus p (Fopp q).
Theorem MDekkerDiffAux1 :
forall p q : float,
Iminus p (Iminus p q) = (p - Iminus p q)%R :>R ->
Fbounded b p ->
Fbounded b q ->
Iminus (Iminus p (Iminus p q)) q = (p - q - Iminus p q)%R :>R.
Theorem MDekkerDiff :
forall p q : float,
Fbounded b p ->
Fbounded b q ->
(Rabs q <= Rabs p)%R -> Iminus p (Iminus p q) = (p - Iminus p q)%R :>R.
Theorem DekkerDiff :
forall p q : float,
Fbounded b p ->
Fbounded b q ->
(Rabs q <= Rabs p)%R ->
Iminus (Iminus p (Iminus p q)) q = (p - q - Iminus p q)%R :>R.
Theorem ExtMDekkerDiff :
forall p q : float,
Fbounded b p ->
Fbounded b q ->
(Fexp q <= Fexp p)%Z -> Iminus p (Iminus p q) = (p - Iminus p q)%R :>R.
Theorem ExtDekkerDiff :
forall p q : float,
Fbounded b p ->
Fbounded b q ->
(Fexp q <= Fexp p)%Z ->
Iminus (Iminus p (Iminus p q)) q = (p - q - Iminus p q)%R :>R.
End EDiff.
`