[Cfp-interest 3314] suggestions for fadd/fsub/fma error reporting
Jerome Coonen
jcoonen at gmail.com
Mon Oct 14 13:50:18 PDT 2024
This responds to an action item from the August 2024 meeting to review the
error reporting of fadd, fsub, and fma.
*Suggestions:*
fadd – change the last sentence of 7.12.15.2#2 to
A domain error may occur for both arguments infinite and
with opposite sign.
fsub – change the last sentence of 7.12.15.3#2 to
A domain error may occur for both arguments infinite and
either unsigned or with the same sign.
fmul – change the last sentence of 7.12.15.4#2 to
A domain error may occur for one infinite argument and one
zero argument.
fdiv – change the second to the last sentence of 7.12.15.5#2 to
A domain error may occur for either both arguments infinite
or both arguments zero.
fma – change the last sentence of 7.12.15.6#2 to
A domain error may occur if one of x and y is zero and the
other is infinite. A domain error may occur if z is infinite and one of x
and y is infinite while the other is nonzero finite or infinite, such that
their product has the opposite sign of z.
fsqrt – change the last sentence of 7.12.15.7#2 to
A domain error may occur if the argument is less than zero.
*Rationale:*
This change makes explicit which cases may cause domain errors in fadd,
fsub, and fma. The case of fsub is expanded to include unsigned
(projective) infinity, should it be implemented, in the one case of
magnitude subtraction of unsigned infinite values.
The change also brings the reporting requirements of all functions in
7.12.15 into harmony by weakening the specification for fmul, fdiv, an
fsqrt from "error occurs" to "error may occur". The alternative suggestion,
to strengthen all reporting to "error occurs", could break some existing
implementations.
This proposal will not break any existing implementations.
-Jerome Coonen
650.996.4738
jcoonen at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20241014/dcfc8ae4/attachment.htm>
More information about the Cfp-interest
mailing list