L
Luna Moon
looking for the fastest complex number arithmetics...
Hi all,
I am looking for the fastest complex number arithmetics.
There is one part of my program which needs complex number
arithmetics.
The final result is a real number.
So I had two choices:
(1) Using the C++ class, and do all the operations in complex domain,
and finally extract out the real part of the result.
(2) Calculate the real part of result in closed-form by hand, and
program everything in C/C++ in real domain.
I used to do (2). And I used Maple to help me obtain the real part of
the complex-valued expressions in closed form and generate the C code.
The speed is about 10x faster than (1).
Now we are adding more and more terms into that expression and it
looks like it is going to go beyond the capability of Maple and the
limit of memory and CPU resources, in order to obtain the real part of
the complicated expressions. And also the code generated by Maple is
not readable and making a change to the expressions means redoing
everything...
So now we have to seriously consider the possibility of approach (1).
Where can I find the fastest complex number arithmetics? Why is the C+
+ complex class so slow? (my rough estimate is that it is probably
slower than Matlat's complex number operations)...
Any tricks/tips/thoughts on complex number programming?
Thanks!
Hi all,
I am looking for the fastest complex number arithmetics.
There is one part of my program which needs complex number
arithmetics.
The final result is a real number.
So I had two choices:
(1) Using the C++ class, and do all the operations in complex domain,
and finally extract out the real part of the result.
(2) Calculate the real part of result in closed-form by hand, and
program everything in C/C++ in real domain.
I used to do (2). And I used Maple to help me obtain the real part of
the complex-valued expressions in closed form and generate the C code.
The speed is about 10x faster than (1).
Now we are adding more and more terms into that expression and it
looks like it is going to go beyond the capability of Maple and the
limit of memory and CPU resources, in order to obtain the real part of
the complicated expressions. And also the code generated by Maple is
not readable and making a change to the expressions means redoing
everything...
So now we have to seriously consider the possibility of approach (1).
Where can I find the fastest complex number arithmetics? Why is the C+
+ complex class so slow? (my rough estimate is that it is probably
slower than Matlat's complex number operations)...
Any tricks/tips/thoughts on complex number programming?
Thanks!