Commit 71a3cfec authored by Guillaume Melquiond's avatar Guillaume Melquiond

New release.

parent 56ce444c
Prerequisites Prerequisites
------------- -------------
You will need the Coq proof assistant (>= 8.3) with a Reals theory You will need the Coq proof assistant (>= 8.4) with a Reals theory
compiled in. compiled in.
The .tar.gz file is distributed with a working set of configure files. They The .tar.gz file is distributed with a working set of configure files. They
......
Version 2.2.0:
- added theorems about rounding to odd and double rounding
- improved handling of special values of IEEE-754 arithmetic
Version 2.1.0: Version 2.1.0:
- ensured compatibility with both Coq 8.3 and 8.4 - ensured compatibility with both Coq 8.3 and 8.4
- improved support for rounding toward and away from zero - improved support for rounding toward and away from zero
......
...@@ -66,6 +66,11 @@ install: ...@@ -66,6 +66,11 @@ install:
EXTRA_DIST = \ EXTRA_DIST = \
configure configure
REMOVE_FROM_DIST = \
src/Appli/Fappli_Axpy.v \
src/Appli/Fappli_Muller.v \
src/Translate/
dist: $(EXTRA_DIST) dist: $(EXTRA_DIST)
PACK=@PACKAGE_TARNAME@-@PACKAGE_VERSION@ PACK=@PACKAGE_TARNAME@-@PACKAGE_VERSION@
DIRS=`git ls-tree -d -r --name-only HEAD` DIRS=`git ls-tree -d -r --name-only HEAD`
...@@ -74,6 +79,7 @@ dist: $(EXTRA_DIST) ...@@ -74,6 +79,7 @@ dist: $(EXTRA_DIST)
mkdir $PACK mkdir $PACK
for d in $DIRS; do mkdir $PACK/$d; done for d in $DIRS; do mkdir $PACK/$d; done
for f in $FILES $(EXTRA_DIST); do cp $f $PACK/$f; done for f in $FILES $(EXTRA_DIST); do cp $f $PACK/$f; done
for f in $(REMOVE_FROM_DIST) ; do rm -rf $PACK/$f; done
git log --pretty="format:%ad %s" --date=short > $PACK/ChangeLog git log --pretty="format:%ad %s" --date=short > $PACK/ChangeLog
cat /dev/null > $PACK/ChangeLog cat /dev/null > $PACK/ChangeLog
rm `find $PACK -name .gitignore` rm `find $PACK -name .gitignore`
......
AC_INIT([Flocq], [2.1.0], AC_INIT([Flocq], [2.2.0],
[Sylvie Boldo <sylvie.boldo@inria.fr>, Guillaume Melquiond <guillaume.melquiond@inria.fr>], [Sylvie Boldo <sylvie.boldo@inria.fr>, Guillaume Melquiond <guillaume.melquiond@inria.fr>],
[flocq]) [flocq])
......
...@@ -308,7 +308,7 @@ https://github.com/apenwarr/redo for an implementation and some comprehensive do ...@@ -308,7 +308,7 @@ https://github.com/apenwarr/redo for an implementation and some comprehensive do
\section sec-licensing Licensing \section sec-licensing Licensing
@author Guillaume Melquiond @author Guillaume Melquiond
@version 0.8 @version 0.9
@date 2012-2013 @date 2012-2013
@copyright @copyright
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
...@@ -2200,7 +2200,7 @@ static void complete_request(client_t &client, bool success) ...@@ -2200,7 +2200,7 @@ static void complete_request(client_t &client, bool success)
else if (client.socket != INVALID_SOCKET) else if (client.socket != INVALID_SOCKET)
{ {
char res = success ? 1 : 0; char res = success ? 1 : 0;
send(client.socket, &res, 1, 0); send(client.socket, &res, 1, MSG_NOSIGNAL);
#ifdef WINDOWS #ifdef WINDOWS
closesocket(client.socket); closesocket(client.socket);
#else #else
...@@ -2665,7 +2665,7 @@ void client_mode(char *socket_name, string_list const &targets) ...@@ -2665,7 +2665,7 @@ void client_mode(char *socket_name, string_list const &targets)
if (send(socket_fd, (char *)&job_id, sizeof(job_id), MSG_NOSIGNAL) != sizeof(job_id)) if (send(socket_fd, (char *)&job_id, sizeof(job_id), MSG_NOSIGNAL) != sizeof(job_id))
goto error; goto error;
// Send tagets. // Send targets.
for (string_list::const_iterator i = targets.begin(), for (string_list::const_iterator i = targets.begin(),
i_end = targets.end(); i != i_end; ++i) i_end = targets.end(); i != i_end; ++i)
{ {
......
...@@ -62,8 +62,8 @@ now contradict H. ...@@ -62,8 +62,8 @@ now contradict H.
Qed. Qed.
Definition MinOrMax x f := Definition MinOrMax x f :=
((f = round beta (FLX_exp prec) Zfloor x) ((f = round beta (FLX_exp prec) Zfloor x)
\/ (f = round beta (FLX_exp prec) Zceil x)). \/ (f = round beta (FLX_exp prec) Zceil x)).
Theorem MinOrMax_opp: forall x f, Theorem MinOrMax_opp: forall x f,
...@@ -84,7 +84,7 @@ Qed. ...@@ -84,7 +84,7 @@ Qed.
Theorem implies_DN_lt_ulp: Theorem implies_DN_lt_ulp:
forall x f, format f -> forall x f, format f ->
(0 < f <= x)%R -> (0 < f <= x)%R ->
(Rabs (f-x) < ulp f)%R -> (Rabs (f-x) < ulp f)%R ->
(f = round beta (FLX_exp prec) Zfloor x)%R. (f = round beta (FLX_exp prec) Zfloor x)%R.
intros x f Hf Hxf1 Hxf2. intros x f Hf Hxf1 Hxf2.
apply sym_eq. apply sym_eq.
...@@ -100,7 +100,7 @@ Qed. ...@@ -100,7 +100,7 @@ Qed.
Theorem MinOrMax_ulp_pred: Theorem MinOrMax_ulp_pred:
forall x f, format f -> forall x f, format f ->
(0 < f)%R -> (0 < f)%R ->
(Rabs (f-x) < ulp (pred beta (FLX_exp prec) f))%R -> (Rabs (f-x) < ulp (pred beta (FLX_exp prec) f))%R ->
MinOrMax x f. MinOrMax x f.
intros x f Ff Zf Hf. intros x f Ff Zf Hf.
case (Rlt_or_le x f); intros Hxf2. case (Rlt_or_le x f); intros Hxf2.
...@@ -141,7 +141,7 @@ Qed. ...@@ -141,7 +141,7 @@ Qed.
Theorem implies_MinOrMax_bpow: Theorem implies_MinOrMax_bpow:
forall x f, format f -> forall x f, format f ->
f = bpow (ln_beta beta f) -> f = bpow (ln_beta beta f) ->
(Rabs (f-x) < /2* ulp f)%R -> (Rabs (f-x) < /2* ulp f)%R ->
MinOrMax x f. MinOrMax x f.
intros x f Hf1 Hf2 Hxf. intros x f Hf1 Hf2 Hxf.
...@@ -165,18 +165,18 @@ Notation u := (round beta (FLX_exp prec) (Znearest choice) (t+y)). ...@@ -165,18 +165,18 @@ Notation u := (round beta (FLX_exp prec) (Znearest choice) (t+y)).
(* (*
Axpy_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4 => abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4
=> abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4 => abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
Axpy_aux1_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_aux1_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Fnormal?(b)(t) => radix*abs(t) <= Fpred(b)(u) => Fnormal?(b)(t) => radix*abs(t) <= Fpred(b)(u)
=> abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4 => abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4
Axpy_aux1_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_aux1_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Fsubnormal?(b)(t) => 1-dExp(b) <= Fexp(Fpred(b)(u)) => Fsubnormal?(b)(t) => 1-dExp(b) <= Fexp(Fpred(b)(u))
=> abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4 => abs(t-a*x) <= Fulp(b)(Fpred(b)(u))/4
Axpy_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Fsubnormal?(b)(t) => u=t+y => Fsubnormal?(b)(t) => u=t+y
...@@ -185,7 +185,7 @@ Axpy_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u ...@@ -185,7 +185,7 @@ Axpy_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
Axpy_aux3 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_aux3 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Fsubnormal?(b)(t) => Fsubnormal?(b)(t)
=> -dExp(b) = Fexp(Fpred(b)(u)) => 1-dExp(b) <= Fexp(u) => -dExp(b) = Fexp(Fpred(b)(u)) => 1-dExp(b) <= Fexp(u)
=> abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4 => abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
...@@ -196,29 +196,29 @@ AxpyPos : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u ...@@ -196,29 +196,29 @@ AxpyPos : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4 => abs(y1-y+a1*x1-a*x) < Fulp(b)(Fpred(b)(u))/4
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
Axpy_opt_aux1_aux1 : lemma Fnormal?(b)(t) => Fnormal?(b)(u) => 0 < u Axpy_opt_aux1_aux1 : lemma Fnormal?(b)(t) => Fnormal?(b)(u) => 0 < u
=> Prec(b) >= 3 => => Prec(b) >= 3 =>
(1+radix*(1+1/(2*abs(Fnum(u))))*(1+1/abs(Fnum(Fpred(b)(u)))))/(1-1/(2*abs(Fnum(t)))) (1+radix*(1+1/(2*abs(Fnum(u))))*(1+1/abs(Fnum(Fpred(b)(u)))))/(1-1/(2*abs(Fnum(t))))
<= 1+radix+radix^(4-Prec(b)) <= 1+radix+radix^(4-Prec(b))
Axpy_opt_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_opt_aux1 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Prec(b) >= 3 => Fnormal?(b)(t) => Prec(b) >= 3 => Fnormal?(b)(t)
=> (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y) => (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y)
=> radix*abs(t) <= Fpred(b)(u) => radix*abs(t) <= Fpred(b)(u)
Axpy_opt_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_opt_aux2 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Prec(b) >= 6 => Fnormal?(b)(t) => Prec(b) >= 6 => Fnormal?(b)(t)
=> (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y) => (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y)
=> abs(y)*radix^(1-Prec(b))/(radix+1) < Fulp(b)(Fpred(b)(u)) => abs(y)*radix^(1-Prec(b))/(radix+1) < Fulp(b)(Fpred(b)(u))
Axpy_opt_aux3 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_opt_aux3 : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Prec(b) >= 3 => Fsubnormal?(b)(t) => Prec(b) >= 3 => Fsubnormal?(b)(t)
=> (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y) => (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y)
=> abs(y)*radix^(1-Prec(b))/(radix+radix/2) <= Fulp(b)(Fpred(b)(u)) => abs(y)*radix^(1-Prec(b))/(radix+radix/2) <= Fulp(b)(Fpred(b)(u))
Axpy_optPos : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u Axpy_optPos : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) => 0 < u
=> Prec(b) >= 6 => Prec(b) >= 6
=> (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y) => (radix+1+radix^(4-Prec(b)))*abs(a*x) <= abs(y)
=> abs(y1-y+a1*x1-a*x) < abs(y)*radix^(1-Prec(b))/(6*radix) => abs(y1-y+a1*x1-a*x) < abs(y)*radix^(1-Prec(b))/(6*radix)
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
...@@ -235,7 +235,7 @@ Axpy_opt : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) ...@@ -235,7 +235,7 @@ Axpy_opt : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u)
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
Axpy_simpl : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u) Axpy_simpl : lemma Closest?(b)(a*x,t) => Closest?(b)(t+y,u)
=> Prec(b) >= 24 => radix=2 => Prec(b) >= 24 => radix=2
=> (3+1/100000)*abs(a*x) <= abs(y) => (3+1/100000)*abs(a*x) <= abs(y)
=> abs(y1-y+a1*x1-a*x) < abs(y)*2^(1-Prec(b))/12 => abs(y1-y+a1*x1-a*x) < abs(y)*2^(1-Prec(b))/12
=> MinOrMax?(y1+a1*x1,u) => MinOrMax?(y1+a1*x1,u)
......
...@@ -177,7 +177,7 @@ apply round_generic... ...@@ -177,7 +177,7 @@ apply round_generic...
apply sym_eq, sqrt_lem_1. apply sym_eq, sqrt_lem_1.
apply bpow_ge_0. apply bpow_ge_0.
now left. now left.
rewrite Hx at 1. rewrite Hx at 1.
rewrite Rmult_comm; rewrite Hx at 1. rewrite Rmult_comm; rewrite Hx at 1.
apply trans_eq with ((sqrt (Z2R beta)*sqrt (Z2R beta)) * (bpow (ln_beta beta x-1)*bpow (ln_beta beta x-1))). apply trans_eq with ((sqrt (Z2R beta)*sqrt (Z2R beta)) * (bpow (ln_beta beta x-1)*bpow (ln_beta beta x-1))).
ring. ring.
...@@ -188,7 +188,7 @@ replace (x*x) with (bpow (2 * ln_beta beta x - 1)). ...@@ -188,7 +188,7 @@ replace (x*x) with (bpow (2 * ln_beta beta x - 1)).
apply sym_eq, round_generic... apply sym_eq, round_generic...
apply generic_format_bpow. apply generic_format_bpow.
unfold FLX_exp; omega. unfold FLX_exp; omega.
apply sym_eq; rewrite Hx at 1. apply sym_eq; rewrite Hx at 1.
rewrite Rmult_comm; rewrite Hx at 1. rewrite Rmult_comm; rewrite Hx at 1.
apply trans_eq with ((sqrt (Z2R beta)*sqrt (Z2R beta)) * (bpow (ln_beta beta x-1)*bpow (ln_beta beta x-1))). apply trans_eq with ((sqrt (Z2R beta)*sqrt (Z2R beta)) * (bpow (ln_beta beta x-1)*bpow (ln_beta beta x-1))).
ring. ring.
...@@ -426,7 +426,7 @@ apply Rle_ge; auto with real. ...@@ -426,7 +426,7 @@ apply Rle_ge; auto with real.
Qed. Qed.
Lemma ulp_sqr_ulp_lt: forall u, 0 < u -> Lemma ulp_sqr_ulp_lt: forall u, 0 < u ->
(u < sqrt (Z2R (radix_val beta)) * bpow (ln_beta beta u-1)) -> (u < sqrt (Z2R (radix_val beta)) * bpow (ln_beta beta u-1)) ->
ulp_flx (u * u) + ulp_flx u * ulp_flx u / 2 < 2 * u * ulp_flx u. ulp_flx (u * u) + ulp_flx u * ulp_flx u / 2 < 2 * u * ulp_flx u.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
...@@ -726,7 +726,7 @@ intros Hb. ...@@ -726,7 +726,7 @@ intros Hb.
apply Rle_lt_trans with (sqrt (Z2R beta) * bpow (ln_beta beta x - 1) apply Rle_lt_trans with (sqrt (Z2R beta) * bpow (ln_beta beta x - 1)
- Z2R k * ulp_flx x). - Z2R k * ulp_flx x).
unfold ulp, canonic_exp, FLX_exp. unfold ulp, canonic_exp, FLX_exp.
apply Rle_trans with (bpow (ln_beta beta x - 1) apply Rle_trans with (bpow (ln_beta beta x - 1)
*(sqrt (Z2R beta) -Z2R k * bpow (1-prec))). *(sqrt (Z2R beta) -Z2R k * bpow (1-prec))).
rewrite <- (Rmult_1_r (bpow (ln_beta beta x - 1))) at 1. rewrite <- (Rmult_1_r (bpow (ln_beta beta x - 1))) at 1.
apply Rmult_le_compat_l. apply Rmult_le_compat_l.
...@@ -869,7 +869,7 @@ Qed. ...@@ -869,7 +869,7 @@ Qed.
Theorem round_flx_sqr_sqrt_aux1: Theorem round_flx_sqr_sqrt_aux1:
(/ 2 * bpow (ln_beta beta x) < (/ 2 * bpow (ln_beta beta x) <
(2 * Z2R k + 1) * x - (2 * Z2R k + 1) * x -
(Z2R k + / 2) * (Z2R k + / 2) * bpow (ln_beta beta x - prec)) -> (Z2R k + / 2) * (Z2R k + / 2) * bpow (ln_beta beta x - prec)) ->
...@@ -927,7 +927,7 @@ apply Rlt_le_trans with (x*x - /2*bpow (2 * ln_beta beta x - prec)). ...@@ -927,7 +927,7 @@ apply Rlt_le_trans with (x*x - /2*bpow (2 * ln_beta beta x - prec)).
unfold ulp, canonic_exp, FLX_exp. unfold ulp, canonic_exp, FLX_exp.
apply Rplus_lt_reg_r with (-x*x). apply Rplus_lt_reg_r with (-x*x).
apply Rle_lt_trans with apply Rle_lt_trans with
(- (bpow (ln_beta beta x - prec)*((2*Z2R k +1)*x - (- (bpow (ln_beta beta x - prec)*((2*Z2R k +1)*x -
(Z2R k + / 2)* (Z2R k + / 2) * bpow (ln_beta beta x - prec)))). (Z2R k + / 2)* (Z2R k + / 2) * bpow (ln_beta beta x - prec)))).
right; field. right; field.
apply Rlt_le_trans with (- (bpow (ln_beta beta x - prec)* apply Rlt_le_trans with (- (bpow (ln_beta beta x - prec)*
...@@ -936,11 +936,11 @@ apply Ropp_lt_contravar. ...@@ -936,11 +936,11 @@ apply Ropp_lt_contravar.
apply Rmult_lt_compat_l. apply Rmult_lt_compat_l.
apply bpow_gt_0. apply bpow_gt_0.
exact V. exact V.
right; apply trans_eq with right; apply trans_eq with
((-/2)*(bpow (ln_beta beta x - prec)*bpow (ln_beta beta x))). ((-/2)*(bpow (ln_beta beta x - prec)*bpow (ln_beta beta x))).
ring. ring.
rewrite <- bpow_plus. rewrite <- bpow_plus.
apply trans_eq with apply trans_eq with
((-/2)*bpow (2 * ln_beta beta x - prec)). ((-/2)*bpow (2 * ln_beta beta x - prec)).
apply f_equal. apply f_equal.
apply f_equal; ring. apply f_equal; ring.
...@@ -1002,7 +1002,7 @@ intros Hb. ...@@ -1002,7 +1002,7 @@ intros Hb.
apply Rle_antisym. apply Rle_antisym.
(* . *) (* . *)
apply round_flx_sqr_sqrt_le... apply round_flx_sqr_sqrt_le...
(* . *) (* . *)
assert (((radix_val beta = 2)%Z \/ (radix_val beta=3)%Z) \/ (radix_val beta=4)%Z). assert (((radix_val beta = 2)%Z \/ (radix_val beta=3)%Z) \/ (radix_val beta=4)%Z).
generalize (radix_gt_1 beta); omega. generalize (radix_gt_1 beta); omega.
destruct H. destruct H.
...@@ -1014,7 +1014,7 @@ omega. ...@@ -1014,7 +1014,7 @@ omega.
apply radix_gt_0. apply radix_gt_0.
apply Rlt_le_trans with (x-/4*bpow (ln_beta beta x - prec)). apply Rlt_le_trans with (x-/4*bpow (ln_beta beta x - prec)).
2: right; simpl; field. 2: right; simpl; field.
apply Rle_lt_trans with (sqrt (Z2R beta) * bpow (ln_beta beta x - 1) apply Rle_lt_trans with (sqrt (Z2R beta) * bpow (ln_beta beta x - 1)
- / 4 * bpow (ln_beta beta x - prec)). - / 4 * bpow (ln_beta beta x - prec)).
2: apply Rplus_lt_compat_r; assumption. 2: apply Rplus_lt_compat_r; assumption.
apply Rle_trans with ((Z2R beta / 2)*bpow (ln_beta beta x-1)). apply Rle_trans with ((Z2R beta / 2)*bpow (ln_beta beta x-1)).
...@@ -1174,7 +1174,7 @@ Qed. ...@@ -1174,7 +1174,7 @@ Qed.
(* (*
Theorem round_flx_sqr_sqrt_aux: (4 < radix_val beta)%Z Theorem round_flx_sqr_sqrt_aux: (4 < radix_val beta)%Z
(sqrt (Z2R (radix_val beta)) * bpow (ln_beta beta x-1) < x) -> (sqrt (Z2R (radix_val beta)) * bpow (ln_beta beta x-1) < x) ->
round_flx(x/z) <= 1. round_flx(x/z) <= 1.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
...@@ -1266,7 +1266,7 @@ unfold Rdiv; apply Rmult_le_pos; try assumption. ...@@ -1266,7 +1266,7 @@ unfold Rdiv; apply Rmult_le_pos; try assumption.
left; apply Rinv_0_lt_compat. left; apply Rinv_0_lt_compat.
apply Rlt_le_trans with (1:=H0); exact H. apply Rlt_le_trans with (1:=H0); exact H.
(* *) (* *)
apply Rle_trans with apply Rle_trans with
(round_flx (x / round_flx (sqrt (round_flx (x * x))))). (round_flx (x / round_flx (sqrt (round_flx (x * x))))).
apply round_le... apply round_le...
unfold Rdiv; apply Rmult_le_compat_l; try exact Hx. unfold Rdiv; apply Rmult_le_compat_l; try exact Hx.
...@@ -1297,7 +1297,7 @@ apply Rle_trans with 0. ...@@ -1297,7 +1297,7 @@ apply Rle_trans with 0.
auto with real. auto with real.
now apply Muller_pos. now apply Muller_pos.
now apply Muller_pos. now apply Muller_pos.
replace replace
(x / round_flx (sqrt (round_flx (round_flx (x * x) + round_flx (y * y))))) with (x / round_flx (sqrt (round_flx (round_flx (x * x) + round_flx (y * y))))) with
(-(((-x) / round_flx (sqrt (round_flx (round_flx ((-x) * (-x)) + round_flx (y * y))))))). (-(((-x) / round_flx (sqrt (round_flx (round_flx ((-x) * (-x)) + round_flx (y * y))))))).
rewrite round_NE_opp. rewrite round_NE_opp.
......
...@@ -17,7 +17,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ...@@ -17,7 +17,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details. COPYING file for more details.
*) *)
(** * Rounding to odd and its properties, including the equivalence (** * Rounding to odd and its properties, including the equivalence
between rnd_NE and double rounding with rnd_odd and then rnd_NE *) between rnd_NE and double rounding with rnd_odd and then rnd_NE *)
...@@ -30,7 +30,7 @@ Definition Zrnd_odd x := match Req_EM_T x (Z2R (Zfloor x)) with ...@@ -30,7 +30,7 @@ Definition Zrnd_odd x := match Req_EM_T x (Z2R (Zfloor x)) with
| true => Zceil x | true => Zceil x
| false => Zfloor x | false => Zfloor x
end end
end. end.
...@@ -273,7 +273,7 @@ rewrite <- H0. ...@@ -273,7 +273,7 @@ rewrite <- H0.
repeat split; try assumption. repeat split; try assumption.
apply trans_eq with (negb (Zeven (Zfloor (scaled_mantissa beta fexp x)))). apply trans_eq with (negb (Zeven (Zfloor (scaled_mantissa beta fexp x)))).
2: rewrite H1; reflexivity. 2: rewrite H1; reflexivity.
apply trans_eq with (negb (Zeven (Fnum apply trans_eq with (negb (Zeven (Fnum
(Float beta (Zfloor (scaled_mantissa beta fexp x)) (cexp x))))). (Float beta (Zfloor (scaled_mantissa beta fexp x)) (cexp x))))).
2: reflexivity. 2: reflexivity.
case (Rle_lt_or_eq_dec 0 (round beta fexp Zfloor x)). case (Rle_lt_or_eq_dec 0 (round beta fexp Zfloor x)).
...@@ -389,13 +389,13 @@ Qed. ...@@ -389,13 +389,13 @@ Qed.
Lemma exists_even_fexp_lt: forall (c:Z->Z), forall (x:R), Lemma exists_even_fexp_lt: forall (c:Z->Z), forall (x:R),
(exists f:float beta, F2R f = x /\ (c (ln_beta beta x) < Fexp f)%Z) -> (exists f:float beta, F2R f = x /\ (c (ln_beta beta x) < Fexp f)%Z) ->
exists f:float beta, F2R f =x /\ canonic beta c f /\ Zeven (Fnum f) = true. exists f:float beta, F2R f =x /\ canonic beta c f /\ Zeven (Fnum f) = true.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros c x (g,(Hg1,Hg2)). intros c x (g,(Hg1,Hg2)).
exists (Float beta exists (Float beta
(Fnum g*Z.pow (radix_val beta) (Fexp g - c (ln_beta beta x))) (Fnum g*Z.pow (radix_val beta) (Fexp g - c (ln_beta beta x)))
(c (ln_beta beta x))). (c (ln_beta beta x))).
assert (F2R (Float beta assert (F2R (Float beta
(Fnum g*Z.pow (radix_val beta) (Fexp g - c (ln_beta beta x))) (Fnum g*Z.pow (radix_val beta) (Fexp g - c (ln_beta beta x)))
(c (ln_beta beta x))) = x). (c (ln_beta beta x))) = x).
unfold F2R; simpl. unfold F2R; simpl.
...@@ -458,7 +458,7 @@ Qed. ...@@ -458,7 +458,7 @@ Qed.
Lemma ln_beta_d: (0< F2R d)%R -> Lemma ln_beta_d: (0< F2R d)%R ->
(ln_beta beta (F2R d) = ln_beta beta x :>Z). (ln_beta beta (F2R d) = ln_beta beta x :>Z).
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -475,7 +475,7 @@ Qed. ...@@ -475,7 +475,7 @@ Qed.
Lemma format_bpow_x: (0 < F2R d)%R Lemma format_bpow_x: (0 < F2R d)%R
-> generic_format beta fexp (bpow (ln_beta beta x)). -> generic_format beta fexp (bpow (ln_beta beta x)).
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -584,7 +584,7 @@ unfold m; rewrite <- H0; field. ...@@ -584,7 +584,7 @@ unfold m; rewrite <- H0; field.
Qed. Qed.
Lemma ln_beta_m_0: (0 = F2R d)%R Lemma ln_beta_m_0: (0 = F2R d)%R
-> (ln_beta beta m =ln_beta beta (F2R u)-1:>Z)%Z. -> (ln_beta beta m =ln_beta beta (F2R u)-1:>Z)%Z.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -634,7 +634,7 @@ Qed. ...@@ -634,7 +634,7 @@ Qed.
Lemma m_eq: (0 < F2R d)%R -> exists f:float beta, Lemma m_eq: (0 < F2R d)%R -> exists f:float beta,
F2R f = m /\ (Fexp f = fexp (ln_beta beta x) -1)%Z. F2R f = m /\ (Fexp f = fexp (ln_beta beta x) -1)%Z.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -664,7 +664,7 @@ now rewrite Fexp_d. ...@@ -664,7 +664,7 @@ now rewrite Fexp_d.
rewrite Hu'2; omega. rewrite Hu'2; omega.
Qed. Qed.
Lemma m_eq_0: (0 = F2R d)%R -> exists f:float beta, Lemma m_eq_0: (0 = F2R d)%R -> exists f:float beta,
F2R f = m /\ (Fexp f = fexp (ln_beta beta (F2R u)) -1)%Z. F2R f = m /\ (Fexp f = fexp (ln_beta beta (F2R u)) -1)%Z.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -688,7 +688,7 @@ destruct u; reflexivity. ...@@ -688,7 +688,7 @@ destruct u; reflexivity.
rewrite Zplus_comm, Cu; unfold Zminus; now apply f_equal2. rewrite Zplus_comm, Cu; unfold Zminus; now apply f_equal2.
Qed. Qed.
Lemma fexp_m_eq_0: (0 = F2R d)%R -> Lemma fexp_m_eq_0: (0 = F2R d)%R ->
(fexp (ln_beta beta (F2R u)-1) < fexp (ln_beta beta (F2R u))+1)%Z. (fexp (ln_beta beta (F2R u)-1) < fexp (ln_beta beta (F2R u))+1)%Z.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
intros Y. intros Y.
...@@ -803,7 +803,7 @@ Qed. ...@@ -803,7 +803,7 @@ Qed.
Theorem round_odd_prop_pos: Theorem round_odd_prop_pos:
round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) = round beta fexp (Znearest choice) (round beta fexpe Zrnd_odd x) =
round beta fexp (Znearest choice) x. round beta fexp (Znearest choice) x.
Proof with auto with typeclass_instances. Proof with auto with typeclass_instances.
set (o:=round beta fexpe Zrnd_odd x). set (o:=round beta fexpe Zrnd_odd x).
...@@ -928,7 +928,7 @@ Context { exists_NE_e : Exists_NE beta fexpe }. (* for defining rounding to odd ...@@ -928,7 +928,7 @@ Context { exists_NE_e : Exists_NE beta fexpe }. (* for defining rounding to odd
Hypothesis fexpe_fexp: forall e, (fexpe e <= fexp e -2)%Z. Hypothesis fexpe_fexp: forall e, (fexpe e <= fexp e -2)%Z.
Theorem canonizer: forall f, generic_format beta fexp f Theorem canonizer: forall f, generic_format beta fexp f