From 4e8389034032a44cd2f03e965badec92e2aaa23e Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 25 Apr 2018 10:43:45 +0200 Subject: Upgrade Flocq to version 2.6.1 from upstream (#71) We were previously at 2.5.2. Quoting the NEWS from upstream: Version 2.6.1: - ensured compatibility from Coq 8.4 to 8.8 Version 2.6.0: - ensured compatibility from Coq 8.4 to 8.7 - removed some hypotheses on some lemmas of Fcore_ulp - added lemmas to Fprop_plus_error - improved examples Also: in preparation for Coq 8.8, silence warning "compatibility-notation" when building Flocq, because this warning is on by default in 8.8, and Flocq triggers it a lot. --- flocq/Core/Fcore_FLT.v | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'flocq/Core/Fcore_FLT.v') diff --git a/flocq/Core/Fcore_FLT.v b/flocq/Core/Fcore_FLT.v index 53dc48a7..2258b1d9 100644 --- a/flocq/Core/Fcore_FLT.v +++ b/flocq/Core/Fcore_FLT.v @@ -257,32 +257,33 @@ apply Rle_lt_trans with (2:=Hx). now apply He. Qed. -Theorem ulp_FLT_le: forall x, (bpow (emin+prec) <= Rabs x)%R -> - (ulp beta FLT_exp x <= Rabs x * bpow (1-prec))%R. +Theorem ulp_FLT_le : + forall x, (bpow (emin + prec - 1) <= Rabs x)%R -> + (ulp beta FLT_exp x <= Rabs x * bpow (1 - prec))%R. Proof. intros x Hx. -assert (x <> 0)%R. -intros Z; contradict Hx; apply Rgt_not_le, Rlt_gt. -rewrite Z, Rabs_R0; apply bpow_gt_0. -rewrite ulp_neq_0; try assumption. +assert (Zx : (x <> 0)%R). + intros Z; contradict Hx; apply Rgt_not_le, Rlt_gt. + rewrite Z, Rabs_R0; apply bpow_gt_0. +rewrite ulp_neq_0 with (1 := Zx). unfold canonic_exp, FLT_exp. destruct (ln_beta beta x) as (e,He). apply Rle_trans with (bpow (e-1)*bpow (1-prec))%R. rewrite <- bpow_plus. right; apply f_equal. -apply trans_eq with (e-prec)%Z;[idtac|ring]. -simpl; apply Z.max_l. -assert (emin+prec <= e)%Z; try omega. -apply le_bpow with beta. -apply Rle_trans with (1:=Hx). -left; now apply He. +replace (e - 1 + (1 - prec))%Z with (e - prec)%Z by ring. +apply Z.max_l. +assert (emin+prec-1 < e)%Z; try omega. +apply lt_bpow with beta. +apply Rle_lt_trans with (1:=Hx). +now apply He. apply Rmult_le_compat_r. apply bpow_ge_0. now apply He. Qed. - -Theorem ulp_FLT_ge: forall x, (Rabs x * bpow (-prec) < ulp beta FLT_exp x)%R. +Theorem ulp_FLT_gt : + forall x, (Rabs x * bpow (-prec) < ulp beta FLT_exp x)%R. Proof. intros x; case (Req_dec x 0); intros Hx. rewrite Hx, ulp_FLT_small, Rabs_R0, Rmult_0_l; try apply bpow_gt_0. -- cgit