aboutsummaryrefslogtreecommitdiffstats
path: root/kvx
diff options
context:
space:
mode:
authorDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-01-24 10:02:43 +0100
committerDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-01-24 10:02:43 +0100
commit3b36bd818ffc20f7a455da46a89641c02491a4e1 (patch)
tree912a6bc200cdbab68a875b7565f75634884fa9d6 /kvx
parentfa79debdca4121f2435750b8090e83b541887979 (diff)
downloadcompcert-kvx-3b36bd818ffc20f7a455da46a89641c02491a4e1.tar.gz
compcert-kvx-3b36bd818ffc20f7a455da46a89641c02491a4e1.zip
progress
Diffstat (limited to 'kvx')
-rw-r--r--kvx/FPDivision64.v20
1 files changed, 17 insertions, 3 deletions
diff --git a/kvx/FPDivision64.v b/kvx/FPDivision64.v
index 8d40e88e..6894460f 100644
--- a/kvx/FPDivision64.v
+++ b/kvx/FPDivision64.v
@@ -1116,7 +1116,7 @@ Lemma step2_real_div_long_smalla_correct :
(b_NOT0 : (0 < Int64.unsigned b)%Z),
exists (q : float),
(step2_real_div_long (Vlong a) (Vlong b)) = Vfloat q /\
- (Rabs ((B2R _ _ q) - (IZR (Int64.signed a)) / (IZR (Int64.unsigned b))) < (1/2))%R.
+ (Rabs ((B2R _ _ q) - (IZR (Int64.signed a)) / (IZR (Int64.unsigned b))) <= (255/256))%R.
Proof.
intros.
unfold step2_real_div_long.
@@ -1167,8 +1167,22 @@ Proof.
cbn in C2.
destruct C2 as (C2R & C2F & _).
rewrite C2R.
- admit.
-Admitted.
+ replace (IZR a' * (B2R 53 1024 f))%R with
+ ((IZR a'/IZR b') * ((IZR b' * B2R 53 1024 f - 1) + 1))%R ; cycle 1.
+ { field. lra. }
+ set (delta1 := (IZR b' * B2R 53 1024 f - 1)%R) in *.
+ set (q1 := (IZR a' / IZR b' * (delta1 + 1))%R).
+ replace (rd q1) with (((rd q1) - q1) + q1)%R by ring.
+ set (delta2 := ((rd q1) - q1)%R).
+ unfold q1.
+ replace (delta2 + IZR a' / IZR b' * (delta1 + 1) - IZR a' / IZR b')%R with
+ (delta2 + (IZR a' / IZR b') * delta1)%R by ring.
+ unfold delta2.
+ unfold q1.
+ unfold approx_inv_rel_thresh in *.
+ unfold smalla_thresh in *.
+ gappa.
+Qed.
Definition step2_div_long' a b :=
Val.maketotal (Val.longuoffloat_ne (step2_real_div_long a b)).