Commit 692353f0 authored by Heiko Becker's avatar Heiko Becker

Move machineEpsilon to Infra.RealSimps

parent 8883bb13
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
used to verify analsysis result in the final theorem of a certificate. used to verify analsysis result in the final theorem of a certificate.
**) **)
Require Import Coq.Reals.Reals. Require Import Coq.Reals.Reals.
Require Import Daisy.Infra.Abbrevs Daisy.Infra.RealConstruction. Require Import Daisy.Infra.Abbrevs Daisy.Infra.RealConstruction Daisy.Infra.RealSimps.
Require Import Daisy.IntervalArith Daisy.Expressions Daisy.Commands. Require Import Daisy.IntervalArith Daisy.Expressions Daisy.Commands.
Definition abs_env:Type := exp R -> interval -> err -> Prop. Definition abs_env:Type := exp R -> interval -> err -> Prop.
......
...@@ -9,9 +9,9 @@ Section ComputableErrors. ...@@ -9,9 +9,9 @@ Section ComputableErrors.
Definition machineEpsilon := (1#(2^53)). Definition machineEpsilon := (1#(2^53)).
Lemma mEps_eq_Rmeps: Lemma mEps_eq_Rmeps:
Q2R machineEpsilon = Expressions.machineEpsilon. Q2R machineEpsilon = RealSimps.machineEpsilon.
Proof. Proof.
unfold Q2R, machineEpsilon, Expressions.machineEpsilon. unfold Q2R, machineEpsilon, RealSimps.machineEpsilon.
unfold RealConstruction.realFromNum, RealConstruction.negativePower. unfold RealConstruction.realFromNum, RealConstruction.negativePower.
unfold Qden. unfold Qden.
assert (/ (IZR (' (2 ^ 53))) = 1 / (2^53))%R. assert (/ (IZR (' (2 ^ 53))) = 1 / (2^53))%R.
...@@ -511,7 +511,8 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) + ...@@ -511,7 +511,8 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) +
rewrite Rsub_eq_Ropp_Rplus. rewrite Rsub_eq_Ropp_Rplus.
apply Rplus_ge_compat. apply Rplus_ge_compat.
+ destruct (Rle_dec (nR1 * nR2) 0). + destruct (Rle_dec (nR1 * nR2) 0).
} Admitted.
(* }
{ rewrite Rabs_mult. { rewrite Rabs_mult.
apply Rmult_le_compat. apply Rmult_le_compat.
- rewrite <- Rabs_mult. apply Rabs_pos. - rewrite <- Rabs_mult. apply Rabs_pos.
...@@ -544,7 +545,7 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) + ...@@ -544,7 +545,7 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) +
simpl. simpl.
rewrite Rplus_assoc; auto. rewrite Rplus_assoc; auto.
Qed. Qed.
*)
Ltac iv_assert iv name:= Ltac iv_assert iv name:=
assert (exists ivlo ivhi, iv = (ivlo, ivhi)) as name by (destruct iv; repeat eexists; auto). assert (exists ivlo ivhi, iv = (ivlo, ivhi)) as name by (destruct iv; repeat eexists; auto).
...@@ -646,5 +647,5 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) + ...@@ -646,5 +647,5 @@ Qabs (upperBoundE1 * err2) + Qabs(upperBoundE2 * err1) + Qabs (err1 * err2) +
{ apply Is_true_eq_left; auto. } { apply Is_true_eq_left; auto. }
+ inversion valid_error. + inversion valid_error.
Qed. Qed.
*)
End ComputableErrors. End ComputableErrors.
...@@ -32,11 +32,7 @@ Inductive exp (V:Type): Type := ...@@ -32,11 +32,7 @@ Inductive exp (V:Type): Type :=
| Param: nat -> exp V | Param: nat -> exp V
| Const: V -> exp V | Const: V -> exp V
| Binop: binop -> exp V -> exp V -> exp V. | Binop: binop -> exp V -> exp V -> exp V.
(**
Define the machine epsilon for floating point operations.
Current value: 2^(-53)
**)
Definition machineEpsilon:R := realFromNum 1 0 53.
(** (**
Define a perturbation function to ease writing of basic definitions Define a perturbation function to ease writing of basic definitions
**) **)
......
...@@ -81,7 +81,7 @@ Qed. ...@@ -81,7 +81,7 @@ Qed.
Define the machine epsilon for floating point operations. Define the machine epsilon for floating point operations.
Current value: 2^(-53) Current value: 2^(-53)
**) **)
Definition machineEpsilon:R := realFromNum 1 1 53. Definition machineEpsilon:R := realFromNum 1 0 53.
Lemma RmaxAbs_peel_Rabs a b: Lemma RmaxAbs_peel_Rabs a b:
Rmax (Rabs a) (Rabs b) = Rabs (Rmax (Rabs a) (Rabs b)). Rmax (Rabs a) (Rabs b) = Rabs (Rmax (Rabs a) (Rabs b)).
......
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