Computing the square root of complex number in a stable manner

280 Views Asked by At

The square root $\pm(u+iv)$ of a complex number $x+iv$ with $y\neq0$ may be calculated from the formulas

$u=\pm\sqrt{\frac{x+\sqrt{x^2+y^2}}{2}}$

$v=\frac{y}{2u}$

compare the cases $x\geq0$ and $x<0$ with respect to the numerical stability. Modify the formulas if necessary to ensure numerical stability. I study this problem. Square root of a complex number but in my question proposed Numerical stability. and I don't know What does it mean and what can be done with numerical stability here?

1

There are 1 best solutions below

1
On BEST ANSWER

You must first study the concept of catastrophic cancellation. This occurs when we subtract approximations of two real numbers that are relatively close to each other. This is a basic but extremely important point in numerical analysis. You will find very brief summary and analysis in this answer

Returning to the problem of complex square roots. The expression $$u = \sqrt{\frac{\sqrt{x^2+y^2}+x}{2}} $$ will not experience catastrophic cancellation as long as $x>0$. Afterwards, you can compute $v$ using $v = \frac{y}{2u}$.

However, the expression for $u$ will (almost certainly) experience catastrophic cancellation when $x<0$ and $y$ is nearly zero. If $x<0$, then you first compute $$v =\sqrt{\frac{\sqrt{x^2+y^2}-x}{2}}$$ and then $$u = \frac{y}{2v}.$$


If your complex number is given in polar form, then polar form of the square root can be computed using the naive formula. However, obtaining the polar form from the standard form in a reliable manner is not trivial.