- Split input into 2 regimes
if d < 1.0258853380706998e+141
Initial program 22.7
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
Simplified22.7
\[\leadsto \color{blue}{\frac{(a \cdot c + \left(b \cdot d\right))_*}{(d \cdot d + \left(c \cdot c\right))_*}}\]
- Using strategy
rm Applied add-sqr-sqrt22.7
\[\leadsto \frac{(a \cdot c + \left(b \cdot d\right))_*}{\color{blue}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*} \cdot \sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}\]
Applied associate-/r*22.6
\[\leadsto \color{blue}{\frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}\]
- Using strategy
rm Applied fma-udef22.6
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\sqrt{\color{blue}{d \cdot d + c \cdot c}}}\]
Applied hypot-def22.6
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\color{blue}{\sqrt{d^2 + c^2}^*}}\]
- Using strategy
rm Applied fma-udef22.6
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{\color{blue}{d \cdot d + c \cdot c}}}}{\sqrt{d^2 + c^2}^*}\]
Applied hypot-def14.7
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\color{blue}{\sqrt{d^2 + c^2}^*}}}{\sqrt{d^2 + c^2}^*}\]
if 1.0258853380706998e+141 < d
Initial program 42.9
\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}\]
Simplified42.9
\[\leadsto \color{blue}{\frac{(a \cdot c + \left(b \cdot d\right))_*}{(d \cdot d + \left(c \cdot c\right))_*}}\]
- Using strategy
rm Applied add-sqr-sqrt42.9
\[\leadsto \frac{(a \cdot c + \left(b \cdot d\right))_*}{\color{blue}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*} \cdot \sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}\]
Applied associate-/r*42.9
\[\leadsto \color{blue}{\frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}\]
- Using strategy
rm Applied fma-udef42.9
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\sqrt{\color{blue}{d \cdot d + c \cdot c}}}\]
Applied hypot-def42.9
\[\leadsto \frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{(d \cdot d + \left(c \cdot c\right))_*}}}{\color{blue}{\sqrt{d^2 + c^2}^*}}\]
Taylor expanded around 0 14.0
\[\leadsto \frac{\color{blue}{b}}{\sqrt{d^2 + c^2}^*}\]
- Recombined 2 regimes into one program.
Final simplification14.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;d \le 1.0258853380706998 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{(a \cdot c + \left(b \cdot d\right))_*}{\sqrt{d^2 + c^2}^*}}{\sqrt{d^2 + c^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{\sqrt{d^2 + c^2}^*}\\
\end{array}\]