FArgReduct

# Library FArgReduct

``
IEEE754 : FArgReduct
Sylvie Boldo
`Require Export FnormI.
Require Export Classical.
Section SterbenzApprox.
Variable radix : Z.
Hypothesis radixMoreThanOne : (1 < radix)%Z.
Let FtoRradix := FtoR radix.
Coercion FtoRradix : float >-> R.
Variables (b1 : Fbound) (b2 : Fbound).
Variables (prec1 : nat) (prec2 : nat).
Hypothesis prec1MoreThanOne : 1 < prec1.
Hypothesis p1GivesBound : Zpos (vNum b1) = Zpower_nat radix prec1.
Hypothesis prec2MoreThanOne : 1 < prec2.
Hypothesis p2GivesBound : Zpos (vNum b2) = Zpower_nat radix prec2.
Theorem Rmin_1 : forall x y : R, (x <= y)%R -> Rmin x y = x.
Theorem Rmin_2 : forall x y : R, (y <= x)%R -> Rmin x y = y.
Theorem Rmin_eq : forall x : R, Rmin x x = x.
Theorem Rdiv_Rle :
forall a b c d : R,
(0 < a)%R ->
(0 < b)%R ->
(0 < c)%R -> (0 < d)%R -> (a <= c)%R -> (d <= b)%R -> (a / b <= c / d)%R.
Theorem SterbenzApprox :
forall (rho : R) (x y : float),
(0 < rho)%R ->
IZR (Zpos (vNum b1)) = (rho * Zsucc (Zpos (vNum b2)))%R ->
(- dExp b2 <= - dExp b1)%Z ->
Fbounded b1 x ->
Fbounded b1 y ->
(/ (1 + / rho) * y <= x)%R ->
(x <= (1 + / rho) * y)%R ->
exists u : float, u = (x - y)%R :>R /\ Fbounded b2 u.
Theorem SterbenzApprox_weak_1 :
forall (rho : R) (x y : float),
(0 < rho)%R ->
IZR (Zpos (vNum b1)) = (rho * Zpos (vNum b2))%R ->
(- dExp b2 <= - dExp b1)%Z ->
Fbounded b1 x ->
Fbounded b1 y ->
(0 <= y)%R ->
(y <= x)%R ->
(x <= (1 + / rho) * y)%R ->
Fbounded b2
(Fminus radix (Fnormalize radix b1 prec1 x) (Fnormalize radix b1 prec1 y)).
Theorem SterbenzApprox2 :
forall (rho : R) (x y : float),
(0 < rho)%R ->
IZR (Zpos (vNum b1)) = (rho * Zpos (vNum b2))%R ->
(- dExp b2 <= - dExp b1)%Z ->
Fbounded b1 x ->
Fbounded b1 y ->
(/ (1 + / rho) * y <= x)%R ->
(x <= (1 + / rho) * y)%R ->
Fbounded b2
(Fminus radix (Fnormalize radix b1 prec1 x) (Fnormalize radix b1 prec1 y)).
End SterbenzApprox.
Section RinvProps.
Variable radix : Z.
Hypothesis radixMoreThanOne : (1 < radix)%Z.
Let FtoRradix := FtoR radix.
Coercion FtoRradix : float >-> R.
Variable b : Fbound.
Variable prec : nat.
Hypothesis precMoreThanOne : 1 < prec.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix prec.
Theorem Rle_floats_isMax_Pos :
forall (f g : float) (r : R),
Fcanonic radix b f ->
Fcanonic radix b g ->
(0 < f)%R ->
isMax b radix r g ->
(f - Fulp b radix prec (FPred b radix prec f) < r)%R -> (f <= g)%R.
Theorem Rle_floats_isMax_Neg :
forall (f g : float) (r : R),
Fcanonic radix b f ->
Fcanonic radix b g ->
(f < 0)%R ->
isMax b radix r g -> (f - Fulp b radix prec f < r)%R -> (f <= g)%R.
Theorem FulpFPred_not_pow :
forall f : float,
(forall e : Z, FtoRradix f <> powerRZ radix e) ->
(0 < f)%R ->
Fcanonic radix b f ->
Fulp b radix prec (FPred b radix prec f) = Fulp b radix prec f.
Theorem RinvClosestRinvMaxRle_Pos :
radix = 2%Z ->
forall a u v : float,
(forall e : Z, FtoRradix a <> powerRZ radix e) ->
Fbounded b a ->
Fbounded b u ->
Fnormal radix b (Fnormalize radix b prec u) ->
Fcanonic radix b a ->
Fcanonic radix b v ->
Closest b radix (/ a) u ->
isMax b radix (/ u) v -> (0 < a)%R -> (0 < u)%R -> (a <= v)%R.
Theorem RinvClosestRinvMaxRle_Neg :
radix = 2%Z ->
forall a u v : float,
Fbounded b a ->
Fbounded b u ->
Fnormal radix b (Fnormalize radix b prec u) ->
Fcanonic radix b a ->
Fcanonic radix b v ->
Closest b radix (/ a) u ->
isMax b radix (/ u) v -> (a < 0)%R -> (u < 0)%R -> (a <= v)%R.
Theorem RinvClosestRinvMaxRle_pow :
forall (a u v : float) (e : Z),
a = powerRZ radix e :>R ->
(e <= dExp b)%Z ->
Fbounded b a ->
Closest b radix (/ a) u -> isMax b radix (/ u) v -> a = v :>R.
Theorem RinvClosestRinvMaxRle_pow2 :
forall (a u v : float) (e : Z),
a = powerRZ radix e :>R ->
Fnormal radix b (Fnormalize radix b prec u) ->
Fbounded b a ->
Closest b radix (/ a) u -> isMax b radix (/ u) v -> a = v :>R.
Theorem RinvClosestRinvMaxRle :
radix = 2%Z ->
forall a u v : float,
Fbounded b a ->
Fbounded b u ->
Fnormal radix b (Fnormalize radix b prec u) ->
Fcanonic radix b a ->
Fcanonic radix b v ->
Closest b radix (/ a) u ->
isMax b radix (/ u) v -> a <> 0%R :>R -> (a <= v)%R.
End RinvProps.
`