Re: complex arithmetic in lcc-Win32



jacob.navia wrote:
John Smith a écrit :


Please read my post carefully. I'm not referring to the source code. I'm referring to the sources (in the general sense of the word) of your algorithms. Yes, the "source code" *is* where it's supposed to be.

JS



Most of them are public domain, I mean, multiplication of complex
numbers, etc are not very difficult to find.

Granted, but the best algorithms for even the basic operations are often not quite as simple as those usually seen. For example multiplication:

The naive algorithm uses the simple formula:

(a + bi)(c + di) = (ac - bd) + (ad + bc)i

A better method computes P = (a + b)(c + d); then applies the formula:

(a + bi)(c + di) = (a c - b d) + (P - a c - b d)i

This replaces one O(t^2) multiplication by three O(t) additions.


For some functions, I used the library of Stephen L Moshier,
as I have done in many other places.

jacob

OK, thanks. I'll look for it.

JS
.