DoubleRound

# Library DoubleRound

`Require Export MinOrMax.
Section MOMR.
Variables b1 b2 : Fbound.
Variable radix : Z.
Variables prec1 prec2 : nat.
Coercion Local FtoRradix := FtoR radix.
Hypothesis radixMoreThanOne : (1 < radix)%Z.
Hypothesis prec1GreaterThanOne : 1 < prec1.
Hypothesis prec2GreaterThanOne : 1 < prec2.
Hypothesis p1GivesBound : Zpos (vNum b1) = Zpower_nat radix prec1.
Hypothesis p2GivesBound : Zpos (vNum b2) = Zpower_nat radix prec2.
Theorem BoundedBounded :
forall f : float,
prec2 <= prec1 ->
(prec1 - prec2 <= dExp b1 - dExp b2)%Z
-> Fbounded b2 f -> Fbounded b1 f.
Theorem DblRndStable :
forall (z : R) (p q : float),
prec2 <= prec1 ->
(prec1 - prec2 <= dExp b1 - dExp b2)%Z ->
Fbounded b1 p ->
Fbounded b2 q ->
MinOrMax radix b1 z p -> MinOrMax radix b2 p q -> MinOrMax radix b2 z q.
Theorem DoubleRound2 :
forall (z : R) (p q : float),
prec2 <= prec1 ->
(prec1 - prec2 = dExp b1 - dExp b2)%Z ->
Fbounded b1 p ->
Fbounded b2 q ->
MinOrMax radix b1 z p ->
Closest b2 radix p q ->
(Rabs (z - q) <
Fulp b2 radix prec2 q * (/ 2%nat + powerRZ radix (Zsucc (prec2 - prec1))))%R.
End MOMR.
`