ThreeSumProps

# Library ThreeSumProps

`Require Export ThreeSum2.
Section F2.
Variable b : Fbound.
Variable precision : nat.
Let radix := 2%Z.
Let TMTO : (1 < radix)%Z := TwoMoreThanOne.
Hint Resolve TMTO: zarith.
Let FtoRradix := FtoR radix.
Coercion FtoRradix : float >-> R.
Hypothesis precisionNotZero : 1 < precision.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix precision.
Variables (p : float) (q : float) (r : float) (u : float) (
v : float) (w : float) (p' : float) (q' : float) (
r' : float).
Hypothesis Fp : Fbounded b p.
Hypothesis Fq : Fbounded b q.
Hypothesis Fr : Fbounded b r.
Hypothesis Fu : Fbounded b u.
Hypothesis Fv : Fbounded b v.
Hypothesis Fw : Fbounded b w.
Hypothesis Fp' : Fbounded b p'.
Hypothesis Fq' : Fbounded b q'.
Hypothesis Fr' : Fbounded b r'.
Hypothesis epq : (Fexp q <= Fexp p)%Z.
Hypothesis eqr : (Fexp r <= Fexp q)%Z.
Hypothesis uDef : Closest b radix (q + r) u.
Hypothesis vDef : v = (q + r - u)%R :>R.
Hypothesis p'Def : Closest b radix (p + u) p'.
Hypothesis wDef : w = (p + u - p')%R :>R.
Hypothesis q'Def : Closest b radix (w + v) q'.
Hypothesis r'Def : r' = (w + v - q')%R :>R.
Hypothesis Ngd : (1 <= pPred (vNum b) * (1 - / radix))%R.
Hypothesis
Hplus :
(p = 0%R :>R \/ q = 0%R :>R \/ r = 0%R :>R) \/
(Rabs q <= pPred (vNum b) * (Float 1%nat (Fexp p) - Float 1%nat (Fexp r)))%R.
Hypothesis Ngd2 : (6%nat <= pPred (vNum b) * (1 - / radix * / radix))%R.
Theorem FTS :
(Rabs q <= pPred (vNum b) * (Float 1%nat (Fexp p) - Float 1%nat (Fexp r)))%R ->
exists u'' : float,
FtoRradix u'' = u /\ Fbounded b u'' /\ (Fexp u'' <= Fexp p)%Z.
Theorem FTSinSum3_allcases :
p <> 0%R :>R ->
exists u'' : float, u'' = u :>R /\ Fbounded b u'' /\ (Fexp u'' <= Fexp p)%Z.
Theorem PuissLessThanHalf :
forall z : Z, (Float 1%nat z * / radix <= Float 1%nat z)%R.
Theorem Rle_Rminus_ZERO : forall r1 r2 : R, (r2 <= r1)%R -> (0 <= r1 - r2)%R.
Theorem ThreeSumLoop :
exists p'' : float,
(exists q'' : float,
(exists r'' : float,
(Fbounded b p'' /\ Fbounded b q'' /\ Fbounded b r'') /\
((p'' = p' :>R /\ q'' = q' :>R /\ r'' = r' :>R) /\
(Fexp r <= Fexp r'')%Z /\
((Fexp r'' <= Fexp q'')%Z /\ (Fexp q'' <= Fexp p'')%Z) /\
Fexp r'' = Fexp r) /\
(r' = 0%R :>R /\
(p'' = 0%R :>R \/
(Rabs q'' <=
pPred (vNum b) * (Float 1%nat (Fexp p'') - Float 1%nat (Fexp r)))%R) \/
r' <> 0%R :>R /\
(Rabs r'' <=
pPred (vNum b) * (Float 1%nat (Fexp q'') - Float 1%nat (Fexp r)))%R))).
End F2.
`