NLA-lib Explorer

NLAlib.exists_floatMachine_isAccurate_binaryFloatRound

Library · theorem

A bounded-format machine satisfies the contract: for a binary format fmt with precision p, smallest exponent e_{\min} and largest finite number \Omega, and nonnegative constants, there is a NLAlib.FloatMachine on stored reals whose addition, subtraction, multiplication, division by a nonzero and conversion round the exact result to fmt (NLAlib.Computation.binaryFloatRound, gradual underflow), meeting NLAlib.FloatMachine.IsAccurate with the identity decoding, u = 2^{-p}, floor \tau = 2^{e_{\min} + p - 1}, range \Omega and c_{\mathrm{N}} = \sqrt2: the uniform sampler clamps the rounded s\mathbf{v} to [-s, s], the normal sampler rounds both parts, and the black boxes are exact. The bounded model is therefore an instance of the contract, not a separate one. No printed source.

NLAlib.exists_floatMachine_isAccurate_binaryFloatRound (fmt : Float.Model.Format) {r : ℝ → ℤ}
  (hr : ∀ (x : ℝ), Computation.AbsRelErr 0 (1 / 2) x ↑(r x)) {μM μQ : ℕ → ℝ}
  (hμM : ∀ (d : ℕ), 0 ≤ μM d) (hμQ : ∀ (d : ℕ), 0 ≤ μQ d) :
  ∃ M,
    M.IsAccurate id (2⁻¹ ^ fmt.mantissaBits) (2 ^ (fmt.minExponent + ↑fmt.mantissaBits - 1))
        fmt.maxFinite μM μQ √2 ∧
      (∀ (x y : ℝ), M.add x y = Computation.binaryFloatRound fmt r (x + y)) ∧
        (∀ (x y : ℝ), M.sub x y = Computation.binaryFloatRound fmt r (x - y)) ∧
          (∀ (x y : ℝ), M.mul x y = Computation.binaryFloatRound fmt r (x * y)) ∧
            ∀ (x y : ℝ), y ≠ 0 → M.div x y = Computation.binaryFloatRound fmt r (x / y)

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.Machine.