- Split input into 3 regimes
if c < -1.0108561403615378e+75
Initial program 36.9
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt36.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-identity36.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-frac36.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}}}\]
Simplified36.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}}\]
Simplified25.7
\[\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-*l/25.6
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}}\]
Simplified25.6
\[\leadsto \frac{\color{blue}{\frac{(d \cdot b + \left(c \cdot a\right))_*}{\sqrt{c^2 + d^2}^*}}}{\sqrt{c^2 + d^2}^*}\]
- Using strategy
rm Applied *-un-lft-identity25.6
\[\leadsto \frac{\frac{\color{blue}{1 \cdot (d \cdot b + \left(c \cdot a\right))_*}}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}\]
Applied associate-/l*25.6
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{c^2 + d^2}^*}{(d \cdot b + \left(c \cdot a\right))_*}}}}{\sqrt{c^2 + d^2}^*}\]
Taylor expanded around -inf 16.3
\[\leadsto \frac{\color{blue}{-1 \cdot a}}{\sqrt{c^2 + d^2}^*}\]
Simplified16.3
\[\leadsto \frac{\color{blue}{-a}}{\sqrt{c^2 + d^2}^*}\]
if -1.0108561403615378e+75 < c < 7.020069000953778e+131
Initial program 18.5
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt18.5
\[\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-identity18.5
\[\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-frac18.5
\[\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}}}\]
Simplified18.5
\[\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}}\]
Simplified11.4
\[\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-*l/11.3
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}}\]
Simplified11.3
\[\leadsto \frac{\color{blue}{\frac{(d \cdot b + \left(c \cdot a\right))_*}{\sqrt{c^2 + d^2}^*}}}{\sqrt{c^2 + d^2}^*}\]
- Using strategy
rm Applied *-un-lft-identity11.3
\[\leadsto \frac{\frac{\color{blue}{1 \cdot (d \cdot b + \left(c \cdot a\right))_*}}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}\]
Applied associate-/l*11.4
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{c^2 + d^2}^*}{(d \cdot b + \left(c \cdot a\right))_*}}}}{\sqrt{c^2 + d^2}^*}\]
- Using strategy
rm Applied div-inv11.6
\[\leadsto \frac{\frac{1}{\color{blue}{\sqrt{c^2 + d^2}^* \cdot \frac{1}{(d \cdot b + \left(c \cdot a\right))_*}}}}{\sqrt{c^2 + d^2}^*}\]
if 7.020069000953778e+131 < c
Initial program 42.7
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt42.7
\[\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.7
\[\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.7
\[\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.7
\[\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}}\]
Simplified28.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-*l/28.5
\[\leadsto \color{blue}{\frac{1 \cdot \frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}}\]
Simplified28.5
\[\leadsto \frac{\color{blue}{\frac{(d \cdot b + \left(c \cdot a\right))_*}{\sqrt{c^2 + d^2}^*}}}{\sqrt{c^2 + d^2}^*}\]
Taylor expanded around 0 15.4
\[\leadsto \frac{\color{blue}{a}}{\sqrt{c^2 + d^2}^*}\]
- Recombined 3 regimes into one program.
Final simplification13.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;c \le -1.0108561403615378 \cdot 10^{+75}:\\
\;\;\;\;\frac{-a}{\sqrt{c^2 + d^2}^*}\\
\mathbf{elif}\;c \le 7.020069000953778 \cdot 10^{+131}:\\
\;\;\;\;\frac{\frac{1}{\frac{1}{(d \cdot b + \left(a \cdot c\right))_*} \cdot \sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\sqrt{c^2 + d^2}^*}\\
\end{array}\]