- Split input into 3 regimes
if (* (sqrt (/ 1 (hypot y.re y.im))) (* (sqrt (/ 1 (hypot y.re y.im))) (/ (- (* x.im y.re) (* x.re y.im)) (hypot y.re y.im)))) < -1.7753108952350828e+308
Initial program 63.0
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt63.0
\[\leadsto \frac{x.im \cdot y.re - x.re \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-identity63.0
\[\leadsto \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re - x.re \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-frac63.0
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Simplified63.0
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified61.9
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re^2 + y.im^2}^*}}\]
Taylor expanded around inf 48.2
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{x.im}\]
if -1.7753108952350828e+308 < (* (sqrt (/ 1 (hypot y.re y.im))) (* (sqrt (/ 1 (hypot y.re y.im))) (/ (- (* x.im y.re) (* x.re y.im)) (hypot y.re y.im)))) < 1.7777210658548273e+308
Initial program 13.9
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt13.9
\[\leadsto \frac{x.im \cdot y.re - x.re \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-identity13.9
\[\leadsto \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re - x.re \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-frac13.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Simplified13.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified1.5
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re^2 + y.im^2}^*}}\]
- Using strategy
rm Applied fma-neg1.5
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{\color{blue}{(x.im \cdot y.re + \left(-x.re \cdot y.im\right))_*}}{\sqrt{y.re^2 + y.im^2}^*}\]
if 1.7777210658548273e+308 < (* (sqrt (/ 1 (hypot y.re y.im))) (* (sqrt (/ 1 (hypot y.re y.im))) (/ (- (* x.im y.re) (* x.re y.im)) (hypot y.re y.im))))
Initial program 62.0
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
- Using strategy
rm Applied add-sqr-sqrt62.0
\[\leadsto \frac{x.im \cdot y.re - x.re \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-identity62.0
\[\leadsto \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re - x.re \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-frac62.0
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
Simplified62.0
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified62.0
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re^2 + y.im^2}^*}}\]
Taylor expanded around 0 47.6
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\left(-1 \cdot x.re\right)}\]
Simplified47.6
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\left(-x.re\right)}\]
- Recombined 3 regimes into one program.
Final simplification13.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;\left(\sqrt{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.im \cdot y.re - y.im \cdot x.re}{\sqrt{y.re^2 + y.im^2}^*}\right) \cdot \sqrt{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \le -1.7753108952350828 \cdot 10^{+308}:\\
\;\;\;\;x.im \cdot \frac{1}{\sqrt{y.re^2 + y.im^2}^*}\\
\mathbf{elif}\;\left(\sqrt{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.im \cdot y.re - y.im \cdot x.re}{\sqrt{y.re^2 + y.im^2}^*}\right) \cdot \sqrt{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \le 1.7777210658548273 \cdot 10^{+308}:\\
\;\;\;\;\frac{(x.im \cdot y.re + \left(-y.im \cdot x.re\right))_*}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{1}{\sqrt{y.re^2 + y.im^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sqrt{y.re^2 + y.im^2}^*} \cdot x.re\\
\end{array}\]