Re: mysterious remquo bug

2024-09-15 Thread Martin Husemann
On Sun, Sep 15, 2024 at 07:53:54PM -0400, Greg Troxel wrote: > I'm doing all this on netbsd-10, amd64, system gcc 10, intel 9th > generation i7. The following test program calls remquo with (-90, 90). > This is from a test in geodesiclib in proj of a high-accuracy sincos > implementation, which re

Re: mysterious remquo bug

2024-09-15 Thread Robert Elz
Date:Sun, 15 Sep 2024 19:53:54 -0400 From:Greg Troxel Message-ID: | C99/POSIX define remquo: | https://pubs.opengroup.org/onlinepubs/9799919799/functions/remquo.html I know really nothing about any of this, but that's still the 2018 version of POSIX, and I do

Re: mysterious remquo bug

2024-09-15 Thread RVP
On Sun, 15 Sep 2024, Greg Troxel wrote: The test program calls remquo twice, one with the -90 in a double, and once with it as a literal. The first time gets a positive q -- which messes up the sin calculation, wwhich is how I got here. The second is correct. Not a math nerd, but, I can exp

Re: mysterious remquo bug

2024-09-15 Thread Greg Troxel
FreeBSD has a change, which resolves the sign of q bug (1 vs -1): However, it still has q being 0 when it should be -2^n. The patch at end causes my remquo test programs proj's regression tests to all pass. The first three hunks are from FreeBSD: https://cgit.freebsd.org/src/commit/lib/ms

mysterious remquo bug

2024-09-15 Thread Greg Troxel
C99/POSIX define remquo: https://pubs.opengroup.org/onlinepubs/9799919799/functions/remquo.html The basic idea is that return value r is a remainder, and in q is stored the low-order k bits of the quotient, but with q having the same sign as the quotient. The point is to reduce possibly large