This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Complex arithmetic improvements?


  > Line 1266: /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */ 
  > 
  > this can be improved to
  > 
  >             = (ac - bd) + i[ (a+b)(c+d) - ac - bd ]

Don't do this.

1) It is numerically instable.
2) It does not save any time on modern CPUs.

Torbjörn


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]