On 2024-09-13 8:53 a.m., Jonathan Dushoff wrote:
Message: 4
Date: Thu, 12 Sep 2024 11:21:02 -0400
From: Duncan Murdoch <murdoch.dun...@gmail.com>
That's not the correct formula, is it? I think the result should be x *
Conj(y) / Mod(y)^2 .
Correct, sorry. And thanks.
So that would involve <double> * <complex> and
<complex> / <double>, not just real arithmetic.
Not an expert, but I don't see it. Conj and Mod seem to be numerically
straightforward real-like operations. We do those, and then multiply
one complex number by one real quotient.
Are you sure? We aren't dealing with real numbers and complex numbers
here, we're dealing with those sets extended with infinities and other
weird things.
I think the formula I gave assumes no infinities.
So for example if y is some kind of infinite complex number, then 1/y
should come out to zero, and if x is finite, the final result of x/y
should be zero.
But if we evaluate x/y as (x / Mod(y)^2) * Conj(y), won't we get a NaN
from zero times infinity?
I imagine someone has thought about all these edge cases. Maybe they're
discussed in one of the standards that Richard referenced.
Duncan Murdoch
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.