NLA-lib Explorer

Float.Model.UnpackedFloat.abs_toReal_roundWithAccuracy_sub_le

Library · theorem

roundWithAccuracy is within half a unit in the last place (at the target exponent) of the exact value s * (w * 2 ^ e).

Float.Model.UnpackedFloat.abs_toReal_roundWithAccuracy_sub_le (spec : Float.Model.Format)
  (s : Float.Model.UnpackedFloat.Sign) (m : ℕ) (e : ℤ) (acc : Float.Model.UnpackedFloat.Accuracy)
  (w : ℝ)
  (hw : (Float.Model.UnpackedFloat.ExtendedMantissa.ofMantissaAndAccuracy m acc).Approximates w)
  (he : e ≤ spec.targetExponent (Float.Model.totalExponent m e)) :
  |(Float.Model.UnpackedFloat.roundWithAccuracy spec s m e acc).toReal - s.toReal * (w * 2 ^ e)| ≤
    2 ^ spec.targetExponent (Float.Model.totalExponent m e) / 2

Full source on GitHub

Import NLAlib.ForMathlib.Data.Float.Rounding.