Section F2.
Variable b : Fbound.
Variable precision : nat.
Let radix := 2%Z.
Let FtoRradix := FtoR radix.
Local Coercion FtoRradix : float >-> R.
red in |- *; simpl in |- *; auto.
Qed.
Hint Resolve TwoMoreThanOne.
Hypothesis precisionNotZero : 1 < precision.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix precision.
intros P H' p q pq H'0 H'1 H'2.
rewrite <- (Rabs_right radix); auto with real zarith.
rewrite <- RmaxRmult; auto with real.
repeat rewrite <- Rabs_mult.
case (Rle_or_lt p q); intros Rltp.
apply RmaxAbs; auto.
apply (RoundedModeMultLess b radix) with (P := P) (r := (p + q)%R); auto.
replace (radix * FtoR radix p)%R with (p + p)%R;
[ auto with real | unfold radix at 1; fold FtoRradix; ring].
unfold FtoRradix in |- *;
apply (RoundedModeMult b radix) with (P := P) (r := (p + q)%R);
auto.
replace (radix * FtoR radix q)%R with (q + q)%R;
[ auto with real | unfold radix at 1; fold FtoRradix; ring ].
rewrite RmaxSym.
apply RmaxAbs; auto.
apply (RoundedModeMultLess b radix) with (P := P) (r := (p + q)%R); auto.
replace (radix * FtoR radix q)%R with (q + q)%R;
[ auto with real | unfold radix at 1; fold FtoRradix; ring ].
unfold FtoRradix in |- *;
apply (RoundedModeMult b radix) with (P := P) (r := (p + q)%R);
auto.
replace (radix * FtoR radix p)%R with (p + p)%R;
[ auto with real zarith | unfold radix at 1; fold FtoRradix; ring].
Qed.

Theorem plusErrorBound2 :
forall p q r : float,
Fbounded b p ->
Fbounded b q ->
Closest b radix (p + q) r ->
~ is_Fzero r ->
(Rabs (r - (p + q)) < radix * / pPred (vNum b) * Rmax (Rabs p) (Rabs q))%R.