- Split input into 3 regimes
if (* (/ 1 (hypot c d)) (/ (fma b c (- (* a d))) (hypot c d))) < -4.0883606135300517e+300
Initial program 61.8
\[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt61.8
\[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity61.8
\[\leadsto \frac{\color{blue}{1 \cdot \left(b \cdot c - a \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac61.8
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified61.8
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified60.6
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{b \cdot c - a \cdot d}{\sqrt{c^2 + d^2}^*}}\]
Taylor expanded around inf 48.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{b}\]
if -4.0883606135300517e+300 < (* (/ 1 (hypot c d)) (/ (fma b c (- (* a d))) (hypot c d))) < 2.7200961677720655e+301
Initial program 13.9
\[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt13.9
\[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity13.9
\[\leadsto \frac{\color{blue}{1 \cdot \left(b \cdot c - a \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac13.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified13.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified1.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{b \cdot c - a \cdot d}{\sqrt{c^2 + d^2}^*}}\]
- Using strategy
rm Applied fma-neg1.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \frac{\color{blue}{(b \cdot c + \left(-a \cdot d\right))_*}}{\sqrt{c^2 + d^2}^*}\]
if 2.7200961677720655e+301 < (* (/ 1 (hypot c d)) (/ (fma b c (- (* a d))) (hypot c d)))
Initial program 61.6
\[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt61.6
\[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity61.6
\[\leadsto \frac{\color{blue}{1 \cdot \left(b \cdot c - a \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac61.6
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified61.6
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified61.3
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{b \cdot c - a \cdot d}{\sqrt{c^2 + d^2}^*}}\]
Taylor expanded around 0 47.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\left(-1 \cdot a\right)}\]
Simplified47.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\left(-a\right)}\]
- Recombined 3 regimes into one program.
Final simplification13.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{c^2 + d^2}^*} \cdot \frac{(b \cdot c + \left(a \cdot \left(-d\right)\right))_*}{\sqrt{c^2 + d^2}^*} \le -4.0883606135300517 \cdot 10^{+300}:\\
\;\;\;\;\frac{1}{\sqrt{c^2 + d^2}^*} \cdot b\\
\mathbf{elif}\;\frac{1}{\sqrt{c^2 + d^2}^*} \cdot \frac{(b \cdot c + \left(a \cdot \left(-d\right)\right))_*}{\sqrt{c^2 + d^2}^*} \le 2.7200961677720655 \cdot 10^{+301}:\\
\;\;\;\;\frac{1}{\sqrt{c^2 + d^2}^*} \cdot \frac{(b \cdot c + \left(a \cdot \left(-d\right)\right))_*}{\sqrt{c^2 + d^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{c^2 + d^2}^*} \cdot \left(-a\right)\\
\end{array}\]