This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/14034] acos (-1.0) gives -pi in round-downwards mode on x86


http://sourceware.org/bugzilla/show_bug.cgi?id=14034

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #1 from Rich Felker <bugdal at aerifal dot cx> 2012-04-29 17:32:06 UTC ---
One quick (but probably wrong; see below) solution I can think of is adding a
single fabs instruction just before return.

With that said, the value of -Ï returned by glibc's acos(-1) in
downward-rounding mode also differs from the value of -Ï obtained by -acos(1),
with a difference of 1ulp. What's significant (and probably bad) about this is
that the value is actually less than -Ï (the actual value), and thus if you
just take the absolute value, you get a result that's greater than Ï, which
would be rather unexpected in downward-rounding mode. It's within 1ulp so it
may technically be conformant, but it seems very bad.

On the other hand, inserting the fabs instruction just after the fsqrt
instruction (where the only thing it can do is convert -0 to +0) seems to work,
and the value I get trying it is the correctly-rounded representation of Ï.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]