Non-NaN results for conventional IEEE directed arithmetic #
Directed dyadic rounding may produce a finite value or an infinity, but never a NaN. Consequently, directed addition, subtraction, multiplication, and nonzero-denominator division preserve the non-NaN classification when both operands are finite. These facts are shared by the IEEE interval soundness proofs.
theorem
FloatLib.Floats.Formats.BinaryInterchange.Model.isNaN_divDown_eq_false_of_isFinite
{fmt : FloatFormat}
(x y : Model fmt)
(hfmt : fmt.isIEEE = true)
(hx : x.isFinite = true)
(hy : y.isFinite = true)
(hy0 : y.isZero = false)
:
Directed-down division is non-NaN on finite operands with a nonzero divisor.
theorem
FloatLib.Floats.Formats.BinaryInterchange.Model.isNaN_divUp_eq_false_of_isFinite
{fmt : FloatFormat}
(x y : Model fmt)
(hfmt : fmt.isIEEE = true)
(hx : x.isFinite = true)
(hy : y.isFinite = true)
(hy0 : y.isZero = false)
:
Directed-up division is non-NaN on finite operands with a nonzero divisor.