Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240815142825.GP10433@brightrain.aerifal.cx>
Date: Thu, 15 Aug 2024 10:28:25 -0400
From: Rich Felker <dalias@...c.org>
To: Damian McGuckin <damianm@....com.au>
Cc: MUSL <musl@...ts.openwall.com>
Subject: Re: catan(z)

On Thu, Aug 15, 2024 at 12:12:35PM +1000, Damian McGuckin wrote:
> On Wed, 14 Aug 2024, Rich Felker wrote:
> 
> >If I'm following, it sounds like the current behavior is either a
> >no-op or wrong and removing the _redupi step entirely would make it
> >correct or at least closer to correct. Do you agree?
> 
> Just a no-op.  Unless there is some subtle reason why Moshier did
> this why I am too dumb to understand.  I think the issue was that
> back in the 80s when he wrote it, there were some unstandardised
> atan2() routines which (Moshier alluded to in his book and which)
> returned results in [0,2*pi] rather than the now standardized
> routines with return in [-pi,+pi] and he was handling those issues.
> 
> >Any suggestions for a test to run? I did some basic smoke testing for
> >large positive real inputs and got expected results.
> 
> Not off hand. Other issues taking my brain cycles right nnow. Young
> Mr Nagy might have a better idea.

OK, that makes sense. Proposed patch attached. I think the code could
(maybe should) actually be reordered and simplified at some point
without confusing reuse of temporaries and without temp storage of the
real result in a complex var, but I made the patch a minimal
bad-code-removal for now. Further cleanup could be done separately.

Rich

View attachment "0001-catan-remove-no-up-reduction-mod-pi-and-unused-code.patch" of type "text/plain" (3402 bytes)

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.