NLA-lib Explorer

Float.Model.BinaryRounding.isNearestFloat_of_lattice

Library · theorem

A represented lattice point within half a spacing of an input is a nearest grid value if the lattice is the smallest-exponent lattice, or if 2^{t+p-1}\le\lvert \mathbf{x}\rvert. The precision satisfies p\ge1, and the lattice exponent satisfies t\ge e_{\min}.

Float.Model.BinaryRounding.isNearestFloat_of_lattice {p : ℕ} {emin : ℤ} {x r : ℝ} {t : ℤ}
  (hp : 1 ≤ p) (ht : emin ≤ t) (hx : t = emin ∨ 2 ^ (t + ↑p - 1) ≤ |x|)
  (hr : Float.Model.BinaryRounding.IsBinaryFloat p emin r) (hk : ∃ k, r = ↑k * 2 ^ t)
  (hd : |r - x| ≤ 2 ^ t / 2) : Float.Model.BinaryRounding.IsNearestFloat p emin x r

Full source on GitHub

Import NLAlib.ForMathlib.Data.Float.BinaryFormat.