- Split input into 2 regimes
if y.im < -3.229804774568465e+115
Initial program 41.9
\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Initial simplification41.9
\[\leadsto \frac{x.im \cdot y.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt41.9
\[\leadsto \frac{x.im \cdot y.im + x.re \cdot y.re}{\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*41.9
\[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.im + x.re \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
- Using strategy
rm Applied div-inv41.9
\[\leadsto \frac{\color{blue}{\left(x.im \cdot y.im + x.re \cdot y.re\right) \cdot \frac{1}{\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.8
\[\leadsto \frac{\color{blue}{-1 \cdot x.im}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified40.8
\[\leadsto \frac{\color{blue}{-x.im}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
if -3.229804774568465e+115 < y.im
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}\]
Initial simplification22.7
\[\leadsto \frac{x.im \cdot y.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt22.7
\[\leadsto \frac{x.im \cdot y.im + x.re \cdot y.re}{\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.im \cdot y.im + x.re \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
- Recombined 2 regimes into one program.
Final simplification25.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.im \le -3.229804774568465 \cdot 10^{+115}:\\
\;\;\;\;\frac{-x.im}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}}{\sqrt{y.im \cdot y.im + y.re \cdot y.re}}\\
\end{array}\]