NLA-lib Explorer

NLAlib.Computation.FiniteFloat.sqrt_spec

Library · theorem

Native square root of a finite nonnegative word is finite and nonnegative, with binary64 relative and gradual-underflow allowances. [Higham2002, §2.2].

NLAlib.Computation.FiniteFloat.sqrt_spec (x : Computation.FiniteFloat)
  (hx : 0 ≤ Computation.floatDecode ↑x) :
  (↑x).sqrt.isFinite = true ∧
    0 ≤ Computation.floatDecode (↑x).sqrt ∧
      Computation.AbsRelErr Float.Model.Format.binary64.unitRoundoff
        Float.Model.Format.binary64.underflowBound (√(Computation.floatDecode ↑x))
        (Computation.floatDecode (↑x).sqrt)

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.NativeFloatSqrt.