NLA-lib Explorer

NLAlib.Computation.absRelErr_float_sub

Library · theorem

Native binary64 subtraction has relative error on a finite result. [Higham2002, §2.2].

NLAlib.Computation.absRelErr_float_sub (x y : Float) (hf : (x - y).isFinite = true) :
  Computation.AbsRelErr Float.Model.Format.binary64.unitRoundoff 0
    (Computation.floatDecode x - Computation.floatDecode y) (Computation.floatDecode (x - y))

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.NativeFloat.