Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flocq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Flocq
flocq
Commits
c541aaa6
Commit
c541aaa6
authored
Sep 22, 2010
by
Guillaume Melquiond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some theorems about scaled_mantissa.
parent
b3e635ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
32 deletions
+44
-32
src/Core/Fcore_generic_fmt.v
src/Core/Fcore_generic_fmt.v
+44
-32
No files found.
src/Core/Fcore_generic_fmt.v
View file @
c541aaa6
...
@@ -32,16 +32,6 @@ Definition scaled_mantissa x :=
...
@@ -32,16 +32,6 @@ Definition scaled_mantissa x :=
Definition
generic_format
(
x
:
R
)
:=
Definition
generic_format
(
x
:
R
)
:=
x
=
F2R
(
Float
beta
(
Ztrunc
(
scaled_mantissa
x
))
(
canonic_exponent
x
)).
x
=
F2R
(
Float
beta
(
Ztrunc
(
scaled_mantissa
x
))
(
canonic_exponent
x
)).
(
*
Theorem
canonic_mantissa_0
:
canonic_mantissa
0
=
Z0
.
Proof
.
unfold
canonic_mantissa
.
rewrite
Rmult_0_l
.
exact
(
Zfloor_Z2R
0
).
Qed
.
*
)
Theorem
generic_format_0
:
Theorem
generic_format_0
:
generic_format
0.
generic_format
0.
Proof
.
Proof
.
...
@@ -60,28 +50,6 @@ unfold canonic_exponent.
...
@@ -60,28 +50,6 @@ unfold canonic_exponent.
now
rewrite
ln_beta_opp
.
now
rewrite
ln_beta_opp
.
Qed
.
Qed
.
(
*
Theorem
canonic_mantissa_opp
:
forall
x
,
generic_format
x
->
canonic_mantissa
(
-
x
)
=
(
-
canonic_mantissa
x
)
%
Z
.
Proof
.
unfold
generic_format
,
canonic_mantissa
.
intros
x
Hx
.
rewrite
canonic_exponent_opp
.
rewrite
Hx
at
1
3.
generalize
(
canonic_exponent
x
).
intros
e
.
clear
.
unfold
F2R
.
simpl
.
rewrite
Ropp_mult_distr_l_reverse
.
rewrite
Rmult_assoc
,
<-
bpow_add
,
Zplus_opp_r
.
rewrite
Rmult_1_r
.
rewrite
<-
opp_Z2R
.
now
rewrite
2
!
Zfloor_Z2R
.
Qed
.
*
)
Theorem
canonic_exponent_abs
:
Theorem
canonic_exponent_abs
:
forall
x
,
forall
x
,
canonic_exponent
(
Rabs
x
)
=
canonic_exponent
x
.
canonic_exponent
(
Rabs
x
)
=
canonic_exponent
x
.
...
@@ -179,6 +147,12 @@ rewrite Rmult_assoc, <- bpow_add, Zplus_opp_l.
...
@@ -179,6 +147,12 @@ rewrite Rmult_assoc, <- bpow_add, Zplus_opp_l.
apply
Rmult_1_r
.
apply
Rmult_1_r
.
Qed
.
Qed
.
Theorem
scaled_mantissa_0
:
scaled_mantissa
0
=
R0
.
Proof
.
apply
Rmult_0_l
.
Qed
.
Theorem
scaled_mantissa_opp
:
Theorem
scaled_mantissa_opp
:
forall
x
,
forall
x
,
scaled_mantissa
(
-
x
)
=
(
-
scaled_mantissa
x
)
%
R
.
scaled_mantissa
(
-
x
)
=
(
-
scaled_mantissa
x
)
%
R
.
...
@@ -189,6 +163,19 @@ rewrite canonic_exponent_opp.
...
@@ -189,6 +163,19 @@ rewrite canonic_exponent_opp.
now
rewrite
Ropp_mult_distr_l_reverse
.
now
rewrite
Ropp_mult_distr_l_reverse
.
Qed
.
Qed
.
Theorem
scaled_mantissa_abs
:
forall
x
,
scaled_mantissa
(
Rabs
x
)
=
Rabs
(
scaled_mantissa
x
).
Proof
.
intros
x
.
unfold
scaled_mantissa
.
rewrite
canonic_exponent_abs
,
Rabs_mult
.
apply
f_equal
.
apply
sym_eq
.
apply
Rabs_pos_eq
.
apply
bpow_ge_0
.
Qed
.
Theorem
generic_format_opp
:
Theorem
generic_format_opp
:
forall
x
,
generic_format
x
->
generic_format
(
-
x
).
forall
x
,
generic_format
x
->
generic_format
(
-
x
).
Proof
.
Proof
.
...
@@ -243,6 +230,31 @@ apply Rlt_le_trans with (1 := proj2 Hx).
...
@@ -243,6 +230,31 @@ apply Rlt_le_trans with (1 := proj2 Hx).
now
apply
->
bpow_le
.
now
apply
->
bpow_le
.
Qed
.
Qed
.
Theorem
scaled_mantissa_small
:
forall
x
ex
,
(
Rabs
x
<
bpow
ex
)
%
R
->
(
ex
<=
fexp
ex
)
%
Z
->
(
Rabs
(
scaled_mantissa
x
)
<
1
)
%
R
.
Proof
.
intros
x
ex
Ex
He
.
destruct
(
Req_dec
x
0
)
as
[
Zx
|
Zx
].
rewrite
Zx
,
scaled_mantissa_0
,
Rabs_R0
.
now
apply
(
Z2R_lt
0
1
).
rewrite
<-
scaled_mantissa_abs
.
unfold
scaled_mantissa
.
rewrite
canonic_exponent_abs
.
unfold
canonic_exponent
.
destruct
(
ln_beta
beta
x
)
as
(
ex
'
,
Ex
'
).
simpl
.
specialize
(
Ex
'
Zx
).
apply
(
mantissa_small_pos
_
_
Ex
'
).
assert
(
ex
'
<=
fexp
ex
)
%
Z
.
apply
Zle_trans
with
(
2
:=
He
).
apply
bpow_lt_bpow
with
beta
.
now
apply
Rle_lt_trans
with
(
2
:=
Ex
).
now
rewrite
(
proj2
(
proj2
(
prop_exp
_
)
He
)).
Qed
.
Theorem
mantissa_DN_small_pos
:
Theorem
mantissa_DN_small_pos
:
forall
x
ex
,
forall
x
ex
,
(
bpow
(
ex
-
1
)
<=
x
<
bpow
ex
)
%
R
->
(
bpow
(
ex
-
1
)
<=
x
<
bpow
ex
)
%
R
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment