11706 vs ([lno] Canonical iv creation)
Richard Guenther
rguenth@tat.physik.uni-tuebingen.de
Sat Mar 13 11:40:00 GMT 2004
Paolo Carlini wrote:
> Richard Guenther wrote:
>
>> I'm curious to how the standard actually defines std::pow()s accuracy
>> here though. I know we're not optimizing ::pow(x, 4) to the above
>> without -ffast-math because of accuracy concerns. So how does
>> std::pow() relate to ::pow in terms of accuracy guarrantees?
>
>
> Really interesting issue...
>
> Anyway, from a practical point of view I'm not really worried, since:
>
> 1- Glibc uses internally the very same algorithm, at least on x86 (just
> checked).
>
> 2- Which requires O(log n) multiplications and is discussed by Knuth in
> Sec. 4.6.3 of the second volume. You can find it almost *everywhere*,
> for instance also in SGI's power.
So there is no point in not optimizing ::pow(x, 4) without -ffast-math?
Richard.
More information about the Libstdc++
mailing list