- Split input into 2 regimes
if d < 6.252207018169969e+119
Initial program 23.0
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt23.0
\[\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-identity23.0
\[\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-frac23.0
\[\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}}}\]
if 6.252207018169969e+119 < d
Initial program 40.9
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
- Using strategy
rm Applied add-sqr-sqrt40.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-identity40.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-frac40.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}}}\]
Taylor expanded around 0 39.7
\[\leadsto \frac{1}{\sqrt{c \cdot c + d \cdot d}} \cdot \color{blue}{b}\]
- Recombined 2 regimes into one program.
Final simplification25.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;d \le 6.252207018169969 \cdot 10^{+119}:\\
\;\;\;\;\frac{a \cdot c + d \cdot b}{\sqrt{d \cdot d + c \cdot c}} \cdot \frac{1}{\sqrt{d \cdot d + c \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{d \cdot d + c \cdot c}} \cdot b\\
\end{array}\]