This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: [PATCH, libstdc++, complex] complex multiplication algorithm improved


From: Wang Feng <wanng.fenng@gmail.com>
Date: 16 September 2010 16:38
Subject: Re: [PATCH, libstdc++, complex] complex multiplication
algorithm improved
To: Gabriel Dos Reis <gdr@integrable-solutions.net>


On 15 September 2010 21:39, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
> Hi,
> I would like to see more data to support the change.
> (I apologize if the mere mention of "numerical recipe"
> does not move me.)
> I am in no way claiming that the current implementation
> in all conceivable aspects. ÂHowever, I think we need to
> have "good" reasons to move the implementation one
> way or the other. Â I also think we should be using
> builtin __complex__ T for standard integer type T.
>
I have to admit this will slow down our program while using
float/double/long double, but I guess situation might be better for
old-styled cpus.

BTW, Âwould you please take a look at Eq. 5.4.4 - 5.4.7 in
http://www.haoli.org/nr/bookcpdf/c5-4.pdf ?
I noticed abs is precision-optimized for all types, but this kind of
optimization leads abs(complex<int>(3,4)) to 4, not 5,
while division and square root functions are not optimized for
float/double/long double.

sorry for the noise.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]