|
Message-ID: <20240811200812.GZ3766212@port70.net> Date: Sun, 11 Aug 2024 22:08:12 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: Damian McGuckin <damianm@....com.au> Cc: MUSL <musl@...ts.openwall.com> Subject: Re: catan(z) * Damian McGuckin <damianm@....com.au> [2024-08-12 00:01:01 +1000]: > > In this routine, there are 2 lines of code > > t = 0.5 * atan2(2.0 * x, a); > w = _redupi(t); > > The first computes atan2() which returns a number in the range [-pi,+pi] > which means that t is a number in the range [-pi/2,+pi/2]. > > As far as I understand, the routine _redupi(t) accepts a argument and > reduces it into the range [-pi, +pi]. Am I mistaken? *reduces into [-pi/2, pi/2] > > If I am not wrong, and 't' is already in the range that _redupi(t) will > return, then _redupi() just returns its argument (within a rounding error). > So it seems like a no-op to me. > > Can anybody comment? it only changes the endpoints (t=+-pi/2 case) otherwise no-op i dont know if we care about the endpoints but even if we do there are better ways to fix them up i think _redupi can be removed, nice catch. > > The routine is originally from Moshier's Cephes library. I have Moshier's > book but I cannot find any hints there. > > Thanks - Damian
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.