- Split input into 3 regimes
if y.re < -4.0847043593511234e+198
Initial program 41.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-sqrt41.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 *-un-lft-identity41.2
\[\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-frac41.2
\[\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}}}\]
Simplified41.2
\[\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}}\]
Simplified30.6
\[\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}^*}}\]
Taylor expanded around -inf 11.5
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\left(-1 \cdot x.re\right)}\]
Simplified11.5
\[\leadsto \frac{1}{\sqrt{y.re^2 + y.im^2}^*} \cdot \color{blue}{\left(-x.re\right)}\]
if -4.0847043593511234e+198 < y.re < 1.480600527823983e+78
Initial program 20.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-sqrt20.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 *-un-lft-identity20.2
\[\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-frac20.2
\[\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}}}\]
Simplified20.2
\[\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}}\]
Simplified12.3
\[\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/12.1
\[\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}^*}}\]
Simplified12.1
\[\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}^*}\]
if 1.480600527823983e+78 < y.re
Initial program 36.6
\[\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-sqrt36.6
\[\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-identity36.6
\[\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-frac36.6
\[\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}}}\]
Simplified36.6
\[\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}}\]
Simplified23.4
\[\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/23.4
\[\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}^*}}\]
Simplified23.4
\[\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}^*}\]
Taylor expanded around 0 16.7
\[\leadsto \frac{\color{blue}{x.re}}{\sqrt{y.re^2 + y.im^2}^*}\]
- Recombined 3 regimes into one program.
Final simplification12.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;y.re \le -4.0847043593511234 \cdot 10^{+198}:\\
\;\;\;\;\frac{-1}{\sqrt{y.re^2 + y.im^2}^*} \cdot x.re\\
\mathbf{elif}\;y.re \le 1.480600527823983 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{(y.im \cdot x.im + \left(x.re \cdot y.re\right))_*}{\sqrt{y.re^2 + y.im^2}^*}}{\sqrt{y.re^2 + y.im^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\sqrt{y.re^2 + y.im^2}^*}\\
\end{array}\]