- 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 add-sqr-sqrt39.3
\[\leadsto \frac{\frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}}\]
Applied sqrt-prod39.4
\[\leadsto \frac{\frac{a \cdot c + b \cdot d}{\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{\frac{a \cdot c + b \cdot d}{\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 add-sqr-sqrt18.4
\[\leadsto \frac{\frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\color{blue}{\sqrt{c \cdot c + d \cdot d} \cdot \sqrt{c \cdot c + d \cdot d}}}}\]
Applied sqrt-prod18.6
\[\leadsto \frac{\frac{a \cdot c + b \cdot d}{\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.6
\[\leadsto \color{blue}{\frac{\frac{\frac{a \cdot c + b \cdot d}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}\]
- Recombined 2 regimes into one program.
Final simplification18.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;c \le -1.7035520925716615 \cdot 10^{+115}:\\
\;\;\;\;\frac{a}{c}\\
\mathbf{elif}\;c \le 1.6654143669342526 \cdot 10^{+98}:\\
\;\;\;\;\frac{\frac{\frac{a \cdot c + d \cdot b}{\sqrt{c \cdot c + d \cdot d}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}}{\sqrt{\sqrt{c \cdot c + d \cdot d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{c}\\
\end{array}\]