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.
Copyright (C) 2010-2018 Guillaume Melquiond
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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zcexp beta fexp x = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zfexp (mag beta x) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zfexp (mag beta x) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z(0 <= m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%ZHm:(0 <= m)%Zfexp (mag beta x) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z(0 <= m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z(0 < Z.succ m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z(0 < F2R {| Fnum := Z.succ m; Fexp := ?e |})%Rapply Bx.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Z(x < F2R {| Fnum := Z.succ m; Fexp := ?e |})%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%ZHm:(0 <= m)%Zfexp (mag beta x) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%ZHm:(0 <= m)%ZHm':(0 < m)%Zfexp (mag beta x) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHm:(0 <= 0)%ZHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%Rfexp (mag beta x) = fexp (Zdigits beta 0 + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHm:(0 <= 0)%ZHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%Rfexp (mag beta x) = fexp (Zdigits beta 0 + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%Rfexp (mag beta x) = fexp (Zdigits beta 0 + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(mag beta x <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%RHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp (Zdigits beta 0 + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(mag beta x <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%Rx <> 0%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(Rabs x < bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(Rabs x < bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(x < bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(0 <= x)%Rnow apply Rlt_le.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%R(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta 0 + e))%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%RHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp (Zdigits beta 0 + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp e)%ZBx:(F2R {| Fnum := 0; Fexp := e |} <= x < F2R {| Fnum := 0 + 1; Fexp := e |})%RHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp ebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%Z \/ (e <= fexp e)%ZHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp ebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%ZHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp ebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= fexp e)%ZHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp ebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%ZHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp enow apply Z.le_trans with e.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= cexp beta fexp x)%ZHx:(mag beta x <= e)%Z(mag beta x <= fexp (mag beta x))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= fexp e)%ZHx:(mag beta x <= e)%Zfexp (mag beta x) = fexp enow apply Z.le_trans with e. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Re:Zl:SpecFloatCopy.locationPx:(0 < x)%RHe:(e <= fexp e)%ZHx:(mag beta x <= e)%Z(mag beta x <= fexp e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 <= x)%RBx: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:0%R = xBx: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= cexp beta fexp x)%Z(e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= cexp beta fexp x)%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= cexp beta fexp x)%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= cexp beta fexp x)%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Znow right.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:(0 < x)%RBx:inbetween_float beta m e x lH:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:0%R = xBx: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationPx:0%R = xBx, 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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xH0: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx:(F2R {| Fnum := m; Fexp := e |} < x < F2R {| Fnum := m + 1; Fexp := e |})%RH: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx:(F2R {| Fnum := m; Fexp := e |} < x < F2R {| Fnum := m + 1; Fexp := e |})%RH: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx:(F2R {| Fnum := m; Fexp := e |} < 0 < F2R {| Fnum := m + 1; Fexp := e |})%RH: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx1:(F2R {| Fnum := m; Fexp := e |} < 0)%RBx2:(0 < F2R {| Fnum := m + 1; Fexp := e |})%RH: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_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx1:(m < 0)%ZBx2:(0 < F2R {| Fnum := m + 1; Fexp := e |})%RH: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_Exactomega. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:ZPx:0%R = xc:comparisonBx1:(m < 0)%ZBx2:(0 < m + 1)%ZH: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
Relates location and rounding.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x lround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl: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 |}))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl: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)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x lrnd (scaled_mantissa beta fexp x) = choice m lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x linbetween_int m (scaled_mantissa beta fexp x) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x l(0 < bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (scaled_mantissa beta fexp x * bpow e) lnow rewrite scaled_mantissa_mult_bpow. Qed. Definition cond_incr (b : bool) m := if b then (m + 1)%Z else m.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:Z -> SpecFloatCopy.location -> ZHc:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHl:inbetween_float beta m e x linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (scaled_mantissa beta fexp x * bpow e) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lFnum {| 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lrnd (scaled_mantissa beta fexp x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l)(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lrnd (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) linbetween_int m (Rabs (scaled_mantissa beta fexp x)) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) l(0 < bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * bpow e) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * bpow e) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x) * Rabs (bpow e)) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) l(bpow e >= 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) linbetween (IZR m * bpow e) (IZR (m + 1) * bpow e) (Rabs (scaled_mantissa beta fexp x * bpow e)) lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) l(bpow e >= 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) l(bpow e >= 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) l(0 <= bpow e)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lRlt_bool (scaled_mantissa beta fexp x) 0 = Rlt_bool x 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(x < 0)%RRlt_bool (scaled_mantissa beta fexp x) 0 = truebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%RRlt_bool (scaled_mantissa beta fexp x) 0 = falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(x < 0)%R(scaled_mantissa beta fexp x < 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%RRlt_bool (scaled_mantissa beta fexp x) 0 = falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(x < 0)%R(scaled_mantissa beta fexp x < 0 * bpow (- e))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%RRlt_bool (scaled_mantissa beta fexp x) 0 = falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(x < 0)%R(0 < bpow (- e))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%RRlt_bool (scaled_mantissa beta fexp x) 0 = falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%RRlt_bool (scaled_mantissa beta fexp x) 0 = falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%R(0 <= scaled_mantissa beta fexp x)%Rapply bpow_ge_0. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zchoice:bool -> Z -> SpecFloatCopy.location -> ZHc: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:Rm:Zl:SpecFloatCopy.locatione:=cexp beta fexp x:ZHx:inbetween_float beta m e (Rabs x) lZx:(0 <= x)%R(0 <= bpow (- cexp beta fexp x))%R
Relates location and rounding down.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x l(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x l(IZR m < IZR (m + 1))%Rapply Zlt_succ. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x l(m < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_DN. Qed. Definition round_sign_DN s l := match l with | loc_Exact => false | _ => s end.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (if Rcase_abs x then (- x)%R else x) lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZfloor x = SpecFloatCopy.cond_Zopp true (cond_incr (round_sign_DN true l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RH:(- x)%R = IZR mZfloor x = (- m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = (- (m + 1))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RH:(- x)%R = IZR mZfloor (- - x) = (- m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = (- (m + 1))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RH:(- x)%R = IZR mZfloor (IZR (- m)) = (- m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = (- (m + 1))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = (- (m + 1))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(IZR (- (m + 1)) <= x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(IZR (- (m + 1)) <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(IZR (- (m + 1)) < x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(- IZR (m + 1) < x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(- x < - - IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- (m + 1) + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (- m))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(x < - IZR m)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(- - IZR m < - x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_DN (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZfloor x = SpecFloatCopy.cond_Zopp false (cond_incr (round_sign_DN false l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RH:x = IZR mZfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RH:x = IZR mZfloor (IZR m) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(IZR m <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rnow apply Rge_le. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_DN_sign. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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)
Relates location and rounding up.
Definition round_UP l := match l with | loc_Exact => false | _ => true end.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x ll = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = truebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl':l = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = trueZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl':l = SpecFloatCopy.loc_Exact \/ l <> SpecFloatCopy.loc_Exact /\ round_UP l = trueZceil x = cond_incr (round_UP l) m(* Exact *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl':l = SpecFloatCopy.loc_ExactZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl':l = SpecFloatCopy.loc_ExactZceil x = cond_incr (round_UP SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:ZH:x = IZR mHl':SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_ExactZceil x = cond_incr (round_UP SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:ZH:x = IZR mHl':SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_ExactZceil (IZR m) = cond_incr (round_UP SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr (round_UP l) m(* not Exact *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = cond_incr true mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = trueZceil x = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = true(IZR (m + 1 - 1) < x <= IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = true(IZR m < x <= IZR (m + 1))%Rapply inbetween_bounds_not_Eq with (2 := Hl1) (1 := Hl). Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lHl1:l <> SpecFloatCopy.loc_ExactHl2:round_UP l = true(IZR m < x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_UP. Qed. Definition round_sign_UP s l := match l with | loc_Exact => false | _ => negb s end.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Zceil x = cond_incr (round_UP l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (if Rcase_abs x then (- x)%R else x) lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZceil x = SpecFloatCopy.cond_Zopp true (cond_incr (round_sign_UP true l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZceil x = (- cond_incr (round_sign_UP true l) m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) l(- Zfloor (- x))%Z = (- cond_incr (round_sign_UP true l) m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZfloor (- x) = cond_incr (round_sign_UP true l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RH:(- x)%R = IZR mZfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RH:(- x)%R = IZR mZfloor (IZR m) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0Zfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(IZR m <= - x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(IZR m <= - x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(- x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl0:comparisonH:(IZR m < - x < IZR (m + 1))%RH0:Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l0(- x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_sign_UP (Rlt_bool x 0) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = SpecFloatCopy.cond_Zopp false (cond_incr (round_sign_UP false l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZceil x = cond_incr (round_sign_UP false l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RH:x = IZR mZceil x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zceil x = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RH:x = IZR mZceil (IZR m) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zceil x = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0Zceil x = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(IZR (m + 1 - 1) < x <= IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(IZR (m + 1 - 1) < x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(x <= IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(IZR (Z.pred (Z.succ m)) < x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(x <= IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%Rl0:comparisonH:(IZR m < x < IZR (m + 1))%RH0:Rcompare x ((IZR m + IZR (m + 1)) / 2) = l0(x <= IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rnow apply Rge_le. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x l(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_UP_sign. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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)
Relates location and rounding toward zero.
Definition round_ZR (s : bool) l := match l with | loc_Exact => false | _ => s end.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZtrunc x = cond_incr (round_ZR (m <? 0)%Z l) m(* Exact *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHx:x = IZR mZtrunc x = cond_incr (round_ZR (m <? 0)%Z SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Ztrunc x = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHx:x = IZR mZtrunc (IZR m) = cond_incr (round_ZR (m <? 0)%Z SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Ztrunc x = cond_incr (round_ZR (m <? 0)%Z (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(x < 0)%RHm':(0 <= m)%Z(m + 1)%Z = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Zm = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(x < 0)%RHm':(0 <= m)%Z(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Zm = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(x < 0)%RHm':(0 <= m)%Z(0 < x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Zm = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(x < 0)%RHm':(0 <= m)%Z(0 <= IZR m)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Zm = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Zm = (m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Z(x < 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Z(IZR (m + 1) <= 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mHx':(0 <= x)%RHm':(m < 0)%Z(m + 1 <= 0)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xnow apply Rlt_not_eq. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR m <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_ZR. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> Ztrunc x = cond_incr (round_ZR (m <? 0)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZtrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZtrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%RZceil x = SpecFloatCopy.cond_Zopp true mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%RZceil x = (- m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(- Zfloor (- x))%Z = (- m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%RZfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(IZR m <= - x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(IZR m <= Rabs x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(IZR m < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(x < 0)%R(m < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(if Rlt_bool x 0 then Zceil x else Zfloor x) = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%RZfloor x = SpecFloatCopy.cond_Zopp false mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%RZfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(IZR m <= Rabs x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(IZR m < IZR (m + 1))%Rapply Zlt_succ. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZx:(0 <= x)%R(m < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_ZR_sign. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m (Rabs x) l -> Ztrunc x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m
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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZnearest choice x = cond_incr (round_N (choice m) l) m(* Exact *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHx:x = IZR mZnearest choice x = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHx:x = IZR mZnearest choice (IZR m) = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = ml' = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = ml' = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare x ((IZR m + IZR (m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare x ((IZR m + (IZR m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare (x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = m((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xnow apply Rlt_not_eq. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR m <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (if Rcase_abs x then (- x)%R else x) lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZnearest choice x = SpecFloatCopy.cond_Zopp true (cond_incr (round_N (negb (choice (- (m + 1))%Z)) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZnearest choice x = (- cond_incr (round_N (negb (choice (- (m + 1)))) l) m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZnearest choice (- - x) = (- cond_incr (round_N (negb (choice (- (m + 1)))) l) m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl: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)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHl:inbetween_int m (- x) lZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHx:(- x)%R = IZR mZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%RHx:(- x)%R = IZR mZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (IZR m) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Zfloor (- x) = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'(IZR m <= - x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mZnearest (fun t : Z => negb (choice (- (t + 1))%Z)) (- x) = cond_incr (round_N (negb (choice (- (m + 1))%Z)) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = ml' = Rcompare (- x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = ml' = Rcompare (- x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mRcompare (- x) ((IZR m + IZR (m + 1)) / 2) = Rcompare (- x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mRcompare (- x) ((IZR m + (IZR m + 1)) / 2) = Rcompare (- x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mRcompare (- x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (- x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = m((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR (Zfloor (- x)) <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x < 0)%Rl':comparisonHx:(IZR m < - x < IZR (m + 1))%RHl':Rcompare (- x) ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor (- x) = mIZR m <> (- x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl:inbetween_int m x lZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(x >= 0)%RHl: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZx:(0 <= x)%RZnearest 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZx:(0 <= x)%RZnearest choice x = SpecFloatCopy.cond_Zopp false (cond_incr (round_N (choice m) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZx:(0 <= x)%RZnearest choice x = cond_incr (round_N (choice m) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%RHx:x = IZR mZnearest choice x = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%RHx:x = IZR mZnearest choice (IZR m) = cond_incr (round_N (choice m) SpecFloatCopy.loc_Exact) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Znearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Zfloor x = mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mZnearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'(IZR m <= x < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mZnearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mZnearest choice x = cond_incr (round_N (choice m) (SpecFloatCopy.loc_Inexact l')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mmatch 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')) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = ml' = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = ml' = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare x ((IZR m + IZR (m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare x ((IZR m + (IZR m + 1)) / 2) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mRcompare (x + - IZR m) ((IZR m + (IZR m + 1)) / 2 + - IZR m) = Rcompare (x - IZR m) (/ 2)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = m((IZR m + (IZR m + 1)) / 2 + - IZR m)%R = (/ 2)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR (Zfloor x) <> xnow apply Rlt_not_eq. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpchoice:Z -> boolx:Rm:Zl:SpecFloatCopy.locationZx:(0 <= x)%Rl':comparisonHx:(IZR m < x < IZR (m + 1))%RHl':Rcompare x ((IZR m + IZR (m + 1)) / 2) = l'Hm:Zfloor x = mIZR m <> x
Relates location and rounding to nearest even.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) mnow apply inbetween_int_N with (choice := fun x => negb (Z.even x)). Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZnearestE x = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_NE. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestE x = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZnearestE x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N (negb (Z.even m)) l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lSpecFloatCopy.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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) linbetween_int ?m (Rabs x) ?lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lSpecFloatCopy.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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_incr (round_N (negb (negb (Z.even (- (m + 1))))) l) m = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_incr (round_N (negb (negb (Bool.eqb (Z.even m) (Z.even 1)))) l) m = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) mapply refl_equal. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_incr (round_N (negb (Z.even m)) l) m = cond_incr (round_N (negb (Z.even m)) l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_NE_sign. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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)
Relates location and rounding to nearest away.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) mnow apply inbetween_int_N with (choice := fun x => Zle_bool 0 x). Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m x lZnearestA x = cond_incr (round_N (0 <=? m)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 |}exact inbetween_int_NA. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> ZnearestA x = cond_incr (round_N (0 <=? m)%Z l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lZnearestA x = SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (cond_incr (round_N true l) m)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lSpecFloatCopy.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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) linbetween_int ?m (Rabs x) ?lbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lSpecFloatCopy.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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(0 <= m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(0 < Z.succ m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(0 < IZR (Z.succ m))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(0 <= Rabs x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(Rabs x < IZR (Z.succ m))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(Rabs x < IZR (Z.succ m))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(IZR m < IZR (m + 1))%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) l(m < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_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) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_incr (round_N (if Rlt_bool x 0 then negb (0 <=? - (m + 1))%Z else true) l) m = cond_incr (round_N true l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Zcond_incr (round_N (if Rlt_bool x 0 then negb false else true) l) m = cond_incr (round_N true l) mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Z(- (m + 1) < 0)%Zomega. 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm:Zl:SpecFloatCopy.locationHl:inbetween_int m (Rabs x) lHm:(0 <= m)%Z(- (m + 1) < 0)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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) k2beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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) k2beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Ztruncate_aux (m, e, l) (k1 + k2) = truncate_aux (truncate_aux (m, e, l) k1) k2beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)(0 < k1 + k2)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)(0 + 0 < k1 + k2)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)Hk3:(0 < k1 + k2)%ZB3: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)Hk3:(0 < k1 + k2)%ZB3: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)Hk3:(0 < k1 + k2)%ZB3: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))now rewrite H, H0, Zplus_assoc. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationk1, k2:ZHk1:(0 < k1)%ZHk2:(0 < k2)%Zx:RHx:inbetween_float beta m e x lB1:inbetween_float beta (m / beta ^ k1) (e + k1) x (new_location (beta ^ k1) (m mod beta ^ k1) l)Hk3:(0 < k1 + k2)%ZB3: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))%ZH0: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))
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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (e : Z) (l : SpecFloatCopy.location), let '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (e : Z) (l : SpecFloatCopy.location), let '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.locationlet '(m', _, _) := truncate (0%Z, e, l) in m' = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.locationlet '(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%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.locationlet '(m', _, _) := truncate_aux (0%Z, e, l) (fexp (Zdigits beta 0 + e) - e) in m' = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.location0%Z = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.location(0 / beta ^ (fexp e - e))%Z = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.location0%Z = 0%Zapply refl_equal. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpe:Zl:SpecFloatCopy.location0%Z = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (m e : Z) (l : SpecFloatCopy.location), (0 <= m)%Z -> let '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (m e : Z) (l : SpecFloatCopy.location), (0 <= m)%Z -> let '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zlet '(m', e', _) := truncate (m, e, l) in format (F2R {| Fnum := m'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%Zlet '(m', e', _) := truncate_aux (m, e, l) k in format (F2R {| Fnum := m'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%Zformat (F2R {| Fnum := m / beta ^ k; Fexp := e + k |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%Z(m / beta ^ k)%Z <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m / beta ^ k; Fexp := e + k |}) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(cexp beta fexp (F2R {| Fnum := m / beta ^ k; Fexp := e + k |}) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (mag beta (F2R {| Fnum := m / beta ^ k; Fexp := e + k |})) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (Zdigits beta (m / beta ^ k) + (e + k)) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (Zdigits beta m - k + (e + k)) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (Zdigits beta m + e) <= e + k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (Zdigits beta m + e) <= e + (fexp (Zdigits beta m + e) - e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(fexp (Zdigits beta m + e) <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(0 <= k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z(k <= Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(m / beta ^ k)%Z <> 0%Z~ (k > Zdigits beta m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(m / beta ^ k)%Z = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(0 <= m < beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(m < beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(Z.abs m < beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(Zdigits beta m <= k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(0 < k)%ZHd:(k > Zdigits beta m)%Z(Zdigits beta m < k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zm <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zm <> 0%Z -> (fexp (mag beta (F2R {| Fnum := m; Fexp := e |})) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zm <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zm <> 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':(0 < m)%Zm <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(fexp (Zdigits beta m + e) - e <= 0)%ZHm':(0 < m)%Zm <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zm, e:ZHk:(fexp (Zdigits beta m + e) - e <= 0)%Zm <> 0%Z -> (fexp (Zdigits beta m + e) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat (F2R {| Fnum := m; Fexp := e |})apply generic_format_0. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:Zl:SpecFloatCopy.locationHm:(0 <= m)%Zk:=(fexp (Zdigits beta m + e) - e)%Z:ZHk:(k <= 0)%ZHm':0%Z = mformat 0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%Zlet '(m', e', _) := truncate (m, e, SpecFloatCopy.loc_Exact) in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%Zcexp beta fexp x = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%Zfexp (mag beta (F2R {| Fnum := m; Fexp := e |})) = fexp (Zdigits beta m + e)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%Zlet '(m', e', _) := truncate_aux (m, e, SpecFloatCopy.loc_Exact) k in x = F2R {| Fnum := m'; Fexp := e' |} /\ e' = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%Zx = F2R {| Fnum := m / beta ^ k; Fexp := e + k |} /\ (e + k)%Z = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZF2R {| 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%Z(e + k)%Z = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xF2R {| 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%Z(e + (cexp beta fexp x - e))%Z = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xF2R {| 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xF2R {| 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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xF2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := cexp beta fexp x |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xF2R {| Fnum := Ztrunc (scaled_mantissa beta fexp x); Fexp := e + k |} = F2R {| Fnum := m / beta ^ k; Fexp := e + k |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZtrunc (scaled_mantissa beta fexp x) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZtrunc (IZR (Zfloor (scaled_mantissa beta fexp x))) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (scaled_mantissa beta fexp x) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (x * bpow (- cexp beta fexp x)) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (x * bpow (- (e + k))) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (IZR (Fnum {| Fnum := m; Fexp := e |}) * bpow (Fexp {| Fnum := m; Fexp := e |}) * bpow (- (e + k))) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (IZR m * bpow e * bpow (- (e + k))) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (IZR m * bpow (e + - (e + k))) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xZfloor (IZR m * bpow (- k)) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZZfloor (IZR m * bpow (- k)) = (m / beta ^ k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:positiveHk:(0 < Z.pos k)%ZZfloor (IZR m * bpow (- Z.pos k)) = (m / beta ^ Z.pos k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:positiveHk:(0 < Z.pos k)%ZZfloor (IZR m * / IZR (Z.pow_pos beta k)) = (m / Z.pow_pos beta k)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:positiveHk:(0 < Z.pos k)%ZZ.pow_pos beta k <> 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:positiveHk:(0 < Z.pos k)%ZH:Z.pow_pos beta k = 0%ZFalsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:Rk:positiveHk:(0 < Z.pos k)%ZH:Z.pow_pos beta k = 0%Z((0 < beta)%Z -> (0 < Z.pow_pos beta k)%Z) -> (2 <= beta)%Z -> Falsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (scaled_mantissa beta fexp x)) = scaled_mantissa beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(0 < k)%ZH:(e + k)%Z = cexp beta fexp xIZR (Zfloor (IZR (Ztrunc (scaled_mantissa beta fexp x)))) = IZR (Ztrunc (scaled_mantissa beta fexp x))beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp x(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |} /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Zx = F2R {| Fnum := m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Ze = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(k <= 0)%Ze = cexp beta fexp xomega. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpm, e:ZHm:m <> 0%Zx:=F2R {| Fnum := m; Fexp := e |}:RFx:format xHe:(e <= fexp (Zdigits beta m + e))%ZHc:cexp beta fexp x = fexp (Zdigits beta m + e)k:=(cexp beta fexp x - e)%Z:ZHk:(cexp beta fexp x - e <= 0)%Ze = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Zlet '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Zlet '(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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Zlet '(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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 < cexp beta fexp x - e)%Zlet '(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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 >= cexp beta fexp x - e)%Zinbetween_float beta m e x l /\ e = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 < cexp beta fexp x - e)%Zlet '(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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 < cexp beta fexp x - e)%Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 < cexp beta fexp x - e)%Z(e + (cexp beta fexp x - e))%Z = cexp beta fexp xring.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 < cexp beta fexp x - e)%Z(e + (cexp beta fexp x - e))%Z = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 >= cexp beta fexp x - e)%Zinbetween_float beta m e x l /\ e = cexp beta fexp xomega. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZHk:(0 >= cexp beta fexp x - e)%Ze = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Zlet '(m', e', l') := truncate (m, e, l) in inbetween_float beta m' e' x l' /\ e' = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z(e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Znow right. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z(e <= cexp beta fexp x)%Z \/ (e <= fexp (Zdigits beta m + e))%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(e <= fexp (Zdigits beta m + e))%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(e <= fexp (Zdigits beta m + e))%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(e <= fexp (Zdigits beta m + e))%Zm', e':Zl':SpecFloatCopy.locationinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(e <= fexp (Zdigits beta m + e))%Zm', e':Zl':SpecFloatCopy.locationH4:inbetween_float beta m' e' x l'H5:e' = cexp beta fexp xinbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)now left.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(e <= fexp (Zdigits beta m + e))%Zm', e':Zl':SpecFloatCopy.locationH4:inbetween_float beta m' e' x l'H5:e' = cexp beta fexp xe' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZH3:(fexp (Zdigits beta m + e) < e)%Zm', e':Zl':SpecFloatCopy.locationinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZH3:(fexp (Zdigits beta m + e) < e)%Zm', e':Zl':SpecFloatCopy.locationH4:inbetween_float beta m' e' x l'H5:e' = cexp beta fexp xinbetween_float beta m' e' x l' /\ (e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format x)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%ZH3:(fexp (Zdigits beta m + e) < e)%Zm', e':Zl':SpecFloatCopy.locationH4:inbetween_float beta m' e' x l'H5:e' = cexp beta fexp xe' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:(0 < fexp (Zdigits beta m + e) - e)%Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:(0 < fexp (Zdigits beta m + e) - e)%ZFalsebeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zinbetween_float beta m e x SpecFloatCopy.loc_Exact /\ (e = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format x)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Ze = cexp beta fexp x \/ SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZSpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%Zformat xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}format (F2R {| Fnum := m; Fexp := e |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}m <> 0%Z -> (cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}Zm:m <> 0%Z(cexp beta fexp (F2R {| Fnum := m; Fexp := e |}) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}Zm:m <> 0%Z(fexp (mag beta (F2R {| Fnum := m; Fexp := e |})) <= e)%Znow apply Zlt_le_weak.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 < x)%RH2:l = SpecFloatCopy.loc_ExactH3:(fexp (Zdigits beta m + e) < e)%ZH:x = F2R {| Fnum := m; Fexp := e |}Zm:m <> 0%Z(fexp (Zdigits beta m + e) <= e)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactm = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact(m <= 0 < m + 1)%Z -> m = 0%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact(m <= 0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact(m <= 0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exact(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R(m <= 0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= x < F2R {| Fnum := m + 1; Fexp := e |})%R(m <= 0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R(m <= 0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R(m <= 0)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R(0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHx':(F2R {| Fnum := m; Fexp := e |} <= 0 < F2R {| Fnum := m + 1; Fexp := e |})%R(0 < m + 1)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta m e x lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:0%R = xH1:inbetween_float beta 0 e 0 lH2:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_ExactHm:m = 0%Zlet '(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:radixfexp:Z -> Ze:Zl:SpecFloatCopy.locationH1:inbetween_float beta 0 e 0 llet '(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:radixfexp:Z -> Ze:Zlet '(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:radixfexp:Z -> Ze:Zl':comparisonH:(F2R {| Fnum := 0; Fexp := e |} < 0)%Rlet '(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:radixfexp:Z -> Ze:Zlet '(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:radixfexp:Z -> Ze:Zexists e' : Z, truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:Zexists 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:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:Zexists 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:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:Zexists 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:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze: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:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:Znew_location (beta ^ (fexp (Zdigits beta 0 + e) - e)) 0 SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze: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_Exactbeta:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:Zexists e' : Z, (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze:ZH: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:radixfexp:Z -> Ze, e':ZH: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:radixfexp:Z -> Ze, e':ZH: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:radixfexp:Z -> Ze, e':ZH:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)inbetween_float beta 0 e' 0 SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Ze, e':ZH: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 0beta:radixfexp:Z -> Ze, e':ZH:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)0%R = F2R {| Fnum := 0; Fexp := e' |}beta:radixfexp:Z -> Ze, e':ZH: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 0beta:radixfexp:Z -> Ze, e':ZH: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 0beta:radixfexp:Z -> Ze, e':ZH:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)SpecFloatCopy.loc_Exact = SpecFloatCopy.loc_Exact /\ format 0apply generic_format_0.beta:radixfexp:Z -> Ze, e':ZH:truncate (0%Z, e, SpecFloatCopy.loc_Exact) = (0%Z, e', SpecFloatCopy.loc_Exact)format 0beta:radixfexp:Z -> Ze:Zl':comparisonH:(F2R {| Fnum := 0; Fexp := e |} < 0)%Rlet '(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:radixfexp:Z -> Ze:Zl':comparisonH:(0 < 0)%Rlet '(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exactlet '(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)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:radixfexp:Z -> Zvalid_exp:Valid_exp fexpx:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RH1:inbetween_float beta m e x lH2:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x lHe:e = cexp beta fexp xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m (cexp beta fexp x) x lHe:e = cexp beta fexp xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := cexp beta fexp x |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m (cexp beta fexp x) x lHe:e = cexp beta fexp xforall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e x SpecFloatCopy.loc_ExactHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := choice m l; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := choice m SpecFloatCopy.loc_Exact; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}m = choice m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}m = choice m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}m = choice m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}rnd (IZR m) = choice m SpecFloatCopy.loc_Exactnow constructor. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:x = F2R {| Fnum := m; Fexp := e |}inbetween_int m (IZR m) SpecFloatCopy.loc_Exact
Truncating a triple is sufficient to round a real number.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exactround beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationinbetween_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' |}now apply round_any_correct. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' x l'H2:e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xround beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x : R) (m : Z) (l : SpecFloatCopy.location), inbetween_int m x l -> rnd x = choice m lforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactround beta fexp rnd x = (let '(m', e', l') := truncate (m, e, l) in F2R {| Fnum := choice m' l'; Fexp := e' |})beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationinbetween_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' |}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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:Z -> SpecFloatCopy.location -> Zinbetween_int_valid:forall (x0 : R) (m0 : Z) (l0 : SpecFloatCopy.location), inbetween_int m0 x0 l0 -> rnd x0 = choice m0 l0x:Rm, e:Zl:SpecFloatCopy.locationHx:(0 <= x)%RHl:inbetween_float beta m e x lHe:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' x l'H2:e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xround beta fexp rnd x = F2R {| Fnum := choice m' l'; Fexp := e' |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) lHe:e = cexp beta fexp xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m (cexp beta fexp x) (Rabs x) lHe:e = cexp beta fexp xround 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m (cexp beta fexp x) (Rabs x) lHe:e = cexp beta fexp xforall (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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) lHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHin:inbetween_float beta m e (Rabs x) SpecFloatCopy.loc_ExactHl:l = SpecFloatCopy.loc_ExactHf:format xround beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) (choice (Rlt_bool x 0) m l); Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x < 0)%RH:(- 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x < 0)%RH:(- x)%R = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp true m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x < 0)%RH:(- x)%R = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := - m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x < 0)%RH:(- x)%R = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = (- F2R {| Fnum := m; Fexp := e |})%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x < 0)%RH:(- x)%R = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp (Rlt_bool x 0) m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := SpecFloatCopy.cond_Zopp false m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = F2R {| Fnum := m; Fexp := e |}beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}round beta fexp rnd x = xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xZx:(x >= 0)%RH:x = F2R {| Fnum := m; Fexp := e |}(0 <= x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact(* *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}m = choice (Rlt_bool x 0) m SpecFloatCopy.loc_Exact(* . *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%Rm = choice true m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(- m)%Z = (- choice true m SpecFloatCopy.loc_Exact)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(- m)%Z = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(IZR (- m) < 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(- IZR m < 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(IZR m > 0)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(0 < m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(0 < F2R {| Fnum := m; Fexp := e |})%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%R(0 < Rabs x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%Rx <> 0%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp true (choice true m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rrnd (IZR (- m)) = SpecFloatCopy.cond_Zopp (Rlt_bool (IZR (- m)) 0) (choice (Rlt_bool (IZR (- m)) 0) m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%Rinbetween_int m (Rabs (IZR (- m))) SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%RRabs (IZR (- m)) = IZR mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%R(- IZR (- m))%R = IZR mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(x < 0)%RH0:(IZR (- m) < 0)%R(- - IZR m)%R = IZR mbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exact(* . *)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = choice false m SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rm = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%R(0 <= IZR m)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%R(0 <= m)%Zbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%R(0 <= F2R {| Fnum := m; Fexp := e |})%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%R(0 <= Rabs x)%Rbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp false (choice false m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rrnd (IZR m) = SpecFloatCopy.cond_Zopp (Rlt_bool (IZR m) 0) (choice (Rlt_bool (IZR m) 0) m SpecFloatCopy.loc_Exact)beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%Rinbetween_int m (Rabs (IZR m)) SpecFloatCopy.loc_Exactnow apply Rabs_pos_eq. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:l = SpecFloatCopy.loc_ExactHf:format xH:Rabs x = F2R {| Fnum := m; Fexp := e |}Zx:(0 <= x)%RH0:(0 <= IZR m)%RRabs (IZR m) = IZR m
Truncating a triple is sufficient to round a real number.
beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactround 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactround 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1: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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1: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 xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:l' = SpecFloatCopy.loc_ExactH3:format (Rabs x)e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:e' = cexp beta fexp (Rabs x)e' = cexp beta fexp xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:l' = SpecFloatCopy.loc_ExactH3:format (Rabs x)e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:l' = SpecFloatCopy.loc_ExactH3:format (Rabs x)e' = cexp beta fexp x \/ l' = SpecFloatCopy.loc_Exact /\ format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:l' = SpecFloatCopy.loc_ExactH3:format (Rabs x)l' = SpecFloatCopy.loc_Exact /\ format xnow apply generic_format_abs_inv. Qed.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactm', e':Zl':SpecFloatCopy.locationH1:inbetween_float beta m' e' (Rabs x) l'H2:l' = SpecFloatCopy.loc_ExactH3:format (Rabs x)format xbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exactround 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:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact(e <= cexp beta fexp x)%Z \/ l = SpecFloatCopy.loc_Exactbeta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact(e <= cexp beta fexp (Rabs x))%Z \/ l = SpecFloatCopy.loc_Exactapply Rabs_pos. Qed. End round_dir_sign.beta:radixfexp:Z -> Zvalid_exp:Valid_exp fexprnd:R -> Zvalid_rnd:Valid_rnd rndchoice:bool -> Z -> SpecFloatCopy.location -> Zinbetween_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:Rm, e:Zl:SpecFloatCopy.locationHl:inbetween_float beta m e (Rabs x) lHe:(e <= fexp (Zdigits beta m + e))%Z \/ l = SpecFloatCopy.loc_Exact(0 <= Rabs x)%R
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:radixemin:Zforall (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:radixemin:Zforall (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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactlet '(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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zlet '(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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:Zlet '(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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:Zlet '(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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(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)(* shift *)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Zinbetween_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:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Zinbetween_float beta (m / p) (e + k) x (new_location p (m mod p) l)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Z(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Z(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Z(e + k)%Z = emin \/ new_location p (m mod p) l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Z(e + k)%Z = eminbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 < k)%Z(e + (emin - e))%Z = eminbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)(* no shift *)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x l /\ (e = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) x)beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Zinbetween_float beta m e x lbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= k)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Z \/ l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Zk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:(e <= emin)%Zk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = eminbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Ze = emin \/ l = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Zl = SpecFloatCopy.loc_Exact /\ generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Zl = SpecFloatCopy.loc_Exactbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Zgeneric_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x lH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Zgeneric_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH1:inbetween_float beta m e x SpecFloatCopy.loc_ExactH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%Zgeneric_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%ZH:x = F2R {| Fnum := m; Fexp := e |}generic_format beta (fun _ : Z => emin) xbeta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%ZH:x = F2R {| Fnum := m; Fexp := e |}generic_format beta (fun _ : Z => emin) (F2R {| Fnum := m; Fexp := e |})beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%ZH:x = F2R {| Fnum := m; Fexp := e |}m <> 0%Z -> (cexp beta (fun _ : Z => emin) (F2R {| Fnum := m; Fexp := e |}) <= e)%Zomega. Qed. End Fcalc_round.beta:radixemin:Zx:Rm, e:Zl:SpecFloatCopy.locationH2:l = SpecFloatCopy.loc_Exactk:=(emin - e)%Z:Zp:=(beta ^ k)%Z:ZHk:(0 >= emin - e)%ZH:x = F2R {| Fnum := m; Fexp := e |}m <> 0%Z -> (emin <= e)%Z