- Split input into 3 regimes
if y.re < -1.2534913427767432e+147
Initial program 44.1
\[\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-sqrt44.1
\[\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-identity44.1
\[\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-frac44.1
\[\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}}}\]
Simplified44.1
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified27.9
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}\]
- Using strategy
rm Applied associate-*l/27.9
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}}\]
Simplified27.9
\[\leadsto \frac{\color{blue}{\frac{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}}{\sqrt{y.re^2 + y.im^2}^*}\]
- Using strategy
rm Applied *-un-lft-identity27.9
\[\leadsto \frac{\frac{\color{blue}{1 \cdot (y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}\]
Applied associate-/l*27.9
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{y.re^2 + y.im^2}^*}{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}}}{\sqrt{y.re^2 + y.im^2}^*}\]
Taylor expanded around -inf 13.1
\[\leadsto \frac{\color{blue}{-1 \cdot x.re}}{\sqrt{y.re^2 + y.im^2}^*}\]
Simplified13.1
\[\leadsto \frac{\color{blue}{-x.re}}{\sqrt{y.re^2 + y.im^2}^*}\]
if -1.2534913427767432e+147 < y.re < 2.135523821820183e+102
Initial program 19.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-sqrt19.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 *-un-lft-identity19.0
\[\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-frac19.0
\[\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}}}\]
Simplified19.0
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified11.9
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}\]
- Using strategy
rm Applied associate-*l/11.8
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}}\]
Simplified11.8
\[\leadsto \frac{\color{blue}{\frac{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}}{\sqrt{y.re^2 + y.im^2}^*}\]
- Using strategy
rm Applied *-un-lft-identity11.8
\[\leadsto \frac{\frac{\color{blue}{1 \cdot (y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}\]
Applied associate-/l*11.9
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{y.re^2 + y.im^2}^*}{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}}}{\sqrt{y.re^2 + y.im^2}^*}\]
if 2.135523821820183e+102 < y.re
Initial program 39.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-sqrt39.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 *-un-lft-identity39.8
\[\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-frac39.8
\[\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}}}\]
Simplified39.8
\[\leadsto \color{blue}{\frac{1}{\sqrt{y.re^2 + y.im^2}^*}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
Simplified26.0
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}\]
- Using strategy
rm Applied associate-*l/26.0
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(x.re \cdot y.re + \left(x.im \cdot y.im\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}}\]
Simplified26.0
\[\leadsto \frac{\color{blue}{\frac{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}}{\sqrt{y.re^2 + y.im^2}^*}\]
- Using strategy
rm Applied *-un-lft-identity26.0
\[\leadsto \frac{\frac{\color{blue}{1 \cdot (y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}\]
Applied associate-/l*26.1
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{y.re^2 + y.im^2}^*}{(y.im \cdot x.im + \left(y.re \cdot x.re\right))_*}}}}{\sqrt{y.re^2 + y.im^2}^*}\]
Taylor expanded around inf 16.6
\[\leadsto \frac{\color{blue}{x.re}}{\sqrt{y.re^2 + y.im^2}^*}\]
- Recombined 3 regimes into one program.
Final simplification13.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.re \le -1.2534913427767432 \cdot 10^{+147}:\\
\;\;\;\;\frac{-x.re}{\sqrt{y.re^2 + y.im^2}^*}\\
\mathbf{elif}\;y.re \le 2.135523821820183 \cdot 10^{+102}:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{y.re^2 + y.im^2}^*}{(y.im \cdot x.im + \left(x.re \cdot y.re\right))_*}}}{\sqrt{y.re^2 + y.im^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\sqrt{y.re^2 + y.im^2}^*}\\
\end{array}\]