Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
This file is part of the Flocq formalization of floating-point arithmetic in Coq: http://flocq.gforge.inria.fr/
Copyright (C) 2010-2018 Sylvie Boldo
Copyright (C) 2010-2018 Guillaume Melquiond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details.

Helper function for computing the rounded value of a real number.

Require Import Core Digits Float_prop Bracket.

Section Fcalc_round.

Variable beta : radix.
Notation bpow e := (bpow beta e).

Section Fcalc_round_fexp.

Variable fexp : Z -> Z.
Context { valid_exp : Valid_exp fexp }.
Notation format := (generic_format beta fexp).

beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z -> cexp beta fexp x = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z -> cexp beta fexp x = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

cexp beta fexp x = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

fexp (mag beta x) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

fexp (mag beta x) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

(0 <= m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
Hm:(0 <= m)%Z
fexp (mag beta x) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

(0 <= m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

(0 < Z.succ m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

(0 < F2R {| Fnum := Z.succ m; Fexp := ?e |})%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z

(x < F2R {| Fnum := Z.succ m; Fexp := ?e |})%R
apply Bx.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
Hm:(0 <= m)%Z

fexp (mag beta x) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
Hm:(0 <= m)%Z
Hm':(0 < m)%Z

fexp (mag beta x) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Hm:(0 <= 0)%Z
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
fexp (mag beta x) = fexp (Zdigits beta 0 + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Hm:(0 <= 0)%Z
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

fexp (mag beta x) = fexp (Zdigits beta 0 + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

fexp (mag beta x) = fexp (Zdigits beta 0 + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

(mag beta x <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
Hx:(mag beta x <= e)%Z
fexp (mag beta x) = fexp (Zdigits beta 0 + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

(mag beta x <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

x <> 0%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
(Rabs x < bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

(Rabs x < bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

(x < bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R

(0 <= x)%R
now apply Rlt_le.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp (Zdigits beta 0 + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp e)%Z
Bx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z \/ (e <= fexp e)%Z
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= fexp e)%Z
Hx:(mag beta x <= e)%Z
fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= cexp beta fexp x)%Z
Hx:(mag beta x <= e)%Z

(mag beta x <= fexp (mag beta x))%Z
now apply Z.le_trans with e.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= fexp e)%Z
Hx:(mag beta x <= e)%Z

fexp (mag beta x) = fexp e
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
He:(e <= fexp e)%Z
Hx:(mag beta x <= e)%Z

(mag beta x <= fexp e)%Z
now apply Z.le_trans with e. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 <= x)%R
Bx:inbetween_float beta m e x l

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:0%R = x
Bx:inbetween_float beta m e x l
(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= cexp beta fexp x)%Z

(e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z
(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= cexp beta fexp x)%Z

(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= cexp beta fexp x)%Z
(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z
(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= cexp beta fexp x)%Z

(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z
(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z

(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z

(e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z
(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:(0 < x)%R
Bx:inbetween_float beta m e x l
H:(e <= fexp (Zdigits beta m + e))%Z

(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
now right.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:0%R = x
Bx:inbetween_float beta m e x l

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Px:0%R = x
Bx, H:inbetween_float beta m e x l

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
H0:x = F2R {| Fnum := m; Fexp := e |}
H:inbetween_float beta m e x SpecFloatCopy.loc_Exact

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx:(F2R {| Fnum := m; Fexp := e |} < x < F2R {| Fnum := m + 1; Fexp := e |})%R
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)
(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx:(F2R {| Fnum := m; Fexp := e |} < x < F2R {| Fnum := m + 1; Fexp := e |})%R
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx:(F2R {| Fnum := m; Fexp := e |} < 0 < F2R {| Fnum := m + 1; Fexp := e |})%R
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx1:(F2R {| Fnum := m; Fexp := e |} < 0)%R
Bx2:(0 < F2R {| Fnum := m + 1; Fexp := e |})%R
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx1:(m < 0)%Z
Bx2:(0 < F2R {| Fnum := m + 1; Fexp := e |})%R
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
Px:0%R = x
c:comparison
Bx1:(m < 0)%Z
Bx2:(0 < m + 1)%Z
H:inbetween_float beta m e x (SpecFloatCopy.loc_Inexact c)

(e <= cexp beta fexp x)%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact <-> (e <= fexp (Zdigits beta m + e))%Z \/ SpecFloatCopy.loc_Inexact c = SpecFloatCopy.loc_Exact
omega. Qed.
Relates location and rounding.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (rnd : R -> Z) (choice : Z -> SpecFloatCopy.location -> Z), (forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l) -> forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (rnd : R -> Z) (choice : Z -> SpecFloatCopy.location -> Z), (forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l) -> forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

(IZR (Fnum {| Fnum := rnd (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |}) * bpow (Fexp {| Fnum := rnd (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |}))%R = (IZR (Fnum {| Fnum := choice m l; Fexp := e |}) * bpow (Fexp {| Fnum := choice m l; Fexp := e |}))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

(IZR (rnd (scaled_mantissa beta fexp x)) * bpow (cexp beta fexp x))%R = (IZR (choice m l) * bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

rnd (scaled_mantissa beta fexp x) = choice m l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

inbetween_int m (scaled_mantissa beta fexp x) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

(0 < bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l
inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (scaled_mantissa beta fexp x * bpow e) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hl:inbetween_float beta m e x l

inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (scaled_mantissa beta fexp x * bpow e) l
now rewrite scaled_mantissa_mult_bpow. Qed. Definition cond_incr (b : bool) m := if b then (m + 1)%Z else m.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (rnd : R -> Z) (choice : bool -> Z -> SpecFloatCopy.location -> Z), (forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)) -> forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (rnd : R -> Z) (choice : bool -> Z -> SpecFloatCopy.location -> Z), (forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)) -> forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

Fnum {| Fnum := rnd (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = Fnum {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

rnd (scaled_mantissa beta fexp x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

rnd (scaled_mantissa beta fexp x) = SpecFloatCopy.cond_Zopp (Rlt_bool (scaled_mantissa beta fexp x) 0) (choice (Rlt_bool (scaled_mantissa beta fexp x) 0) m l)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

inbetween_int m (Rabs (scaled_mantissa beta fexp x)) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

(0 < bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * bpow e) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * bpow e) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * Rabs (bpow e)) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
(bpow e >= 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

inbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x * bpow e)) l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
(bpow e >= 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

(bpow e >= 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

(0 <= bpow e)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l

Rlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(x < 0)%R

Rlt_bool (scaled_mantissa beta fexp x) 0 = true
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R
Rlt_bool (scaled_mantissa beta fexp x) 0 = false
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(x < 0)%R

(scaled_mantissa beta fexp x < 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R
Rlt_bool (scaled_mantissa beta fexp x) 0 = false
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(x < 0)%R

(scaled_mantissa beta fexp x < 0 * bpow (- e))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R
Rlt_bool (scaled_mantissa beta fexp x) 0 = false
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(x < 0)%R

(0 < bpow (- e))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R
Rlt_bool (scaled_mantissa beta fexp x) 0 = false
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R

Rlt_bool (scaled_mantissa beta fexp x) 0 = false
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R

(0 <= scaled_mantissa beta fexp x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
choice:bool -> Z -> SpecFloatCopy.location -> Z
Hc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m:Z
l:SpecFloatCopy.location
e:=cexp beta fexp x:Z
Hx:inbetween_float beta m e (Rabs x) l
Zx:(0 <= x)%R

(0 <= bpow (- cexp beta fexp x))%R
apply bpow_ge_0. Qed.
Relates location and rounding down.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

(IZR m < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

(m < m + 1)%Z
apply Zlt_succ. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Zfloor x = F2R {| Fnum := m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Zfloor x = F2R {| Fnum := m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = m
exact inbetween_int_DN. Qed. Definition round_sign_DN s l := match l with | loc_Exact => false | _ => s end.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (if Rcase_abs x then (- x)%R else x) l

Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zfloor x = SpecFloatCopy.cond_Zopp true (cond_incr (round_sign_DN true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
H:(- x)%R = IZR m

Zfloor x = (- m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor x = (- (m + 1))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
H:(- x)%R = IZR m

Zfloor (- - x) = (- m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor x = (- (m + 1))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
H:(- x)%R = IZR m

Zfloor (IZR (- m)) = (- m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor x = (- (m + 1))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

Zfloor x = (- (m + 1))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (- (m + 1)) <= x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (- (m + 1)) <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
(x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (- (m + 1)) < x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
(x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(- IZR (m + 1) < x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
(x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(- x < - - IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
(x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(x < IZR (- (m + 1) + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(x < IZR (- m))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(x < - IZR m)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(- - IZR m < - x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Zfloor x = SpecFloatCopy.cond_Zopp false (cond_incr (round_sign_DN false l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
H:x = IZR m

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
H:x = IZR m

Zfloor (IZR m) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(IZR m <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
(x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

(0 <= x)%R
now apply Rge_le. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Zfloor x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Zfloor x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)
exact inbetween_int_DN_sign. Qed.
Relates location and rounding up.
Definition round_UP l :=
  match l with
  | loc_Exact => false
  | _ => true
  end.

beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

l = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = true
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl':l = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = true
Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl':l = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = true

Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl':l = SpecFloatCopy.loc_Exact

Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true
Zceil x = cond_incr (round_UP l) m
(* Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl':l = SpecFloatCopy.loc_Exact

Zceil x = cond_incr (round_UP SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true
Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
H:x = IZR m
Hl':SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact

Zceil x = cond_incr (round_UP SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true
Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
H:x = IZR m
Hl':SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact

Zceil (IZR m) = cond_incr (round_UP SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true
Zceil x = cond_incr (round_UP l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

Zceil x = cond_incr (round_UP l) m
(* not Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

Zceil x = cond_incr true m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

Zceil x = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

(IZR (m + 1 - 1) < x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

(IZR m < x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Hl1:l <> SpecFloatCopy.loc_Exact
Hl2:round_UP l = true

(IZR m < x < IZR (m + 1))%R
apply inbetween_bounds_not_Eq with (2 := Hl1) (1 := Hl). Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Zceil x = F2R {| Fnum := cond_incr (round_UP l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Zceil x = F2R {| Fnum := cond_incr (round_UP l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) m
exact inbetween_int_UP. Qed. Definition round_sign_UP s l := match l with | loc_Exact => false | _ => negb s end.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (if Rcase_abs x then (- x)%R else x) l

Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zceil x = SpecFloatCopy.cond_Zopp true (cond_incr (round_sign_UP true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zceil x = (- cond_incr (round_sign_UP true l) m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

(- Zfloor (- x))%Z = (- cond_incr (round_sign_UP true l) m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Zfloor (- x) = cond_incr (round_sign_UP true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
H:(- x)%R = IZR m

Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
H:(- x)%R = IZR m

Zfloor (IZR m) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(IZR m <= - x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(IZR m <= - x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0
(- x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l0:comparison
H:(IZR m < - x < IZR (m + 1))%R
H0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0

(- x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Zceil x = SpecFloatCopy.cond_Zopp false (cond_incr (round_sign_UP false l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Zceil x = cond_incr (round_sign_UP false l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
H:x = IZR m

Zceil x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
Zceil x = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
H:x = IZR m

Zceil (IZR m) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
Zceil x = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

Zceil x = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (m + 1 - 1) < x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (m + 1 - 1) < x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
(x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(IZR (Z.pred (Z.succ m)) < x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0
(x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
l0:comparison
H:(IZR m < x < IZR (m + 1))%R
H0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0

(x <= IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

(0 <= x)%R
now apply Rge_le. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Zceil x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Zceil x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Zceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)
exact inbetween_int_UP_sign. Qed.
Relates location and rounding toward zero.
Definition round_ZR (s : bool) l :=
  match l with
  | loc_Exact => false
  | _ => s
  end.

beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hx:x = IZR m

Ztrunc x = cond_incr (round_ZR (m <? 0)%Z SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Ztrunc x = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
(* Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hx:x = IZR m

Ztrunc (IZR m) = cond_incr (round_ZR (m <? 0)%Z SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Ztrunc x = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Ztrunc x = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
(* not Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

(if Rlt_bool x 0 then Zceil x else Zfloor x) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
(if Rlt_bool x 0 then Zceil x else Zfloor x) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
(if Rlt_bool x 0 then Zceil x else Zfloor x) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

(if Rlt_bool x 0 then Zceil x else Zfloor x) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

(if Rlt_bool x 0 then (Zfloor x + 1)%Z else Zfloor x) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

(if Rlt_bool x 0 then (m + 1)%Z else m) = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

(if Rlt_bool x 0 then (m + 1)%Z else m) = (if round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l') then (m + 1)%Z else m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

(if Rlt_bool x 0 then (m + 1)%Z else m) = (if (m <? 0)%Z then (m + 1)%Z else m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(x < 0)%R
Hm':(0 <= m)%Z

(m + 1)%Z = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z
m = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(x < 0)%R
Hm':(0 <= m)%Z

(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z
m = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(x < 0)%R
Hm':(0 <= m)%Z

(0 < x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z
m = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(x < 0)%R
Hm':(0 <= m)%Z

(0 <= IZR m)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z
m = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z

m = (m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z

(x < 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z

(IZR (m + 1) <= 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Hx':(0 <= x)%R
Hm':(m < 0)%Z

(m + 1 <= 0)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR m <> x
now apply Rlt_not_eq. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Ztrunc x = F2R {| Fnum := cond_incr (round_ZR (m <? 0)%Z l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp Ztrunc x = F2R {| Fnum := cond_incr (round_ZR (m <? 0)%Z l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) m
exact inbetween_int_ZR. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

Zceil x = SpecFloatCopy.cond_Zopp true m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

Zceil x = (- m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(- Zfloor (- x))%Z = (- m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(IZR m <= - x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(IZR m <= Rabs x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(IZR m < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(x < 0)%R

(m < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R
(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

Zfloor x = SpecFloatCopy.cond_Zopp false m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

(IZR m <= Rabs x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

(IZR m < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Zx:(0 <= x)%R

(m < m + 1)%Z
apply Zlt_succ. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Ztrunc x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp Ztrunc x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
exact inbetween_int_ZR_sign. Qed.
Relates location and rounding to nearest.
Definition round_N (p : bool) l :=
  match l with
  | loc_Exact => false
  | loc_Inexact Lt => false
  | loc_Inexact Eq => p
  | loc_Inexact Gt => true
  end.

beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (choice : Z -> bool) (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Znearest choice x = cond_incr (round_N (choice m) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (choice : Z -> bool) (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Znearest choice x = cond_incr (round_N (choice m) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

Znearest choice x = cond_incr (round_N (choice m) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hx:x = IZR m

Znearest choice x = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
(* Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hx:x = IZR m

Znearest choice (IZR m) = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
(* not Exact *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then Zceil x else Zfloor x | Lt => Zfloor x | Gt => Zceil x end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then Zceil x else Zfloor x | Lt => Zfloor x | Gt => Zceil x end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then Zceil x else Zfloor x | Lt => Zfloor x | Gt => Zceil x end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then Zceil x else Zfloor x | Lt => Zfloor x | Gt => Zceil x end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then (Zfloor x + 1)%Z else Zfloor x | Lt => Zfloor x | Gt => (Zfloor x + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR m) (/ 2) with | Eq => if choice m then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match l' with | Eq => if choice m then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
l' = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

l' = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare x ((IZR m + IZR (m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare x ((IZR m + (IZR m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare (x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR m <> x
now apply Rlt_not_eq. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (choice : Z -> bool) (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (choice : Z -> bool) (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (if Rcase_abs x then (- x)%R else x) l

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Znearest choice x = SpecFloatCopy.cond_Zopp true (cond_incr (round_N (negb (choice (- (m + 1))%Z)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Znearest choice x = (- cond_incr (round_N (negb (choice (- (m + 1)))) l) m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Znearest choice (- - x) = (- cond_incr (round_N (negb (choice (- (m + 1)))) l) m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

(- Znearest (fun t : Z => negb (choice (- (t + 1)))) (- x))%Z = (- cond_incr (round_N (negb (choice (- (m + 1)))) l) m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hl:inbetween_int m (- x) l

Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hx:(- x)%R = IZR m

Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
Hx:(- x)%R = IZR m

Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (IZR m) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'

Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'

Zfloor (- x) = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'

(IZR m <= - x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

Znearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

match Rcompare (- x - IZR (Zfloor (- x))) (/ 2) with | Eq => if negb (choice (- (Zfloor (- x) + 1))%Z) then Zceil (- x) else Zfloor (- x) | Lt => Zfloor (- x) | Gt => Zceil (- x) end = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

match Rcompare (- x - IZR (Zfloor (- x))) (/ 2) with | Eq => if negb (choice (- (Zfloor (- x) + 1))%Z) then (Zfloor (- x) + 1)%Z else Zfloor (- x) | Lt => Zfloor (- x) | Gt => (Zfloor (- x) + 1)%Z end = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

match Rcompare (- x - IZR m) (/ 2) with | Eq => if negb (choice (- (m + 1))%Z) then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

match l' with | Eq => if negb (choice (- (m + 1))%Z) then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
l' = Rcompare (- x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

l' = Rcompare (- x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = Rcompare (- x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

Rcompare (- x) ((IZR m + (IZR m + 1)) / 2) = Rcompare (- x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

Rcompare (- x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (- x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m
IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

IZR (Zfloor (- x)) <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x < 0)%R
l':comparison
Hx:(IZR m < - x < IZR (m + 1))%R
Hl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor (- x) = m

IZR m <> (- x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l
Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(x >= 0)%R
Hl:inbetween_int m x l

(0 <= x)%R -> Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

(0 <= x)%R -> Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Zx:(0 <= x)%R

Znearest choice x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (choice (- (m + 1))%Z) else choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Zx:(0 <= x)%R

Znearest choice x = SpecFloatCopy.cond_Zopp false (cond_incr (round_N (choice m) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l
Zx:(0 <= x)%R

Znearest choice x = cond_incr (round_N (choice m) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
Hx:x = IZR m

Znearest choice x = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
Hx:x = IZR m

Znearest choice (IZR m) = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

Zfloor x = m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'

(IZR m <= x < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then Zceil x else Zfloor x | Lt => Zfloor x | Gt => Zceil x end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR (Zfloor x)) (/ 2) with | Eq => if choice (Zfloor x) then (Zfloor x + 1)%Z else Zfloor x | Lt => Zfloor x | Gt => (Zfloor x + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match Rcompare (x - IZR m) (/ 2) with | Eq => if choice m then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

match l' with | Eq => if choice m then (m + 1)%Z else m | Lt => m | Gt => (m + 1)%Z end = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
l' = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

l' = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare x ((IZR m + IZR (m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare x ((IZR m + (IZR m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

Rcompare (x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (x - IZR m) (/ 2)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m
IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR (Zfloor x) <> x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
choice:Z -> bool
x:R
m:Z
l:SpecFloatCopy.location
Zx:(0 <= x)%R
l':comparison
Hx:(IZR m < x < IZR (m + 1))%R
Hl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'
Hm:Zfloor x = m

IZR m <> x
now apply Rlt_not_eq. Qed.
Relates location and rounding to nearest even.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) m
now apply inbetween_int_N with (choice := fun x => negb (Z.even x)). Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp ZnearestE x = F2R {| Fnum := cond_incr (round_N (negb (Z.even m)) l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp ZnearestE x = F2R {| Fnum := cond_incr (round_N (negb (Z.even m)) l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) m
exact inbetween_int_NE. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> ZnearestE x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> ZnearestE x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

ZnearestE x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (negb (Z.even (- (?m + 1)))) else negb (Z.even ?m)) ?l) ?m) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
inbetween_int ?m (Rabs x) ?l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (negb (Z.even (- (m + 1)))) else negb (Z.even m)) l) m) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

cond_incr (round_N (if Rlt_bool x 0 then negb (negb (Z.even (- (m + 1)))) else negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

cond_incr (round_N (negb (negb (Z.even (- (m + 1))))) l) m = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
cond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

cond_incr (round_N (negb (negb (Bool.eqb (Z.even m) (Z.even 1)))) l) m = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
cond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

cond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) m
apply refl_equal. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp ZnearestE x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e (Rabs x) l -> round beta fexp ZnearestE x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> ZnearestE x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)
exact inbetween_int_NE_sign. Qed.
Relates location and rounding to nearest away.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m x l

ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) m
now apply inbetween_int_N with (choice := fun x => Zle_bool 0 x). Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp ZnearestA x = F2R {| Fnum := cond_incr (round_N (0 <=? m)%Z l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), let e := cexp beta fexp x in inbetween_float beta m e x l -> round beta fexp ZnearestA x = F2R {| Fnum := cond_incr (round_N (0 <=? m)%Z l) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) m
exact inbetween_int_NA. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> ZnearestA x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> ZnearestA x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

ZnearestA x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (?m + 1))%Z else (0 <=? ?m)%Z) ?l) ?m) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
inbetween_int ?m (Rabs x) ?l
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(0 <= m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(0 < Z.succ m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(0 < IZR (Z.succ m))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(0 <= Rabs x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
(Rabs x < IZR (Z.succ m))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(Rabs x < IZR (Z.succ m))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(IZR m < IZR (m + 1))%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l

(m < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z

cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else (0 <=? m)%Z) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z

cond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else true) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z

cond_incr (round_N (if Rlt_bool x 0 then negb false else true) l) m = cond_incr (round_N true l) m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z
(- (m + 1) < 0)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m:Z
l:SpecFloatCopy.location
Hl:inbetween_int m (Rabs x) l
Hm:(0 <= m)%Z

(- (m + 1) < 0)%Z
omega. Qed. Definition truncate_aux t k := let '(m, e, l) := t in let p := Zpower beta k in (Z.div m p, (e + k)%Z, new_location p (Zmod m p) l).
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (t : Z * Z * SpecFloatCopy.location) (k1 k2 : Z), (0 < k1)%Z -> (0 < k2)%Z -> truncate_aux t (k1 + k2) = truncate_aux (truncate_aux t k1) k2
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (t : Z * Z * SpecFloatCopy.location) (k1 k2 : Z), (0 < k1)%Z -> (0 < k2)%Z -> truncate_aux t (k1 + k2) = truncate_aux (truncate_aux t k1) k2
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z

truncate_aux (m, e, l) (k1 + k2) = truncate_aux (truncate_aux (m, e, l) k1) k2
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)

(0 < k1 + k2)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)

(0 + 0 < k1 + k2)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
B3:inbetween_float beta (m / beta ^ (k1 + k2)) (e + (k1 + k2)) x (new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l)

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
B3:inbetween_float beta (m / beta ^ (k1 + k2)) (e + (k1 + k2)) x (new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l)
B2:inbetween_float beta (m / beta ^ k1 / beta ^ k2) (e + k1 + k2) x (new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
B3:inbetween_float beta (m / beta ^ (k1 + k2)) (e + k1 + k2) x (new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l)
B2:inbetween_float beta (m / beta ^ k1 / beta ^ k2) (e + k1 + k2) x (new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
k1, k2:Z
Hk1:(0 < k1)%Z
Hk2:(0 < k2)%Z
x:R
Hx:inbetween_float beta m e x l
B1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)
Hk3:(0 < k1 + k2)%Z
B3:inbetween_float beta (m / beta ^ (k1 + k2)) (e + k1 + k2) x (new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l)
B2:inbetween_float beta (m / beta ^ k1 / beta ^ k2) (e + k1 + k2) x (new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
H:(m / beta ^ k1 / beta ^ k2)%Z = (m / beta ^ (k1 + k2))%Z
H0:new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l) = new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l

((m / beta ^ (k1 + k2))%Z, (e + (k1 + k2))%Z, new_location (beta ^ (k1 + k2)) (m mod beta ^ (k1 + k2)) l) = ((m / beta ^ k1 / beta ^ k2)%Z, (e + k1 + k2)%Z, new_location (beta ^ k2) ((m / beta ^ k1) mod beta ^ k2) (new_location (beta ^ k1) (m mod beta ^ k1) l))
now rewrite H, H0, Zplus_assoc. Qed.
Given a triple (mantissa, exponent, position), this function computes a triple with a canonic exponent, assuming the original triple had enough precision.
Definition truncate t :=
  let '(m, e, l) := t in
  let k := (fexp (Zdigits beta m + e) - e)%Z in
  if Zlt_bool 0 k then truncate_aux t k
  else t.

beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (e : Z) (l : SpecFloatCopy.location), let '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (e : Z) (l : SpecFloatCopy.location), let '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location

let '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location

let '(m', _, _) := if (0 <? fexp (Zdigits beta 0 + e) - e)%Z then truncate_aux (0%Z, e, l) (fexp (Zdigits beta 0 + e) - e) else (0%Z, e, l) in m' = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location

let '(m', _, _) := truncate_aux (0%Z, e, l) (fexp (Zdigits beta 0 + e) - e) in m' = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location
0%Z = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location

(0 / beta ^ (fexp e - e))%Z = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location
0%Z = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
e:Z
l:SpecFloatCopy.location

0%Z = 0%Z
apply refl_equal. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (m e : Z) (l : SpecFloatCopy.location), (0 <= m)%Z -> let '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (m e : Z) (l : SpecFloatCopy.location), (0 <= m)%Z -> let '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z

let '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z

let '(m', e', _) := if (0 <? fexp (Zdigits beta m + e) - e)%Z then truncate_aux (m, e, l) (fexp (Zdigits beta m + e) - e) else (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z

let '(m', e', _) := if (0 <? k)%Z then truncate_aux (m, e, l) k else (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z

let '(m', e', _) := truncate_aux (m, e, l) k in format (F2R {| Fnum := m'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z

format (F2R {| Fnum := m / beta ^ k; Fexp := e + k |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z

(m / beta ^ k)%Z <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m / beta ^ k; Fexp := e + k |}) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(cexp beta fexp (F2R {| Fnum := m / beta ^ k; Fexp := e + k |}) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (mag beta (F2R {| Fnum := m / beta ^ k; Fexp := e + k |})) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (Zdigits beta (m / beta ^ k) + (e + k)) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (Zdigits beta m - k + (e + k)) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z
(0 <= k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (Zdigits beta m + e) <= e + k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z
(0 <= k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (Zdigits beta m + e) <= e + (fexp (Zdigits beta m + e) - e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z
(0 <= k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(fexp (Zdigits beta m + e) <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z
(0 <= k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(0 <= k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(0 <= k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z
(k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

(k <= Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(m / beta ^ k)%Z <> 0%Z

~ (k > Zdigits beta m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(m / beta ^ k)%Z = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(0 <= m < beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(m < beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(Z.abs m < beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(Zdigits beta m <= k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(0 < k)%Z
Hd:(k > Zdigits beta m)%Z

(Zdigits beta m < k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z

format (F2R {| Fnum := m; Fexp := e |})
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z

format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z

m <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z

m <> 0%Z -> (fexp (mag beta (F2R {| Fnum := m; Fexp := e |})) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z

m <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z
m <> 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':(0 < m)%Z

m <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(fexp (Zdigits beta m + e) - e <= 0)%Z
Hm':(0 < m)%Z

m <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
m, e:Z
Hk:(fexp (Zdigits beta m + e) - e <= 0)%Z

m <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m
format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m

format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
l:SpecFloatCopy.location
Hm:(0 <= m)%Z
k:=(fexp (Zdigits beta m + e) - e)%Z:Z
Hk:(k <= 0)%Z
Hm':0%Z = m

format 0
apply generic_format_0. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall m e : Z, m <> 0%Z -> let x := F2R {| Fnum := m; Fexp := e |} in format x -> (e <= fexp (Zdigits beta m + e))%Z -> let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall m e : Z, m <> 0%Z -> let x := F2R {| Fnum := m; Fexp := e |} in format x -> (e <= fexp (Zdigits beta m + e))%Z -> let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z

let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z

cexp beta fexp x = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z

fexp (mag beta (F2R {| Fnum := m; Fexp := e |})) = fexp (Zdigits beta m + e)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)

let '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)

let '(m', e', _) := if (0 <? fexp (Zdigits beta m + e) - e)%Z then truncate_aux (m, e, SpecFloatCopy.loc_Exact) (fexp (Zdigits beta m + e) - e) else (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)

let '(m', e', _) := if (0 <? cexp beta fexp x - e)%Z then truncate_aux (m, e, SpecFloatCopy.loc_Exact) (cexp beta fexp x - e) else (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z

let '(m', e', _) := if (0 <? k)%Z then truncate_aux (m, e, SpecFloatCopy.loc_Exact) k else (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

let '(m', e', _) := truncate_aux (m, e, SpecFloatCopy.loc_Exact) k in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

x = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

(e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

(e + (cexp beta fexp x - e))%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

F2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := e + k |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Ztrunc (scaled_mantissa beta fexp x) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Ztrunc (IZR (Zfloor (scaled_mantissa beta fexp x))) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (scaled_mantissa beta fexp x) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (x * bpow (- cexp beta fexp x)) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (x * bpow (- (e + k))) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (IZR (Fnum {| Fnum := m; Fexp := e |}) * bpow (Fexp {| Fnum := m; Fexp := e |}) * bpow (- (e + k))) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (IZR m * bpow e * bpow (- (e + k))) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (IZR m * bpow (e + - (e + k))) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

Zfloor (IZR m * bpow (- k)) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z

Zfloor (IZR m * bpow (- k)) = (m / beta ^ k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:positive
Hk:(0 < Z.pos k)%Z

Zfloor (IZR m * bpow (- Z.pos k)) = (m / beta ^ Z.pos k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:positive
Hk:(0 < Z.pos k)%Z

Zfloor (IZR m * / IZR (Z.pow_pos beta k)) = (m / Z.pow_pos beta k)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:positive
Hk:(0 < Z.pos k)%Z

Z.pow_pos beta k <> 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:positive
Hk:(0 < Z.pos k)%Z
H:Z.pow_pos beta k = 0%Z

False
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
k:positive
Hk:(0 < Z.pos k)%Z
H:Z.pow_pos beta k = 0%Z

((0 < beta)%Z -> (0 < Z.pow_pos beta k)%Z) -> (2 <= beta)%Z -> False
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x
IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

IZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(0 < k)%Z
H:(e + k)%Z = cexp beta fexp x

IZR (Zfloor (IZR (Ztrunc (scaled_mantissa beta fexp x)))) = IZR (Ztrunc (scaled_mantissa beta fexp x))
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z

x = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z

x = F2R {| Fnum := m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z
e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(k <= 0)%Z

e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
m, e:Z
Hm:m <> 0%Z
x:=F2R {| Fnum := m; Fexp := e |}:R
Fx:format x
He:(e <= fexp (Zdigits beta m + e))%Z
Hc:cexp beta fexp x = fexp (Zdigits beta m + e)
k:=(cexp beta fexp x - e)%Z:Z
Hk:(cexp beta fexp x - e <= 0)%Z

e = cexp beta fexp x
omega. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z

let '(m', e', l') := if (0 <? fexp (Zdigits beta m + e) - e)%Z then truncate_aux (m, e, l) (fexp (Zdigits beta m + e) - e) else (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z

let '(m', e', l') := if (0 <? cexp beta fexp x - e)%Z then truncate_aux (m, e, l) (cexp beta fexp x - e) else (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z

(if (0 <? cexp beta fexp x - e)%Z then (0 < cexp beta fexp x - e)%Z else (0 >= cexp beta fexp x - e)%Z) -> let '(m', e', l') := if (0 <? cexp beta fexp x - e)%Z then truncate_aux (m, e, l) (cexp beta fexp x - e) else (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 < cexp beta fexp x - e)%Z

let '(m', e', l') := truncate_aux (m, e, l) (cexp beta fexp x - e) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 >= cexp beta fexp x - e)%Z
inbetween_float beta m e x l /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 < cexp beta fexp x - e)%Z

let '(m', e', l') := truncate_aux (m, e, l) (cexp beta fexp x - e) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 < cexp beta fexp x - e)%Z

inbetween_float beta (m / beta ^ (cexp beta fexp x - e)) (e + (cexp beta fexp x - e)) x (new_location (beta ^ (cexp beta fexp x - e)) (m mod beta ^ (cexp beta fexp x - e)) l)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 < cexp beta fexp x - e)%Z
(e + (cexp beta fexp x - e))%Z = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 < cexp beta fexp x - e)%Z

(e + (cexp beta fexp x - e))%Z = cexp beta fexp x
ring.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 >= cexp beta fexp x - e)%Z

inbetween_float beta m e x l /\ e = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
Hk:(0 >= cexp beta fexp x - e)%Z

e = cexp beta fexp x
omega. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 < x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z

(e <= cexp beta fexp x)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z

(e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z
(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z

(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z
now right. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z

(let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x) -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z
m', e':Z
l':SpecFloatCopy.location

inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x -> inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z
m', e':Z
l':SpecFloatCopy.location
H4:inbetween_float beta m' e' x l'
H5:e' = cexp beta fexp x

inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(e <= fexp (Zdigits beta m + e))%Z
m', e':Z
l':SpecFloatCopy.location
H4:inbetween_float beta m' e' x l'
H5:e' = cexp beta fexp x

e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
now left.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
H3:(fexp (Zdigits beta m + e) < e)%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
H3:(fexp (Zdigits beta m + e) < e)%Z

(let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x) -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
H3:(fexp (Zdigits beta m + e) < e)%Z
m', e':Z
l':SpecFloatCopy.location

inbetween_float beta m' e' x l' /\ e' = cexp beta fexp x -> inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
H3:(fexp (Zdigits beta m + e) < e)%Z
m', e':Z
l':SpecFloatCopy.location
H4:inbetween_float beta m' e' x l'
H5:e' = cexp beta fexp x

inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z
H3:(fexp (Zdigits beta m + e) < e)%Z
m', e':Z
l':SpecFloatCopy.location
H4:inbetween_float beta m' e' x l'
H5:e' = cexp beta fexp x

e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

let '(m', e', l') := truncate (m, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

let '(m', e', l') := if (0 <? fexp (Zdigits beta m + e) - e)%Z then ((m / beta ^ (fexp (Zdigits beta m + e) - e))%Z, (e + (fexp (Zdigits beta m + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact) else (m, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

(if (0 <? fexp (Zdigits beta m + e) - e)%Z then (0 < fexp (Zdigits beta m + e) - e)%Z else (0 >= fexp (Zdigits beta m + e) - e)%Z) -> let '(m', e', l') := if (0 <? fexp (Zdigits beta m + e) - e)%Z then ((m / beta ^ (fexp (Zdigits beta m + e) - e))%Z, (e + (fexp (Zdigits beta m + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact) else (m, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

(0 < fexp (Zdigits beta m + e) - e)%Z -> inbetween_float beta (m / beta ^ (fexp (Zdigits beta m + e) - e)) (e + (fexp (Zdigits beta m + e) - e)) x (new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact) /\ ((e + (fexp (Zdigits beta m + e) - e))%Z = cexp beta fexp x \/ new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
(0 >= fexp (Zdigits beta m + e) - e)%Z -> inbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:(0 < fexp (Zdigits beta m + e) - e)%Z

inbetween_float beta (m / beta ^ (fexp (Zdigits beta m + e) - e)) (e + (fexp (Zdigits beta m + e) - e)) x (new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact) /\ ((e + (fexp (Zdigits beta m + e) - e))%Z = cexp beta fexp x \/ new_location (beta ^ (fexp (Zdigits beta m + e) - e)) (m mod beta ^ (fexp (Zdigits beta m + e) - e)) SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
(0 >= fexp (Zdigits beta m + e) - e)%Z -> inbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:(0 < fexp (Zdigits beta m + e) - e)%Z

False
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
(0 >= fexp (Zdigits beta m + e) - e)%Z -> inbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

(0 >= fexp (Zdigits beta m + e) - e)%Z -> inbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

inbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z

format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

format (F2R {| Fnum := m; Fexp := e |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

m <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}
Zm:m <> 0%Z

(cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}
Zm:m <> 0%Z

(fexp (mag beta (F2R {| Fnum := m; Fexp := e |})) <= e)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 < x)%R
H2:l = SpecFloatCopy.loc_Exact
H3:(fexp (Zdigits beta m + e) < e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}
Zm:m <> 0%Z

(fexp (Zdigits beta m + e) <= e)%Z
now apply Zlt_le_weak.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

m = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

(m <= 0 < m + 1)%Z -> m = 0%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
(m <= 0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

(m <= 0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R
(m <= 0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R

(m <= 0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R

(m <= 0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R

(m <= 0)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R
(0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R

(0 < m + 1)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z
let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta m e x l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:0%R = x
H1:inbetween_float beta 0 e 0 l
H2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
Hm:m = 0%Z

let '(m', e', l') := truncate (0%Z, e, l) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta 0 e 0 l

let '(m', e', l') := truncate (0%Z, e, l) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z
l':comparison
H:(F2R {| Fnum := 0; Fexp := e |} < 0)%R
let '(m', e', l'0) := truncate (0%Z, e, SpecFloatCopy.loc_Inexact l') in inbetween_float beta m' e' 0 l'0 /\ (e' = cexp beta fexp 0 \/ l'0 = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

exists e' : Z, (if (0 <? fexp (Zdigits beta 0 + e) - e)%Z then ((0 / beta ^ (fexp (Zdigits beta 0 + e) - e))%Z, (e + (fexp (Zdigits beta 0 + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) (0 mod beta ^ (fexp (Zdigits beta 0 + e) - e)) SpecFloatCopy.loc_Exact) else (0%Z, e, SpecFloatCopy.loc_Exact)) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

exists e' : Z, ((0 / beta ^ (fexp (Zdigits beta 0 + e) - e))%Z, (e + (fexp (Zdigits beta 0 + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) (0 mod beta ^ (fexp (Zdigits beta 0 + e) - e)) SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

exists e' : Z, (0%Z, (e + (fexp (Zdigits beta 0 + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) 0 SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

(0%Z, (e + (fexp (Zdigits beta 0 + e) - e))%Z, new_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) 0 SpecFloatCopy.loc_Exact) = (0%Z, ?e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

new_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) 0 SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
e:Z
exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

(if Z.even (beta ^ (fexp (Zdigits beta 0 + e) - e)) then new_location_even (beta ^ (fexp (Zdigits beta 0 + e) - e)) else new_location_odd (beta ^ (fexp (Zdigits beta 0 + e) - e))) 0%Z SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
e:Z
exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z

exists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z
H:exists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

let '(m', e', l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e' 0 l' /\ (e' = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

let '(m', e'0, l') := truncate (0%Z, e, SpecFloatCopy.loc_Exact) in inbetween_float beta m' e'0 0 l' /\ (e'0 = cexp beta fexp 0 \/ l' = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

inbetween_float beta 0 e' 0 SpecFloatCopy.loc_Exact /\ (e' = cexp beta fexp 0 \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

inbetween_float beta 0 e' 0 SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
e' = cexp beta fexp 0 \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

0%R = F2R {| Fnum := 0; Fexp := e' |}
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)
e' = cexp beta fexp 0 \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

e' = cexp beta fexp 0 \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0
beta:radix
fexp:Z -> Z
e, e':Z
H:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)

format 0
apply generic_format_0.
beta:radix
fexp:Z -> Z
e:Z
l':comparison
H:(F2R {| Fnum := 0; Fexp := e |} < 0)%R

let '(m', e', l'0) := truncate (0%Z, e, SpecFloatCopy.loc_Inexact l') in inbetween_float beta m' e' 0 l'0 /\ (e' = cexp beta fexp 0 \/ l'0 = SpecFloatCopy.loc_Exact /\ format 0)
beta:radix
fexp:Z -> Z
e:Z
l':comparison
H:(0 < 0)%R

let '(m', e', l'0) := truncate (0%Z, e, SpecFloatCopy.loc_Inexact l') in inbetween_float beta m' e' 0 l'0 /\ (e' = cexp beta fexp 0 \/ l'0 = SpecFloatCopy.loc_Exact /\ format 0)
elim Rlt_irrefl with (1 := H). Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
H1:inbetween_float beta m e x l
H2:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
now apply cexp_inbetween_float_loc_Exact with (2 := H1). Qed. Section round_dir. Variable rnd : R -> Z. Context { valid_rnd : Valid_rnd rnd }. Variable choice : Z -> location -> Z. Hypothesis inbetween_int_valid : forall x m l, inbetween_int m x l -> rnd x = choice m l.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e x l -> e = cexp beta fexp x \/ l = SpecFloatCopy.loc_Exact /\ format x -> round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e x l -> e = cexp beta fexp x \/ l = SpecFloatCopy.loc_Exact /\ format x -> round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x l
He:e = cexp beta fexp x

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m (cexp beta fexp x) x l
He:e = cexp beta fexp x

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := cexp beta fexp x |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m (cexp beta fexp x) x l
He:e = cexp beta fexp x

forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e x SpecFloatCopy.loc_Exact
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := choice m SpecFloatCopy.loc_Exact; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}
m = choice m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}
m = choice m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

m = choice m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

rnd (IZR m) = choice m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:x = F2R {| Fnum := m; Fexp := e |}

inbetween_int m (IZR m) SpecFloatCopy.loc_Exact
now constructor. Qed.
Truncating a triple is sufficient to round a real number.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

(let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)) -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location

inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x) -> round beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' x l'
H2:e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x

round beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}
now apply round_any_correct. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m l

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), (0 <= x)%R -> inbetween_float beta m e x l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

(let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)) -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location

inbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x) -> round beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0
x:R
m, e:Z
l:SpecFloatCopy.location
Hx:(0 <= x)%R
Hl:inbetween_float beta m e x l
He:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' x l'
H2:e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x

round beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}
now apply round_any_correct. Qed. End round_dir. Section round_dir_sign. Variable rnd : R -> Z. Context { valid_rnd : Valid_rnd rnd }. Variable choice : bool -> Z -> location -> Z. Hypothesis inbetween_int_valid : forall x m l, inbetween_int m (Rabs x) l -> rnd x = cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l).
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> e = cexp beta fexp x \/ l = SpecFloatCopy.loc_Exact /\ format x -> round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> e = cexp beta fexp x \/ l = SpecFloatCopy.loc_Exact /\ format x -> round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) l
He:e = cexp beta fexp x

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m (cexp beta fexp x) (Rabs x) l
He:e = cexp beta fexp x

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := cexp beta fexp x |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m (cexp beta fexp x) (Rabs x) l
He:e = cexp beta fexp x

forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) l
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hin:inbetween_float beta m e (Rabs x) SpecFloatCopy.loc_Exact
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact); Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:(if Rcase_abs x then (- x)%R else x) = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x < 0)%R
H:(- x)%R = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x < 0)%R
H:(- x)%R = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp true m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x < 0)%R
H:(- x)%R = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := - m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x < 0)%R
H:(- x)%R = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = (- F2R {| Fnum := m; Fexp := e |})%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x < 0)%R
H:(- x)%R = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp false m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = F2R {| Fnum := m; Fexp := e |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}

round beta fexp rnd x = x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}
(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
Zx:(x >= 0)%R
H:x = F2R {| Fnum := m; Fexp := e |}

(0 <= x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}

m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact
(* *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

m = choice true m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
(* . *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(- m)%Z = (- choice true m SpecFloatCopy.loc_Exact)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(- m)%Z = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(IZR (- m) < 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(- IZR m < 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(IZR m > 0)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(0 < m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(0 < F2R {| Fnum := m; Fexp := e |})%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

(0 < Rabs x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R

x <> 0%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R
rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

rnd (IZR (- m)) = SpecFloatCopy.cond_Zopp (Rlt_bool (IZR (- m)) 0) (choice (Rlt_bool (IZR (- m)) 0) m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

inbetween_int m (Rabs (IZR (- m))) SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

Rabs (IZR (- m)) = IZR m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

(- IZR (- m))%R = IZR m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(x < 0)%R
H0:(IZR (- m) < 0)%R

(- - IZR m)%R = IZR m
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
m = choice false m SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

m = choice false m SpecFloatCopy.loc_Exact
(* . *)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

m = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

(0 <= IZR m)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R
rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

(0 <= m)%Z
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R
rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

(0 <= F2R {| Fnum := m; Fexp := e |})%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R
rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R

(0 <= Rabs x)%R
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R
rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R

rnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R

rnd (IZR m) = SpecFloatCopy.cond_Zopp (Rlt_bool (IZR m) 0) (choice (Rlt_bool (IZR m) 0) m SpecFloatCopy.loc_Exact)
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R

inbetween_int m (Rabs (IZR m)) SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:l = SpecFloatCopy.loc_Exact
Hf:format x
H:Rabs x = F2R {| Fnum := m; Fexp := e |}
Zx:(0 <= x)%R
H0:(0 <= IZR m)%R

Rabs (IZR m) = IZR m
now apply Rabs_pos_eq. Qed.
Truncating a triple is sufficient to round a real number.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> (e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact

round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact

round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact

(let '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' (Rabs x) l' /\ (e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x))) -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location

inbetween_float beta m' e' (Rabs x) l' /\ (e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x)) -> round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x)

round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |}
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x)

inbetween_float beta m' e' (Rabs x) l'
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x)
e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x) \/ l' = SpecFloatCopy.loc_Exact /\ format (Rabs x)

e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x)

e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:l' = SpecFloatCopy.loc_Exact
H3:format (Rabs x)
e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:e' = cexp beta fexp (Rabs x)

e' = cexp beta fexp x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:l' = SpecFloatCopy.loc_Exact
H3:format (Rabs x)
e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:l' = SpecFloatCopy.loc_Exact
H3:format (Rabs x)

e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:l' = SpecFloatCopy.loc_Exact
H3:format (Rabs x)

l' = SpecFloatCopy.loc_Exact /\ format x
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
m', e':Z
l':SpecFloatCopy.location
H1:inbetween_float beta m' e' (Rabs x) l'
H2:l' = SpecFloatCopy.loc_Exact
H3:format (Rabs x)

format x
now apply generic_format_abs_inv. Qed.
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> rnd x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e (Rabs x) l -> (e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact -> round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

round beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m' l'); Fexp := e' |})
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exact
beta:radix
fexp:Z -> Z
valid_exp:Valid_exp fexp
rnd:R -> Z
valid_rnd:Valid_rnd rnd
choice:bool -> Z -> SpecFloatCopy.location -> Z
inbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 (Rabs x0) l0 -> rnd x0 = SpecFloatCopy.cond_Zopp (Rlt_bool x0 0) (choice (Rlt_bool x0 0) m0 l0)
x:R
m, e:Z
l:SpecFloatCopy.location
Hl:inbetween_float beta m e (Rabs x) l
He:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact

(0 <= Rabs x)%R
apply Rabs_pos. Qed. End round_dir_sign.

Instances of the theorems above, for the usual rounding modes.

Definition round_DN_correct :=
  round_any_correct _ (fun m _ => m) inbetween_int_DN.

Definition round_trunc_DN_correct :=
  round_trunc_any_correct _ (fun m _ => m) inbetween_int_DN.

Definition round_trunc_DN_correct' :=
  round_trunc_any_correct' _ (fun m _ => m) inbetween_int_DN.

Definition round_sign_DN_correct :=
  round_sign_any_correct _ (fun s m l => cond_incr (round_sign_DN s l) m) inbetween_int_DN_sign.

Definition round_trunc_sign_DN_correct :=
  round_trunc_sign_any_correct _ (fun s m l => cond_incr (round_sign_DN s l) m) inbetween_int_DN_sign.

Definition round_trunc_sign_DN_correct' :=
  round_trunc_sign_any_correct' _ (fun s m l => cond_incr (round_sign_DN s l) m) inbetween_int_DN_sign.

Definition round_UP_correct :=
  round_any_correct _ (fun m l => cond_incr (round_UP l) m) inbetween_int_UP.

Definition round_trunc_UP_correct :=
  round_trunc_any_correct _ (fun m l => cond_incr (round_UP l) m) inbetween_int_UP.

Definition round_trunc_UP_correct' :=
  round_trunc_any_correct' _ (fun m l => cond_incr (round_UP l) m) inbetween_int_UP.

Definition round_sign_UP_correct :=
  round_sign_any_correct _ (fun s m l => cond_incr (round_sign_UP s l) m) inbetween_int_UP_sign.

Definition round_trunc_sign_UP_correct :=
  round_trunc_sign_any_correct _ (fun s m l => cond_incr (round_sign_UP s l) m) inbetween_int_UP_sign.

Definition round_trunc_sign_UP_correct' :=
  round_trunc_sign_any_correct' _ (fun s m l => cond_incr (round_sign_UP s l) m) inbetween_int_UP_sign.

Definition round_ZR_correct :=
  round_any_correct _ (fun m l => cond_incr (round_ZR (Zlt_bool m 0) l) m) inbetween_int_ZR.

Definition round_trunc_ZR_correct :=
  round_trunc_any_correct _ (fun m l => cond_incr (round_ZR (Zlt_bool m 0) l) m) inbetween_int_ZR.

Definition round_trunc_ZR_correct' :=
  round_trunc_any_correct' _ (fun m l => cond_incr (round_ZR (Zlt_bool m 0) l) m) inbetween_int_ZR.

Definition round_sign_ZR_correct :=
  round_sign_any_correct _ (fun s m l => m) inbetween_int_ZR_sign.

Definition round_trunc_sign_ZR_correct :=
  round_trunc_sign_any_correct _ (fun s m l => m) inbetween_int_ZR_sign.

Definition round_trunc_sign_ZR_correct' :=
  round_trunc_sign_any_correct' _ (fun s m l => m) inbetween_int_ZR_sign.

Definition round_NE_correct :=
  round_any_correct _ (fun m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE.

Definition round_trunc_NE_correct :=
  round_trunc_any_correct _ (fun m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE.

Definition round_trunc_NE_correct' :=
  round_trunc_any_correct' _ (fun m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE.

Definition round_sign_NE_correct :=
  round_sign_any_correct _ (fun s m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE_sign.

Definition round_trunc_sign_NE_correct :=
  round_trunc_sign_any_correct _ (fun s m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE_sign.

Definition round_trunc_sign_NE_correct' :=
  round_trunc_sign_any_correct' _ (fun s m l => cond_incr (round_N (negb (Z.even m)) l) m) inbetween_int_NE_sign.

Definition round_NA_correct :=
  round_any_correct _ (fun m l => cond_incr (round_N (Zle_bool 0 m) l) m) inbetween_int_NA.

Definition round_trunc_NA_correct :=
  round_trunc_any_correct _ (fun m l => cond_incr (round_N (Zle_bool 0 m) l) m) inbetween_int_NA.

Definition round_trunc_NA_correct' :=
  round_trunc_any_correct' _ (fun m l => cond_incr (round_N (Zle_bool 0 m) l) m) inbetween_int_NA.

Definition round_sign_NA_correct :=
  round_sign_any_correct _ (fun s m l => cond_incr (round_N true l) m) inbetween_int_NA_sign.

Definition round_trunc_sign_NA_correct :=
  round_trunc_sign_any_correct _ (fun s m l => cond_incr (round_N true l) m) inbetween_int_NA_sign.

Definition round_trunc_sign_NA_correct' :=
  round_trunc_sign_any_correct' _ (fun s m l => cond_incr (round_N true l) m) inbetween_int_NA_sign.

End Fcalc_round_fexp.
Specialization of truncate for FIX formats.
Variable emin : Z.

Definition truncate_FIX t :=
  let '(m, e, l) := t in
  let k := (emin - e)%Z in
  if Zlt_bool 0 k then
    let p := Zpower beta k in
    (Z.div m p, (e + k)%Z, new_location p (Zmod m p) l)
  else t.

beta:radix
emin:Z

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e x l -> (e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate_FIX (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z

forall (x : R) (m e : Z) (l : SpecFloatCopy.location), inbetween_float beta m e x l -> (e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact -> let '(m', e', l') := truncate_FIX (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := truncate_FIX (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact

let '(m', e', l') := if (0 <? emin - e)%Z then ((m / beta ^ (emin - e))%Z, (e + (emin - e))%Z, new_location (beta ^ (emin - e)) (m mod beta ^ (emin - e)) l) else (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z

let '(m', e', l') := if (0 <? k)%Z then ((m / beta ^ k)%Z, (e + k)%Z, new_location (beta ^ k) (m mod beta ^ k) l) else (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z

let '(m', e', l') := if (0 <? k)%Z then ((m / p)%Z, (e + k)%Z, new_location p (m mod p) l) else (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = cexp beta (FIX_exp emin) x \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (FIX_exp emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z

let '(m', e', l') := if (0 <? k)%Z then ((m / p)%Z, (e + k)%Z, new_location p (m mod p) l) else (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = emin \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z

(if (0 <? k)%Z then (0 < k)%Z else (0 >= k)%Z) -> let '(m', e', l') := if (0 <? k)%Z then ((m / p)%Z, (e + k)%Z, new_location p (m mod p) l) else (m, e, l) in inbetween_float beta m' e' x l' /\ (e' = emin \/ l' = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

inbetween_float beta (m / p) (e + k) x (new_location p (m mod p) l) /\ ((e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
(* shift *)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

inbetween_float beta (m / p) (e + k) x (new_location p (m mod p) l)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z
(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

(e + k)%Z = emin
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 < k)%Z

(e + (emin - e))%Z = emin
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z

inbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)
(* no shift *)
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z

inbetween_float beta m e x l
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z
e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= k)%Z

e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:(e <= emin)%Z
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

e = emin
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

l = SpecFloatCopy.loc_Exact
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x l
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H1:inbetween_float beta m e x SpecFloatCopy.loc_Exact
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z

generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

generic_format beta (fun _ : Z => emin) x
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

generic_format beta (fun _ : Z => emin) (F2R {| Fnum := m; Fexp := e |})
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

m <> 0%Z -> (cexp beta (fun _ : Z => emin) (F2R {| Fnum := m; Fexp := e |}) <= e)%Z
beta:radix
emin:Z
x:R
m, e:Z
l:SpecFloatCopy.location
H2:l = SpecFloatCopy.loc_Exact
k:=(emin - e)%Z:Z
p:=(beta ^ k)%Z:Z
Hk:(0 >= emin - e)%Z
H:x = F2R {| Fnum := m; Fexp := e |}

m <> 0%Z -> (emin <= e)%Z
omega. Qed. End Fcalc_round.