This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Minimum floating-point requirements
- From: Rich Felker <dalias at aerifal dot cx>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 16 Feb 2014 19:35:40 -0500
- Subject: Re: Minimum floating-point requirements
- Authentication-results: sourceware.org; auth=none
- References: <OF54854818 dot C108092B-ON86257C7B dot 0063B8C0-86257C7B dot 006B6B53 at us dot ibm dot com> <Pine dot LNX dot 4 dot 64 dot 1402102231400 dot 26591 at digraph dot polyomino dot org dot uk> <CAGWvnyn-Cj4Mw4efQTs2MYFHhknyskAEznEqpGeYnb9rY3X4hg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1402150136490 dot 31722 at digraph dot polyomino dot org dot uk> <CAGWvny=aJCdoQvC8q-dNvFdDNAqRCcZ7_adD=Sst8FDr0MN1Qg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1402151656510 dot 6358 at digraph dot polyomino dot org dot uk> <20140216045946 dot GG184 at brightrain dot aerifal dot cx> <CAGWvny=9Jeippop9xuERzwgWL8+QbZiqQFhgxGNdAW0C=EnOLQ at mail dot gmail dot com> <20140216214623 dot GI184 at brightrain dot aerifal dot cx> <53014CBC dot 6080508 at linux dot vnet dot ibm dot com>
On Sun, Feb 16, 2014 at 08:41:48PM -0300, Adhemerval Zanella wrote:
> I'd like to focus on practical side: you cited 'I make this complaint about IBM
> double-double as a floating point programmer who specifically has to work around
> its brokenness'. Do you have an empirical example where you had to circumvent the
> issues with IBM long double to make your code to work properly? I'm asking because
> I sincerely would like to know a real world case where IBM long double is causing
> issues.
I have not tested the code with IBM double-double, so I can't say for
sure that it breaks, but my strtod/f/ld implementation depends on
rounding semantics which I can't see how IBM double-double could
provide. For example it expects adding and subtracting an appropriate
power of two to be able to force rounding at a particular binary
place, per the current rounding mode. This is a standard idiom that
lots of floating point code attempting to get exact or
correctly-rounded results will perform. The reason for wanting to
perform it in long double is that smaller types are subject to excess
precision on i386 (and unlike IBM double-double, which is an
implementation choice, excess precision on i386 is not something you
can opt out of; it's inherent in the hardware).
I could probably find other examples if necessary.
Rich