[cfp-interest 3463] Re: Range error conditions for atan2 and atan2pi

RAJAN BHAKTA rbhakta at us.ibm.com
Thu May 15 08:36:05 PDT 2025


Hi Paul,

If you are referring to CFP message 3458, the textual change we were referring to was regarding the first part, aka, change the text to read “A range error occurs if x is positive and if y/x is nonzero and too close to zero.”.

I believe in the replied to message below, you are referring to the second part of Javier’s message which was already responded to previously and we are not suggesting any change.

If I misunderstood your message, please let me know.

Regards,


From: Paul Zimmermann <Paul.Zimmermann at inria.fr>
Date: Thursday, May 15, 2025 at 2:51 AM
To: RAJAN BHAKTA <rbhakta at us.ibm.com>
Cc: javier at aerotri.es <javier at aerotri.es>, cfp-interest at ucbtest.org <cfp-interest at ucbtest.org>
Subject: [EXTERNAL] Re: [cfp-interest 3458] Re: Range error conditions for atan2 and atan2pi
       Hi,

> atan2:
>
> The atan2 functions [...]. A domain error may occur if both arguments are
> zero. A range error occurs if x is positive and nonzero y/x is too close to
> zero.
>
> Why "positive"? Considering that atan2 is an odd function, +x and -x should
> give +alpha and -alpha uniformly. The "atan", "sin", "tan", etc. functions
> don't make this distinction. Its presence in atan2 and atan2pi seems
> spurious.

for y/x close to zero and x > 0, atan2(y,x) is close to zero, since z = x+i*y
is near the right real axis, and atan2(y,x) gives the angle of the complex
number z.

However, for y/x close to zero and x < 0, the complex number z is close to the
left real axis, and then atan2(y,x) is close to +/-pi according to the sign of
y. In that case there can be no underflow, thus no domain error.

Thus the current text is fine.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250515/b3b29da2/attachment-0001.htm>


More information about the cfp-interest mailing list