Arithmetic Operations #
This section covers efficient methods for common calculations frequently encountered in scientific and technical computing, as well as computations specific to floating-point arithmetic.
- Square Root of Complex Numbers
- Square Root of Complex Numbers # This section demonstrates specific methods for calculating the square root of a complex number. The result can be expressed as follows: $$ \begin{eqnarray} \sqrt{a+ib} = \left\{ \begin{aligned} &\sqrt{\frac{\sqrt{a^2+b^2}+a}{2}}+i~\text{sgn}(b)\sqrt{\frac{\sqrt{a^2+b^2}-a}{2}} &&(-\pi\lt\text{arg}(a+ib)\lt\pi)\\ &-\sqrt{\frac{\sqrt{a^2+b^2}+a}{2}}+i~\text{sgn}(b)\sqrt{\frac{\sqrt{a^2+b^2}-a}{2}} &&\left(\substack{-2\pi\lt\text{arg}(a+ib)\lt -\pi \\ \pi\lt\text{arg}(a+ib)\lt 2\pi}\right) \end{aligned} \right. \end{eqnarray} $$ where $$ \begin{eqnarray} \text{sgn}(x)= \left\{ \begin{aligned} & 1.0 && (x>0) \\ &-1.0 && (x<0) \end{aligned} \right. \end{eqnarray} $$ We define it as shown above, and additionally set $\text{sgn}(0) = 0$.