- Split input into 3 regimes
if c < -3.1444945231281215e+178
Initial program 42.9
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt42.9
\[\leadsto \frac{a \cdot c + b \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity42.9
\[\leadsto \frac{\color{blue}{1 \cdot \left(a \cdot c + b \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac42.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified42.9
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified29.6
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
- Using strategy
rm Applied associate-*r/29.6
\[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{c^2 + d^2}^*} \cdot (a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
Taylor expanded around -inf 12.0
\[\leadsto \frac{\color{blue}{-1 \cdot a}}{\sqrt{c^2 + d^2}^*}\]
Simplified12.0
\[\leadsto \frac{\color{blue}{-a}}{\sqrt{c^2 + d^2}^*}\]
if -3.1444945231281215e+178 < c < 1.3753669194845899e+121
Initial program 19.8
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt19.8
\[\leadsto \frac{a \cdot c + b \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity19.8
\[\leadsto \frac{\color{blue}{1 \cdot \left(a \cdot c + b \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac19.8
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified19.8
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified12.1
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
- Using strategy
rm Applied associate-*r/12.1
\[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{c^2 + d^2}^*} \cdot (a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
if 1.3753669194845899e+121 < c
Initial program 42.3
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt42.3
\[\leadsto \frac{a \cdot c + b \cdot d}{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}\]
Applied *-un-lft-identity42.3
\[\leadsto \frac{\color{blue}{1 \cdot \left(a \cdot c + b \cdot d\right)}}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}\]
Applied times-frac42.3
\[\leadsto \color{blue}{\frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}\]
Simplified42.3
\[\leadsto \color{blue}{\frac{1}{\sqrt{c^2 + d^2}^*}} \cdot \frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}\]
Simplified27.8
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
- Using strategy
rm Applied associate-*r/27.8
\[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{c^2 + d^2}^*} \cdot (a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}\]
Taylor expanded around inf 16.1
\[\leadsto \frac{\color{blue}{a}}{\sqrt{c^2 + d^2}^*}\]
- Recombined 3 regimes into one program.
Final simplification12.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;c \le -3.1444945231281215 \cdot 10^{+178}:\\
\;\;\;\;\frac{-a}{\sqrt{c^2 + d^2}^*}\\
\mathbf{elif}\;c \le 1.3753669194845899 \cdot 10^{+121}:\\
\;\;\;\;\frac{(a \cdot c + \left(b \cdot d\right))_* \cdot \frac{1}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\sqrt{c^2 + d^2}^*}\\
\end{array}\]