- Split input into 2 regimes
if y.re < 2.2233373112832877e+107
Initial program 22.7
\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt22.7
\[\leadsto \frac{x.re \cdot y.re + x.im \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Applied associate-/r*22.6
\[\leadsto \color{blue}{\frac{\frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
if 2.2233373112832877e+107 < y.re
Initial program 40.4
\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt40.4
\[\leadsto \frac{x.re \cdot y.re + x.im \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Applied associate-/r*40.4
\[\leadsto \color{blue}{\frac{\frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Taylor expanded around inf 40.7
\[\leadsto \frac{\color{blue}{x.re}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
- Recombined 2 regimes into one program.
Final simplification25.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.re \le 2.2233373112832877 \cdot 10^{+107}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.im + x.re \cdot y.re}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\end{array}\]