.
.
.
.
.
.
.
.
.
.
.
.
).
.
).
Proof.
.
Proof.
.
Proof.
)).
Proof.
.
Proof.
.
Proof.
).
Proof.
).
Proof.
).
Proof.
+α1-α0).
Proof.
)).
Proof.
).
Proof.
).
Proof.
).
Proof.
).
Proof.
).
Proof.
).
Proof.
.
Proof.
.
Proof.
).
Proof.
).
Proof.
.
Proof.
.
Proof.
intros.
destruct (
Req_dec x 0).
-
subst r x.
rewrite round_0 by apply valid_rnd_round_mode.
left.
exists 1.
compute;
Psatz.lra.
-
unfold round in r.
unfold scaled_mantissa,
canonic_exp,
Fcore_FLT.FLT_exp,
F2R in r.
simpl in r.
revert r.
apply Z.max_case_strong.
+
intros.
left.
exists (
r/
x).
split. 2:
field;
auto.
subst r.
rewrite bpow_opp.
set (
xx :=
Rabs x /
bpow radix2 (
ln_beta radix2 x - 24)).
assert ((
Znearest (
negb ∘
Zeven) (
x * /
bpow radix2 (
ln_beta radix2 x - 24)) *
bpow radix2 (
ln_beta radix2 x - 24) /
x) =
(
Znearest (
negb ∘
Zeven)
xx) /
xx).
{
unfold xx,
Rabs.
destruct Rcase_abs.
-
rewrite Ropp_div,
Znearest_opp,
Z2R_opp.
replace (-
Znearest (λ
t0 :
Z,
negb (
negb (
Zeven (- (
t0 + 1)))))
(
x /
bpow radix2 (
ln_beta radix2 x - 24)) /
- (
x /
bpow radix2 (
ln_beta radix2 x - 24)))
with (
Znearest (λ
t0 :
Z,
negb (
negb (
Zeven (- (
t0 + 1)))))
(
x /
bpow radix2 (
ln_beta radix2 x - 24)) *
bpow radix2 (
ln_beta radix2 x - 24) /
x).
2:
field.
f_equal.
f_equal.
f_equal.
unfold Znearest,
Rdiv.
rewrite Zeven_opp,
Zeven_plus.
simpl.
destruct Zeven;
auto.
split.
apply Rgt_not_eq,
bpow_gt_0.
auto.
-
unfold Rdiv.
field.
split.
apply Rgt_not_eq,
bpow_gt_0.
auto. }
rewrite H1.
assert (8388608 <=
xx < 16777216).
{
subst xx.
clear H1 H0.
destruct ln_beta.
simpl.
specialize (
a H).
destruct a.
split.
-
replace (
ln_beta_val - 24)%
Z with ((
ln_beta_val - 1)+-23)%
Z by ring.
rewrite bpow_plus.
simpl.
apply Rmult_le_reg_r with (
r:=
bpow radix2 (
ln_beta_val - 1)).
apply bpow_gt_0.
replace (
Rabs x / (
bpow radix2 (
ln_beta_val - 1) * / 8388608) *
bpow radix2 (
ln_beta_val - 1))
with (
Rabs x * 8388608).
Psatz.lra.
field.
apply Rgt_not_eq,
bpow_gt_0.
-
unfold Zminus.
rewrite bpow_plus.
simpl.
apply Rmult_lt_reg_r with (
r:=
bpow radix2 ln_beta_val).
apply bpow_gt_0.
replace (
Rabs x / (
bpow radix2 ln_beta_val * / 16777216) *
bpow radix2 ln_beta_val)
with (
Rabs x * 16777216).
Psatz.lra.
field.
apply Rgt_not_eq,
bpow_gt_0. }
revert H2.
generalize xx.
clear.
intros.
destruct (
Rabs_le_inv _ _ (
Znearest_N (
negb ∘
Zeven)
xx)).
split;
unfold RF_le;
simpl;
unfold F2R;
simpl.
destruct (
Z.eq_dec (
Znearest (
negb ∘
Zeven)
xx) 8388608).
*
rewrite e in *.
simpl in *.
eapply Rle_trans.
eapply Rmult_le_compat_l,
Rinv_le,
H2.
Psatz.lra.
Psatz.lra.
Psatz.lra.
*
assert (8388607 <
Znearest (
negb ∘
Zeven)
xx)%
Z by (
apply lt_Z2R;
simpl;
Psatz.lra).
assert (8388609 <=
Znearest (
negb ∘
Zeven)
xx)%
Z by Psatz.lia.
clear H1 n.
apply Z2R_le in H3.
simpl in H3.
eapply Rle_trans with
(
r2:=(
Znearest (
negb ∘
Zeven)
xx / (
Znearest (
negb ∘
Zeven)
xx - / 2))).
apply Rmult_le_compat_l,
Rinv_le;
try Psatz.lra.
replace (
Znearest (
negb ∘
Zeven)
xx / (
Znearest (
negb ∘
Zeven)
xx - / 2))
with (1+/2 / (
Znearest (
negb ∘
Zeven)
xx - / 2))
by (
field;
Psatz.lra).
replace (4503599895805937 * / 4503599627370496)
with (1+/2/(4503599627370496 / 536870882))
by field.
apply Rplus_le_compat_l,
Rmult_le_compat_l,
Rinv_le;
Psatz.lra.
*
rewrite Ropp_mult_distr_l_reverse.
apply Ropp_le_contravar.
eapply Rle_trans with
(
r2:=(
Znearest (
negb ∘
Zeven)
xx / (
Znearest (
negb ∘
Zeven)
xx + / 2))),
Rmult_le_compat_l,
Rinv_le;
try Psatz.lra.
replace (
Znearest (
negb ∘
Zeven)
xx / (
Znearest (
negb ∘
Zeven)
xx + / 2))
with (1-/2 / (
Znearest (
negb ∘
Zeven)
xx + / 2))
by (
field;
Psatz.lra).
replace (9007198717870111 * / 9007199254740992)
with (1-/2/(4503599627370496/536870881))
by field.
apply Rplus_le_compat_l,
Ropp_le_contravar,
Rmult_le_compat_l,
Rinv_le;
try Psatz.lra.
assert (8388607 <
Znearest (
negb ∘
Zeven)
xx)%
Z by (
apply lt_Z2R;
simpl;
Psatz.lra).
assert (8388608 <=
Znearest (
negb ∘
Zeven)
xx)%
Z by Psatz.lia.
apply Z2R_le in H3.
simpl in H3.
Psatz.lra.
+
right.
destruct (
Rabs_le_inv _ _ (
Znearest_N (
negb ∘
Zeven) (
x *
bpow radix2 (- -149)))).
split;
unfold RF_le;
simpl in *;
unfold F2R;
simpl;
Psatz.lra.
Qed.
.
Proof.
.
Proof.
.
Proof.
.
Proof.
).
Proof.
.
Proof.
)).
Proof.
.
Proof.
).
Proof.
|}.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
Next Obligation.
.