[Cfp-interest 3140] about C26 Issue 1
Jerome Coonen
jcoonen at gmail.com
Mon Jul 15 23:02:22 PDT 2024
This issue deals with pole errors and how they occur in lgamma() and
tgamma().
Proposal 1 -- 7.12.1#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.
Proposed:
Similarly, a pole error occurs in certain cases where the arguments are
finite and the mathematical function has an infinite limit (for example, a
pole error occurs at *log(0.0)* because log(x) has a right-hand limit of -∞ at
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.
Proposal 2 -- 7.12.8.3#2 on lgamma (log gamma)
Current:
A pole error may occur if x is a negative integer or zero.
Proposed:
No change; see the discussion below.
Proposal 3 -- 7.12.8.4#2 on tgamma (gamma function)
Current:
A domain error or a pole error may occur if x is a negative integer or zero.
Proposed:
No change; see discussion below.
DISCUSSION
- The description of a "pole error" streamlines the concepts and the
language -- there is no mention of "exact infinity", "singularity", or
"infinitary", and no attempt to capture all the mathematical cases.
- The language "occurs in certain places" emphasizes that the pole error
is an artifact of the C language library, as opposed to a purely
mathematical concept.
- Theusage that a pole error or other error "may occur" vs. "occurs" is
a document-wide issue. Domain, pole, and range errors "may occur" 13, 14,
and 6 times, respectively. This is a rich subject touching on possible new
requirements for math.h.
- log gamma -- "may occur" applies to lgamma() in the same spirit as
with log() and tanpi(). In this case, the function tends to +∞ at the
points of interest.
- gamma -- "may occur" applies to tgamma() in a more subtle way, as in
tanpi(), with its two 1-sided limits at the points of interest. If the
arithmetic supports signed 0, then the sign of the infinite or huge result
at 0.0 is determined. Or, as with tanpi(), one might arbitrarily assign
tgamma(x) at negative integer x to be -∞ if x is odd and +∞ if x is
even. This would eliminate the domain errors and motivate pole errors at
the negative integers.
Thanks for having a look.
-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/20240715/4e679bbf/attachment.htm>
More information about the Cfp-interest
mailing list