- Split input into 2 regimes
if c < -1.7035520925716615e+115 or 1.6654143669342526e+98 < c
Initial program 39.4
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt39.4
\[\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 associate-/r*39.3
\[\leadsto \color{blue}{\frac{\frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{c \cdot c + d \cdot d}}}\]
- Using strategy
rm Applied div-inv39.4
\[\leadsto \frac{\color{blue}{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{c \cdot c + d \cdot d}}\]
- Using strategy
rm Applied add-sqr-sqrt39.4
\[\leadsto \frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\color{blue}{\sqrt{\sqrt{c \cdot c + d \cdot d}} \cdot \sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
Applied associate-/r*39.4
\[\leadsto \color{blue}{\frac{\frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
Taylor expanded around -inf 17.2
\[\leadsto \color{blue}{\frac{a}{c}}\]
if -1.7035520925716615e+115 < c < 1.6654143669342526e+98
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 associate-/r*18.4
\[\leadsto \color{blue}{\frac{\frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{c \cdot c + d \cdot d}}}\]
- Using strategy
rm Applied div-inv18.5
\[\leadsto \frac{\color{blue}{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{c \cdot c + d \cdot d}}\]
- Using strategy
rm Applied add-sqr-sqrt18.6
\[\leadsto \frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\color{blue}{\sqrt{\sqrt{c \cdot c + d \cdot d}} \cdot \sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
Applied associate-/r*18.7
\[\leadsto \color{blue}{\frac{\frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
- Using strategy
rm Applied add-sqr-sqrt18.7
\[\leadsto \frac{\frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\color{blue}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}} \cdot \sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}}\]
Applied *-un-lft-identity18.7
\[\leadsto \frac{\color{blue}{1 \cdot \frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}} \cdot \sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
Applied times-frac18.7
\[\leadsto \color{blue}{\frac{1}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}} \cdot \frac{\frac{\left(a \cdot c + b \cdot d\right) \cdot \frac{1}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}}\]
Simplified18.7
\[\leadsto \frac{1}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}} \cdot \color{blue}{\frac{\frac{\frac{b \cdot d + a \cdot c}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}}\]
- Recombined 2 regimes into one program.
Final simplification18.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;c \le -1.7035520925716615 \cdot 10^{+115} \lor \neg \left(c \le 1.6654143669342526 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{d \cdot b + a \cdot c}{\sqrt{d \cdot d + c \cdot c}}}{\sqrt{\sqrt{d \cdot d + c \cdot c}}}}{\sqrt{\sqrt{\sqrt{d \cdot d + c \cdot c}}}} \cdot \frac{1}{\sqrt{\sqrt{\sqrt{d \cdot d + c \cdot c}}}}\\
\end{array}\]