This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/18875] Excess precision leads incorrect libm
- From: "joseph at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 26 Aug 2015 13:15:12 +0000
- Subject: [Bug math/18875] Excess precision leads incorrect libm
- Auto-submitted: auto-generated
- References: <bug-18875-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18875
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
That would be the issue Carlos has twice reported.
https://sourceware.org/ml/libc-alpha/2015-01/msg00484.html
https://sourceware.org/ml/libc-alpha/2015-01/msg00485.html
https://sourceware.org/ml/libc-alpha/2015-07/msg00212.html
Fixing it shouldn't be hard - just store to and load back from the stack
(remembering CFI adjustments) before return, at least when the result is
below FLT_MIN (DBL_MIN for the double functions - the issue could
presumably appear for those as well depending on the compiler version).
I've just never seen this issue with the compilers I've been testing with,
so am not in a good position to prepare and test a fix.
E.g. atan2 already does this, together with (in the case of small results)
storing to the stack the result of multiplying the small result by itself
to avoid missing underflow exceptions if the extended precision result
rounds exactly to float / double but in fact isn't exact. The same issue
of avoiding such missing underflows also applies to these functions, so
you could always copy all the code from atan2f / atan2 that compares with
FLT_MIN / DBL_MIN and handles these issues if so (minus the fabs
instructions since the functions in question here never have negative
results).
--
You are receiving this mail because:
You are on the CC list for the bug.