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

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Sep 15 14:02:00 GMT 2010


On Wed, Sep 15, 2010 at 3:10 AM, Wang Feng <wanng.fenng@gmail.com> wrote:
> Hi,
>    Complex number multiplication done with 4 multiplications, but
> this one only need 3:
>
>             (a+ib)(c+id) = ac - bd + i( bc + ad ) -- 4 multiplies
>                                = ac - bd + i[ ( a + b )( c + d ) - ac
> - bd ] -- 3 multiplies
>

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.



More information about the Gcc-patches mailing list