[Cfp-interest 3131] about C26 Issue 1
Jerome Coonen
jcoonen at gmail.com
Wed Jun 19 00:12:59 PDT 2024
This issue begins with the special cases for lgamma() and tgamma(). It then
leaks into the definition of "error" cases in 7.12.1 and even their names.
Proposal 1 -- 7.12.8.3 para 2 on lgamma (log gamma)
Current:
A pole error may occur if x is a negative integer or zero.
Proposed:
No change.
Proposal 2 -- 7.12.8.4 para 2 on tgamma (gamma function)
Current:
A domain error or a pole error may occur if x is a negative integer or zero.
Proposed:
A domain error may occur if x is a negative integer. A domain error or a pole
error may occur if x is zero.
Proposal 3 -- 7.12.1 para 3
Current:
Similarly, a pole error (also known as a singularity or infinitary) occurs
if and only if the mathematical function has an exact infinite result as
the finite input argument(s) are approached in the limit (for example,
log(0.0)). The description of each function lists any required pole errors;
an implementation may define additional pole errors, provided that such
errors are consistent with the mathematical definition of the function. On
a pole error, the function returns an implementation-defined value; if the
integer expression math_errhandling & MATH_ERRNO is nonzero, the integer
expression errno acquires the value ERANGE; if the integer expression
math_errhandling & MATH_ERREXCEPT is nonzero, the "divide-by-zero"
floating-point exception is raised.
Work in progress for discussion:
Similarly, a pole error (also known as a singularity) occurs at a finite
argument if and only if either the left-sided or right-sided limit of the
mathematical function exists and the limit is infinite (for example,
log(0.0)) or if both limits exist and agree. A pole error also arises when
the argument is signed zero and the left-sided and right-sided limits
exist, are infinite, and disagree. In this case, the implementation may use
the sign of the argument to determine the sign of the infinite result. The
description of each function lists any pole errors that arise. On a pole
error, the function returns an implementation-defined value; if the integer
expression math_errhandling & MATH_ERRNO is nonzero, the integer expression
errno acquires the value ERANGE; if the integer expression math_errhandling
& MATH_ERREXCEPT is nonzero, the "divide-by-zero" floating-point exception
is raised.
DISCUSSION
- Just one of domain error or pole error may arise for tgamma(0).
- Use of one-sided limits eliminates the need to talk about the extended
reals and "exact Infinity".
- A larger issue is the ambiguity between the "error" definitions at a
conceptual/mathematical level and the requirement to report "errors" in
systems.
- "Pole" is not my favorite term, but it is more important to clarify
the concepts than to find the pithiest names.
-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/20240619/e9c0c1f7/attachment.htm>
More information about the Cfp-interest
mailing list