11706 vs ([lno] Canonical iv creation)

Paolo Carlini pcarlini@suse.de
Sat Mar 13 00:33:00 GMT 2004


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.

Paolo.



More information about the Libstdc++ mailing list