This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
optimization of complex multiplication as of gcc 4.0.1
- From: Luc Bourhis <Luc dot Bourhis at durham dot ac dot uk>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 6 Sep 2006 18:48:31 +0200
- Subject: optimization of complex multiplication as of gcc 4.0.1
I would like to know whether the multiplication of two complex
numbers, one of which being actually a real number, e.g.
std::complex<double> a(1,0);
std::complex<double> b(1,1.2);
std::cout << a*b << std::endl;
is optimised to save the trivial multiplications 0*1.2 and 0*1 (in my
example) and the subsequent addition and subtraction.
Luc Bourhis
Research Assistant
Chemical Crystallography Laboratory
University of Durham, UK