slow complex<double>'s with g++

Brian Budge
Fri Mar 3 18:28:00 GMT 2006

It may be that I'm missing something, but you appear to be computing
different things...

Zi = 2.0*Zr*Zi + Ci;
Zr = Tr - Ti + Cr;


 Z = Z*Z + C;

No doubt the 2.0 makes a difference...

There are several minor optimizations also that might speed up your
code... if you're interested, email me offline.


On 3/3/06, Greg Buchholz <> wrote:
> Brian Budge wrote:
> > Which command line arguments are you using?
>     Mostly "-O3", but I've tried lots of combinations of different
> options and I haven't yet found the magic incantation.
> >Can you make use of sse2?
>     Well, there is a C version that I wrote which uses gcc's vector
> extensions and SSE2...
> ...but right now I'm more interested in why normal complex<double>'s are
> so slow.
> Greg Buchholz

More information about the Gcc-help mailing list