- Split input into 2 regimes
if (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))) < 7.96129592871018587e304
Initial program 14.2
\[\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-sqrt14.2
\[\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*14.1
\[\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}}}\]
- Using strategy
rm Applied div-inv14.2
\[\leadsto \frac{\color{blue}{\left(x.re \cdot y.re + x.im \cdot y.im\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}}\]
if 7.96129592871018587e304 < (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
Initial program 63.8
\[\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-sqrt63.8
\[\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*63.8
\[\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 60.3
\[\leadsto \frac{\color{blue}{-1 \cdot x.re}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified60.3
\[\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.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \le 7.96129592871018587 \cdot 10^{304}:\\
\;\;\;\;\frac{\left(x.re \cdot y.re + x.im \cdot y.im\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}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\
\end{array}\]