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
948cba2c
Commit
948cba2c
authored
Oct 11, 2010
by
Guillaume Melquiond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added round_N_middle.
parent
bb8e0d1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
src/Core/Fcore_generic_fmt.v
src/Core/Fcore_generic_fmt.v
+26
-0
No files found.
src/Core/Fcore_generic_fmt.v
View file @
948cba2c
...
...
@@ -1401,6 +1401,32 @@ apply Rle_trans with (1 := H).
apply
Rmin_r
.
Qed
.
Theorem
round_N_middle
:
forall
x
,
(
x
-
round
rndDN
x
=
round
rndUP
x
-
x
)
%
R
->
round
rndN
x
=
if
choice
(
scaled_mantissa
x
)
then
round
rndUP
x
else
round
rndDN
x
.
Proof
.
intros
x
.
pattern
x
at
1
4
;
rewrite
<-
scaled_mantissa_bpow
.
unfold
round
,
rndN
,
Znearest
,
F2R
.
simpl
.
destruct
(
Req_dec
(
Z2R
(
Zfloor
(
scaled_mantissa
x
)))
(
scaled_mantissa
x
))
as
[
Fx
|
Fx
].
(
*
*
)
intros
_.
rewrite
<-
Fx
.
rewrite
Zceil_Z2R
,
Zfloor_Z2R
.
set
(
m
:=
Zfloor
(
scaled_mantissa
x
)).
now
case
(
Rcompare
(
Z2R
m
-
Z2R
m
)
(
/
2
))
;
case
(
choice
(
Z2R
m
)).
(
*
*
)
intros
H
.
rewrite
Rcompare_floor_ceil_mid
with
(
1
:=
Fx
).
rewrite
Rcompare_Eq
.
now
case
(
choice
(
scaled_mantissa
x
)).
apply
Rmult_eq_reg_r
with
(
bpow
(
canonic_exponent
x
)).
now
rewrite
2
!
Rmult_minus_distr_r
.
apply
Rgt_not_eq
.
apply
bpow_gt_0
.
Qed
.
End
Znearest
.
Section
rndN_opp
.
...
...
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