[Cfp-interest 1475] Re: complex multiplication and division
Damian McGuckin
damianm at esi.com.au
Sat Feb 8 13:11:30 PST 2020
Hi Paul,
On Fri, 7 Feb 2020, paul zimmermann wrote:
> /* generated with ./mpcheck-double -seed 1473128 */
> x = -8.2287892462057963e+188 + I * 4.7082627796239037e+122;
> y = -1.0987942433164555e-323 + I * 6.4181344246145655e-324;
Just looking at 'y', both of these numbers are subnormal. Your own output
says that 'y' (as represented) is nothing like the numbers that you typed
above. Your program printed:
> y=(-9.8813129168249309e-324,4.9406564584124654e-324)
The reason for the difference is that representing the components of 'y'
as a double will underflow and loose lots of the least significant digits.
If I change your program to use
y = -9.8813129168249309e-324 + I * 4.9406564584124654e-324
where this number is the actual value of what you are representing, the
results are still what you saw, i.e.
x*y=(8.1311241468363422e-135,-4.0655620734181711e-135)
I reran your problem with 'long double complex' but again with
y = -9.8813129168249309e-324 + I * 4.9406564584124654e-324
It produces the same results as you say with doubles. Your might like to
rerun MFPR with this number.
The issue you are seeing is related to representational error, not any
rounding issues.
What Jim has said still stands but your phenomena are something different.
Regards - Damian
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer
More information about the Cfp-interest
mailing list