Initial program 26.4
\[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\]
Simplified26.4
\[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{\mathsf{fma}\left(c, c, d \cdot d\right)}}\]
- Using strategy
rm Applied add-sqr-sqrt26.4
\[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{\sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)} \cdot \sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)}}}\]
Applied *-un-lft-identity26.4
\[\leadsto \frac{\color{blue}{1 \cdot \left(b \cdot c - a \cdot d\right)}}{\sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)} \cdot \sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)}}\]
Applied times-frac26.4
\[\leadsto \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)}}}\]
Simplified26.4
\[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{b \cdot c - a \cdot d}{\sqrt{\mathsf{fma}\left(c, c, d \cdot d\right)}}\]
Simplified17.3
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\frac{b \cdot c - a \cdot d}{\mathsf{hypot}\left(c, d\right)}}\]
- Using strategy
rm Applied div-sub17.3
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{b \cdot c}{\mathsf{hypot}\left(c, d\right)} - \frac{a \cdot d}{\mathsf{hypot}\left(c, d\right)}\right)}\]
Simplified9.9
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\color{blue}{\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}}} - \frac{a \cdot d}{\mathsf{hypot}\left(c, d\right)}\right)\]
- Using strategy
rm Applied add-sqr-sqrt10.0
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}} - \frac{a \cdot d}{\color{blue}{\sqrt{\mathsf{hypot}\left(c, d\right)} \cdot \sqrt{\mathsf{hypot}\left(c, d\right)}}}\right)\]
Applied times-frac1.4
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}} - \color{blue}{\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}}}\right)\]
Applied add-sqr-sqrt23.4
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\color{blue}{\sqrt{\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}}} \cdot \sqrt{\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}}}} - \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\]
Applied prod-diff23.4
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt{\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}}}, \sqrt{\frac{c}{\frac{\mathsf{hypot}\left(c, d\right)}{b}}}, -\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \mathsf{fma}\left(-\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}}, \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}, \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)}\]
Simplified0.9
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\color{blue}{\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)} + \mathsf{fma}\left(-\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}}, \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}, \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)\]
Simplified0.9
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \color{blue}{\frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)}\right)\]
- Using strategy
rm Applied add-sqr-sqrt0.9
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\frac{d}{\sqrt{\color{blue}{\sqrt{\mathsf{hypot}\left(c, d\right)} \cdot \sqrt{\mathsf{hypot}\left(c, d\right)}}}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)\]
Applied sqrt-prod1.0
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\frac{d}{\color{blue}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)\]
Applied *-un-lft-identity1.0
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\frac{\color{blue}{1 \cdot d}}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)\]
Applied times-frac1.0
\[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, -\color{blue}{\left(\frac{1}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}} \cdot \frac{d}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}}\right)} \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right)\]
Final simplification1.0
\[\leadsto \left(\mathsf{fma}\left(\frac{c}{\mathsf{hypot}\left(c, d\right)}, b, \left(\frac{-1}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}} \cdot \frac{d}{\sqrt{\sqrt{\mathsf{hypot}\left(c, d\right)}}}\right) \cdot \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{d}{\sqrt{\mathsf{hypot}\left(c, d\right)}} \cdot \left(\left(-\frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right) + \frac{a}{\sqrt{\mathsf{hypot}\left(c, d\right)}}\right)\right) \cdot \frac{1}{\mathsf{hypot}\left(c, d\right)}\]