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) 2009-2018 Sylvie Boldo
Copyright (C) 2009-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) 2009-2018 Guillaume Melquiond
Require Import Raux Defs Round_pred Generic_fmt Ulp Round_NE. Section RND_FIX. Variable beta : radix. Notation bpow := (bpow beta). Variable emin : Z. Inductive FIX_format (x : R) : Prop := FIX_spec (f : float beta) : x = F2R f -> (Fexp f = emin)%Z -> FIX_format x. Definition FIX_exp (e : Z) := emin.
Properties of the FIX format
beta:radixemin:ZValid_exp FIX_expbeta:radixemin:ZValid_exp FIX_expbeta:radixemin, k:Z((FIX_exp k < k)%Z -> (FIX_exp (k + 1) <= k)%Z) /\ ((k <= FIX_exp k)%Z -> (FIX_exp (FIX_exp k + 1) <= FIX_exp k)%Z /\ (forall l : Z, (l <= FIX_exp k)%Z -> FIX_exp l = FIX_exp k))beta:radixemin, k:Z((emin < k)%Z -> (emin <= k)%Z) /\ ((k <= emin)%Z -> (emin <= emin)%Z /\ (forall l : Z, (l <= emin)%Z -> emin = emin))beta:radixemin, k:ZH:(emin < k)%Z(emin <= k)%Zbeta:radixemin, k:ZH:(k <= emin)%Z(emin <= emin)%Z /\ (forall l : Z, (l <= emin)%Z -> emin = emin)beta:radixemin, k:ZH:(k <= emin)%Z(emin <= emin)%Z /\ (forall l : Z, (l <= emin)%Z -> emin = emin)beta:radixemin, k:ZH:(k <= emin)%Z(emin <= emin)%Zbeta:radixemin, k:ZH:(k <= emin)%Zforall l : Z, (l <= emin)%Z -> emin = eminnow intros _ _. Qed.beta:radixemin, k:ZH:(k <= emin)%Zforall l : Z, (l <= emin)%Z -> emin = eminbeta:radixemin:Zforall x : R, FIX_format x -> generic_format beta FIX_exp xbeta:radixemin:Zforall x : R, FIX_format x -> generic_format beta FIX_exp xbeta:radixemin:Zx:Rxm, xe:ZHx1:x = F2R {| Fnum := xm; Fexp := xe |}Hx2:Fexp {| Fnum := xm; Fexp := xe |} = emingeneric_format beta FIX_exp xnow apply generic_format_canonical. Qed.beta:radixemin:Zx:Rxm, xe:ZHx1:x = F2R {| Fnum := xm; Fexp := xe |}Hx2:Fexp {| Fnum := xm; Fexp := xe |} = emingeneric_format beta FIX_exp (F2R {| Fnum := xm; Fexp := xe |})beta:radixemin:Zforall x : R, generic_format beta FIX_exp x -> FIX_format xbeta:radixemin:Zforall x : R, generic_format beta FIX_exp x -> FIX_format xbeta:radixemin:Zx:RH:generic_format beta FIX_exp xFIX_format xeexists ; repeat split. Qed.beta:radixemin:Zx:RH:generic_format beta FIX_exp xFIX_format (F2R {| Fnum := Ztrunc (scaled_mantissa beta FIX_exp x); Fexp := cexp beta FIX_exp x |})beta:radixemin:Zsatisfies_any FIX_formatbeta:radixemin:Zsatisfies_any FIX_formatbeta:radixemin:Zforall x : R, generic_format beta FIX_exp x <-> FIX_format xbeta:radixemin:Zx:Rgeneric_format beta FIX_exp x <-> FIX_format xbeta:radixemin:Zx:Rgeneric_format beta FIX_exp x -> FIX_format xbeta:radixemin:Zx:RFIX_format x -> generic_format beta FIX_exp xapply generic_format_FIX. Qed.beta:radixemin:Zx:RFIX_format x -> generic_format beta FIX_exp xbeta:radixemin:ZMonotone_exp FIX_expbeta:radixemin:ZMonotone_exp FIX_expapply Z.le_refl. Qed.beta:radixemin, ex, ey:ZH:(ex <= ey)%Z(FIX_exp ex <= FIX_exp ey)%Zbeta:radixemin:Zforall x : R, ulp beta FIX_exp x = bpow eminbeta:radixemin:Zforall x : R, ulp beta FIX_exp x = bpow eminbeta:radixemin:Zx:R(if Req_bool x 0 then match negligible_exp FIX_exp with | Some n => bpow (FIX_exp n) | None => 0%R end else bpow (cexp beta FIX_exp x)) = bpow eminbeta:radixemin:Zx:RZx:x = 0%Rmatch negligible_exp FIX_exp with | Some n => bpow (FIX_exp n) | None => 0%R end = bpow eminbeta:radixemin:Zx:RZx:x <> 0%Rbpow (cexp beta FIX_exp x) = bpow eminbeta:radixemin:Zx:RZx:x = 0%R(forall n : Z, (FIX_exp n < n)%Z) -> 0%R = bpow eminbeta:radixemin:Zx:RZx:x = 0%Rforall n : Z, (n <= FIX_exp n)%Z -> bpow (FIX_exp n) = bpow eminbeta:radixemin:Zx:RZx:x <> 0%Rbpow (cexp beta FIX_exp x) = bpow eminbeta:radixemin:Zx:RZx:x = 0%R~ (FIX_exp (emin - 1) < emin - 1)%Zbeta:radixemin:Zx:RZx:x = 0%Rforall n : Z, (n <= FIX_exp n)%Z -> bpow (FIX_exp n) = bpow eminbeta:radixemin:Zx:RZx:x <> 0%Rbpow (cexp beta FIX_exp x) = bpow eminbeta:radixemin:Zx:RZx:x = 0%Rforall n : Z, (n <= FIX_exp n)%Z -> bpow (FIX_exp n) = bpow eminbeta:radixemin:Zx:RZx:x <> 0%Rbpow (cexp beta FIX_exp x) = bpow eminreflexivity. Qed.beta:radixemin:Zx:RZx:x <> 0%Rbpow (cexp beta FIX_exp x) = bpow eminbeta:radixemin:ZExists_NE beta FIX_expbeta:radixemin:ZExists_NE beta FIX_expright; split; auto. Qed. End RND_FIX.beta:radixemin:ZZ.even beta = false \/ (forall e : Z, ((emin < e)%Z -> (emin < e)%Z) /\ ((e <= emin)%Z -> emin = emin))