- Split input into 3 regimes
if y.im < 1.4830868861678625e+72
Initial program 22.6
\[\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.6
\[\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.5
\[\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 1.4830868861678625e+72 < y.im < 3.4978915880616634e+152
Initial program 23.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-sqrt23.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*23.2
\[\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 0 25.2
\[\leadsto \frac{\color{blue}{x.im}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
if 3.4978915880616634e+152 < y.im
Initial program 46.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-sqrt46.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 *-un-lft-identity46.7
\[\leadsto \frac{\color{blue}{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Applied times-frac46.7
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
- Using strategy
rm Applied add-sqr-sqrt46.7
\[\leadsto \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{\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 sqrt-prod46.7
\[\leadsto \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\color{blue}{\sqrt{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \sqrt{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}\]
Applied associate-/r*46.7
\[\leadsto \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \color{blue}{\frac{\frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\sqrt{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}\]
- Recombined 3 regimes into one program.
Final simplification26.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.im \le 1.4830868861678625 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{x.re \cdot y.re + y.im \cdot x.im}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\mathbf{elif}\;y.im \le 3.4978915880616634 \cdot 10^{+152}:\\
\;\;\;\;\frac{x.im}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}} \cdot \frac{\frac{x.re \cdot y.re + y.im \cdot x.im}{\sqrt{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}}}{\sqrt{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}}\\
\end{array}\]