- Split input into 3 regimes
if c < -3.99472859135185e+198
Initial program 41.2
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt41.2
\[\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-identity41.2
\[\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-frac41.2
\[\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}}}\]
Simplified41.2
\[\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}}\]
Simplified30.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}^*}}\]
Taylor expanded around -inf 11.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\left(-1 \cdot a\right)}\]
Simplified11.5
\[\leadsto \frac{1}{\sqrt{c^2 + d^2}^*} \cdot \color{blue}{\left(-a\right)}\]
if -3.99472859135185e+198 < c < 3.4737304064170775e+78
Initial program 20.2
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt20.2
\[\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-identity20.2
\[\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-frac20.2
\[\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}}}\]
Simplified20.2
\[\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.3
\[\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/12.1
\[\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}^*}}\]
Simplified12.2
\[\leadsto \frac{\color{blue}{\frac{(d \cdot b + \left(c \cdot a\right))_*}{\sqrt{c^2 + d^2}^*}}}{\sqrt{c^2 + d^2}^*}\]
if 3.4737304064170775e+78 < c
Initial program 36.6
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt36.6
\[\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.6
\[\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.6
\[\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.6
\[\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}}\]
Simplified23.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/23.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}^*}}\]
Simplified23.3
\[\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 16.7
\[\leadsto \frac{\color{blue}{a}}{\sqrt{c^2 + d^2}^*}\]
- Recombined 3 regimes into one program.
Final simplification12.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;c \le -3.99472859135185 \cdot 10^{+198}:\\
\;\;\;\;\frac{-1}{\sqrt{c^2 + d^2}^*} \cdot a\\
\mathbf{elif}\;c \le 3.4737304064170775 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{(d \cdot b + \left(a \cdot c\right))_*}{\sqrt{c^2 + d^2}^*}}{\sqrt{c^2 + d^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\sqrt{c^2 + d^2}^*}\\
\end{array}\]