[Cfp-interest 3283] complex divide and multiply

Fred J. Tydeman tydeman at tybor.com
Wed Sep 18 10:47:23 PDT 2024


For these, consider "I" to be pure imaginary
(instead of using the CMPLX macros)

Consider (0.0 + I*0.0) / ( NAN + I*3.0)
If the NAN is replaced with any finite or infinite real value,
the result is 0.0 + I*0.0
However, if one uses the math formula, one gets NAN + I*NAN

Or, consider (0.0 + I*0.0) / (INFINITY + I*0.0)
The result should be 0.0 + I*0.0
However, using the math formula, one gets NAN + I*NAN

Consider (1.0 + I*0.0) * (INFINITY + I*0.0)
If one uses the math formula, one gets INFINITY + I*NAN,
whereas if one considers it as a number on the real axis
times another number on the real axis, the result should
be on the real axis, or INFINITY + I*0.0

Or, consider (1.0 + I*0.0) * (INFINITY + I*INFINITY)
If one uses the math formula, one gets NAN + I*NAN,
whereas if one considers it as a number on the real axis
times a complex number, the result should be  as if
real*complex, or INFINITY + I*INFINITY

I believe that the usual math formulas are OK as long as
there is no INFINITY or NAN components in the inputs.


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list