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
88a7663e
Commit
88a7663e
authored
May 17, 2010
by
Guillaume Melquiond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added rounding for most directions.
parent
aa2b17eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
src/Calc/Fcalc_round.v
src/Calc/Fcalc_round.v
+61
-0
src/Makefile.am
src/Makefile.am
+1
-0
No files found.
src/Calc/Fcalc_round.v
0 → 100644
View file @
88a7663e
Require
Import
Fcore
.
Require
Import
Fcalc_bracket
.
Require
Import
Fcalc_digits
.
Section
Fcalc_round
.
Variable
beta
:
radix
.
Notation
bpow
e
:=
(
bpow
beta
e
).
Variable
fexp
:
Z
->
Z
.
Hypothesis
prop_exp
:
valid_exp
fexp
.
Notation
format
:=
(
generic_format
beta
fexp
).
Theorem
round_DN_correct
:
forall
x
m
e
l
,
inbetween_float
beta
m
e
x
l
/
\
(
e
=
canonic_exponent
beta
fexp
x
\
/
(
l
=
loc_Exact
/
\
format
x
))
->
rounding
beta
fexp
ZrndDN
x
=
F2R
(
Float
beta
m
e
).
Proof
.
intros
x
m
e
l
(
Hin
,[
He
|
(
Hl
,
Hf
)]).
rewrite
He
in
Hin
|-
*
.
apply
inbetween_float_DN
with
(
1
:=
Hin
).
rewrite
Hl
in
Hin
.
inversion_clear
Hin
.
rewrite
<-
H
.
now
apply
rounding_generic
.
Qed
.
Theorem
round_UP_correct
:
forall
x
m
e
l
,
inbetween_float
beta
m
e
x
l
/
\
(
e
=
canonic_exponent
beta
fexp
x
\
/
(
l
=
loc_Exact
/
\
format
x
))
->
rounding
beta
fexp
ZrndUP
x
=
F2R
(
Float
beta
(
cond_incr
(
round_UP
l
)
m
)
e
).
Proof
.
intros
x
m
e
l
(
Hin
,[
He
|
(
Hl
,
Hf
)]).
rewrite
He
in
Hin
|-
*
.
apply
inbetween_float_UP
with
(
1
:=
Hin
).
rewrite
Hl
in
Hin
.
inversion_clear
Hin
.
rewrite
Hl
.
simpl
.
rewrite
<-
H
.
now
apply
rounding_generic
.
Qed
.
Theorem
round_NE_correct
:
forall
x
m
e
l
,
inbetween_float
beta
m
e
x
l
/
\
(
e
=
canonic_exponent
beta
fexp
x
\
/
(
l
=
loc_Exact
/
\
format
x
))
->
rounding
beta
fexp
ZrndNE
x
=
F2R
(
Float
beta
(
cond_incr
(
round_NE
(
Zeven
m
)
l
)
m
)
e
).
Proof
.
intros
x
m
e
l
(
Hin
,[
He
|
(
Hl
,
Hf
)]).
rewrite
He
in
Hin
|-
*
.
apply
inbetween_float_NE
with
(
1
:=
Hin
).
rewrite
Hl
in
Hin
.
inversion_clear
Hin
.
rewrite
Hl
.
simpl
.
rewrite
<-
H
.
now
apply
rounding_generic
.
Qed
.
End
Fcalc_round
.
\ No newline at end of file
src/Makefile.am
View file @
88a7663e
...
@@ -15,6 +15,7 @@ FILES = \
...
@@ -15,6 +15,7 @@ FILES = \
Calc/Fcalc_digits.v
\
Calc/Fcalc_digits.v
\
Calc/Fcalc_div.v
\
Calc/Fcalc_div.v
\
Calc/Fcalc_ops.v
\
Calc/Fcalc_ops.v
\
Calc/Fcalc_round.v
\
Calc/Fcalc_round_FIX.v
\
Calc/Fcalc_round_FIX.v
\
Calc/Fcalc_sqrt.v
\
Calc/Fcalc_sqrt.v
\
Prop/Fprop_nearest.v
Prop/Fprop_nearest.v
...
...
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