Commit 1d9288f8 authored by BOLDO Sylvie's avatar BOLDO Sylvie

Renaming + moving theorems + generalizing round_UP_plus_eps (& similar)

parent ef1c2fb4
...@@ -294,7 +294,7 @@ case (Rle_or_lt 0 h); intros H3;[destruct H3|idtac]. ...@@ -294,7 +294,7 @@ case (Rle_or_lt 0 h); intros H3;[destruct H3|idtac].
rewrite Rabs_right in Hh. rewrite Rabs_right in Hh.
2: now apply Rle_ge, Rlt_le. 2: now apply Rle_ge, Rlt_le.
apply round_N_eq_DN_pt with (f+ ulp_flt f)... apply round_N_eq_DN_pt with (f+ ulp_flt f)...
pattern f at 2; rewrite <- (round_DN_plus_eps radix2 (FLT_exp emin prec) f) with (eps:=h); try assumption. pattern f at 2; rewrite <- (round_DN_plus_eps_pos radix2 (FLT_exp emin prec) f) with (eps:=h); try assumption.
apply round_DN_pt... apply round_DN_pt...
now left. now left.
split. split.
...@@ -305,7 +305,7 @@ apply Rmult_lt_compat_r. ...@@ -305,7 +305,7 @@ apply Rmult_lt_compat_r.
rewrite ulp_neq_0; try now apply Rgt_not_eq. rewrite ulp_neq_0; try now apply Rgt_not_eq.
apply bpow_gt_0. apply bpow_gt_0.
fourier. fourier.
rewrite <- (round_UP_plus_eps radix2 (FLT_exp emin prec) f) with (eps:=h); try assumption. rewrite <- (round_UP_plus_eps_pos radix2 (FLT_exp emin prec) f) with (eps:=h); try assumption.
apply round_UP_pt... apply round_UP_pt...
now left. now left.
split; trivial. split; trivial.
...@@ -456,7 +456,7 @@ clear T1. ...@@ -456,7 +456,7 @@ clear T1.
destruct T. destruct T.
(* normal case *) (* normal case *)
apply round_N_eq_UP_pt with (pred_flt f)... apply round_N_eq_UP_pt with (pred_flt f)...
rewrite <- (round_DN_minus_eps radix2 (FLT_exp emin prec) f) with (eps:=-h); try assumption. rewrite <- (round_DN_minus_eps_pos radix2 (FLT_exp emin prec) f) with (eps:=-h); try assumption.
replace (f--h) with (f+h) by ring. replace (f--h) with (f+h) by ring.
apply round_DN_pt... apply round_DN_pt...
split. split.
...@@ -474,7 +474,7 @@ apply ulp_ge_0. ...@@ -474,7 +474,7 @@ apply ulp_ge_0.
fourier. fourier.
intros Y; rewrite (proj1 Y); now right. intros Y; rewrite (proj1 Y); now right.
replace (f+h) with (pred_flt f + (f-pred_flt f+h)) by ring. replace (f+h) with (pred_flt f + (f-pred_flt f+h)) by ring.
pattern f at 4; rewrite <- (round_UP_pred_plus_eps radix2 (FLT_exp emin prec) f) with (eps:=(f - pred_flt f + h)); try assumption. pattern f at 4; rewrite <- (round_UP_pred_plus_eps_pos radix2 (FLT_exp emin prec) f) with (eps:=(f - pred_flt f + h)); try assumption.
apply round_UP_pt... apply round_UP_pt...
replace (f-pred_flt f) with (ulp_flt (pred_flt f)). replace (f-pred_flt f) with (ulp_flt (pred_flt f)).
split. split.
...@@ -529,7 +529,7 @@ omega. ...@@ -529,7 +529,7 @@ omega.
intros Y; now contradict T2. intros Y; now contradict T2.
assert (round radix2 (FLT_exp emin prec) Zfloor (f+h) = pred_flt f). assert (round radix2 (FLT_exp emin prec) Zfloor (f+h) = pred_flt f).
replace (f+h) with (f-(-h)) by ring. replace (f+h) with (f-(-h)) by ring.
apply round_DN_minus_eps... apply round_DN_minus_eps_pos...
split. split.
auto with real. auto with real.
rewrite T3, T1. rewrite T3, T1.
...@@ -538,7 +538,7 @@ apply ulp_ge_0. ...@@ -538,7 +538,7 @@ apply ulp_ge_0.
fourier. fourier.
assert (round radix2 (FLT_exp emin prec) Zceil (f+h) = f). assert (round radix2 (FLT_exp emin prec) Zceil (f+h) = f).
replace (f+h) with (pred_flt f + /2*ulp_flt (pred_flt f)). replace (f+h) with (pred_flt f + /2*ulp_flt (pred_flt f)).
apply round_UP_pred_plus_eps... apply round_UP_pred_plus_eps_pos...
split. split.
apply Rmult_lt_0_compat. apply Rmult_lt_0_compat.
fourier. fourier.
......
...@@ -486,7 +486,7 @@ assert (Hl2 : ln_beta rx2c = ln_beta x :> Z). ...@@ -486,7 +486,7 @@ assert (Hl2 : ln_beta rx2c = ln_beta x :> Z).
now apply Rplus_lt_compat_l, Rmult_lt_compat_l; [lra|apply bpow_lt]. now apply Rplus_lt_compat_l, Rmult_lt_compat_l; [lra|apply bpow_lt].
+ unfold ex1; rewrite <- Hl1. + unfold ex1; rewrite <- Hl1.
fold (canonic_exp beta fexp1 rx1); rewrite <- ulp_neq_0; try now apply Rgt_not_eq. fold (canonic_exp beta fexp1 rx1); rewrite <- ulp_neq_0; try now apply Rgt_not_eq.
apply succ_le_bpow; [exact Prx1| |]. apply id_p_ulp_le_bpow; [exact Prx1| |].
* now apply generic_format_round; [|apply valid_rnd_DN]. * now apply generic_format_round; [|apply valid_rnd_DN].
* destruct (ln_beta rx1) as (erx1, Herx1); simpl. * destruct (ln_beta rx1) as (erx1, Herx1); simpl.
rewrite <- (Rabs_right rx1) at 1; [|now apply Rle_ge, Rlt_le]. rewrite <- (Rabs_right rx1) at 1; [|now apply Rle_ge, Rlt_le].
......
...@@ -205,7 +205,7 @@ destruct (Req_dec x' 0) as [Zx'|Nzx']. ...@@ -205,7 +205,7 @@ destruct (Req_dec x' 0) as [Zx'|Nzx'].
{ apply (Rplus_le_reg_r (ulp beta fexp1 x)); ring_simplify. { apply (Rplus_le_reg_r (ulp beta fexp1 x)); ring_simplify.
rewrite <- ulp_DN. rewrite <- ulp_DN.
- change (round _ _ _ _) with x'. - change (round _ _ _ _) with x'.
apply succ_le_bpow. apply id_p_ulp_le_bpow.
+ exact Px'. + exact Px'.
+ change x' with (round beta fexp1 Zfloor x). + change x' with (round beta fexp1 Zfloor x).
now apply generic_format_round; [|apply valid_rnd_DN]. now apply generic_format_round; [|apply valid_rnd_DN].
...@@ -2733,7 +2733,7 @@ destruct (Req_dec a 0) as [Za|Nza]. ...@@ -2733,7 +2733,7 @@ destruct (Req_dec a 0) as [Za|Nza].
apply Rmult_lt_compat_r; [apply bpow_gt_0|lra]. apply Rmult_lt_compat_r; [apply bpow_gt_0|lra].
+ apply Rle_trans with (a+ ulp beta fexp1 a). + apply Rle_trans with (a+ ulp beta fexp1 a).
right; now rewrite ulp_neq_0. right; now rewrite ulp_neq_0.
apply (succ_le_bpow _ _ _ _ Pa Fa). apply (id_p_ulp_le_bpow _ _ _ _ Pa Fa).
apply Rabs_lt_inv, bpow_ln_beta_gt. apply Rabs_lt_inv, bpow_ln_beta_gt.
- apply Rle_trans with (bpow (- 2) * u1 ^ 2). - apply Rle_trans with (bpow (- 2) * u1 ^ 2).
+ unfold pow; rewrite Rmult_1_r. + unfold pow; rewrite Rmult_1_r.
...@@ -2779,7 +2779,7 @@ destruct (Req_dec a 0) as [Za|Nza]. ...@@ -2779,7 +2779,7 @@ destruct (Req_dec a 0) as [Za|Nza].
unfold u1; fold (canonic_exp beta fexp1 (sqrt x)). unfold u1; fold (canonic_exp beta fexp1 (sqrt x)).
rewrite <- canonic_exp_DN; [|exact Vfexp1|exact Pa]; fold a. rewrite <- canonic_exp_DN; [|exact Vfexp1|exact Pa]; fold a.
rewrite <- ulp_neq_0; trivial. rewrite <- ulp_neq_0; trivial.
apply succ_le_bpow. apply id_p_ulp_le_bpow.
+ exact Pa. + exact Pa.
+ now apply round_DN_pt. + now apply round_DN_pt.
+ apply Rle_lt_trans with (sqrt x). + apply Rle_lt_trans with (sqrt x).
...@@ -3175,7 +3175,7 @@ destruct (Req_dec a 0) as [Za|Nza]. ...@@ -3175,7 +3175,7 @@ destruct (Req_dec a 0) as [Za|Nza].
rewrite <- (Rmult_1_l (ulp _ _ _)). rewrite <- (Rmult_1_l (ulp _ _ _)).
rewrite ulp_neq_0; trivial. rewrite ulp_neq_0; trivial.
apply Rmult_lt_compat_r; [apply bpow_gt_0|lra]. apply Rmult_lt_compat_r; [apply bpow_gt_0|lra].
+ apply (succ_le_bpow _ _ _ _ Pa Fa). + apply (id_p_ulp_le_bpow _ _ _ _ Pa Fa).
apply Rabs_lt_inv, bpow_ln_beta_gt. apply Rabs_lt_inv, bpow_ln_beta_gt.
- apply Rle_trans with (bpow (- 1) * u1 ^ 2). - apply Rle_trans with (bpow (- 1) * u1 ^ 2).
+ unfold pow; rewrite Rmult_1_r. + unfold pow; rewrite Rmult_1_r.
...@@ -3221,7 +3221,7 @@ destruct (Req_dec a 0) as [Za|Nza]. ...@@ -3221,7 +3221,7 @@ destruct (Req_dec a 0) as [Za|Nza].
unfold u1; fold (canonic_exp beta fexp1 (sqrt x)). unfold u1; fold (canonic_exp beta fexp1 (sqrt x)).
rewrite <- canonic_exp_DN; [|exact Vfexp1|exact Pa]; fold a. rewrite <- canonic_exp_DN; [|exact Vfexp1|exact Pa]; fold a.
rewrite <- ulp_neq_0; trivial. rewrite <- ulp_neq_0; trivial.
apply succ_le_bpow. apply id_p_ulp_le_bpow.
+ exact Pa. + exact Pa.
+ now apply round_DN_pt. + now apply round_DN_pt.
+ apply Rle_lt_trans with (sqrt x). + apply Rle_lt_trans with (sqrt x).
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment