|
From: | Marc Glisse |
Subject: | Re: round-off error in std::pow(std::complex<T>, double) in C++11 |
Date: | Fri, 25 Jan 2013 17:41:02 +0100 (CET) |
User-agent: | Alpine 2.02 (DEB 1266 2009-07-14) |
On Fri, 25 Jan 2013, Paolo Carlini wrote:
On 01/25/2013 04:44 PM, Paolo Carlini wrote:.. oops, I just noticed what Marc suggested in the PR about changing pow(const complex<>&, const _Tp&) to *actually* forward to the complex builtins when not fast math. That seems a good ideaI have to add to this, however, that unless I did something badly wrong in a quick prototype, simply forwarding to the (complex, complex) builtin would *not* fix the round-off issue for this specific example.
Indeed, the glibc-2.13 version I have here gives a wrong rounding. As far as I can see in svn, they still implement cpow(x,y) as cexp(y*clog(x)). The inaccuracy issue seems known:
http://sourceware.org/bugzilla/show_bug.cgi?id=14473 I don't know if other platforms have an accurate cpow. -- Marc Glisse
[Prev in Thread] | Current Thread | [Next in Thread] |