This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jan 2005 23:01:15 -0000
- Subject: [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
- References: <20050124195729.19609.Thomas.Koenig@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2005-01-24 23:01 -------
Hi Richard. It seems to me that the problem is in the implemented formula.
Looking at Goldberg, when |d| >= |c| in its paper,that is |bi| > |br| in the
Gcc code, we should have, at the end of the calculation:
((ai + ar*ratio)/div) + i((-ar + ai*ratio)/div)
and *not*:
((ar + ai*ratio)/div) + i((ai - ar*ratio)/div)
Indeed, this explanation is consistent with the behavior observed with
the specific testcase.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19609