- Split input into 2 regimes
if y.im < 5.1781749674137205e+95
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}\]
Taylor expanded around -inf 22.6
\[\leadsto \frac{\color{blue}{y.im \cdot x.im + y.re \cdot x.re}}{y.re \cdot y.re + y.im \cdot y.im}\]
if 5.1781749674137205e+95 < y.im
Initial program 39.0
\[\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-sqrt39.0
\[\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*39.0
\[\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 38.5
\[\leadsto \frac{\color{blue}{x.im}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
- Recombined 2 regimes into one program.
Final simplification25.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.im \le 5.1781749674137205 \cdot 10^{+95}:\\
\;\;\;\;\frac{y.re \cdot x.re + x.im \cdot y.im}{y.im \cdot y.im + y.re \cdot y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\end{array}\]