Initial program 99.2%
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)
\]
Simplified99.3%
\[\leadsto \color{blue}{\cos th \cdot \frac{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}{\sqrt{2}}}
\]
Proof
[Start]99.2 | \[ \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)
\] |
|---|
distribute-lft-out [=>]99.2 | \[ \color{blue}{\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1 + a2 \cdot a2\right)}
\] |
|---|
associate-*l/ [=>]99.3 | \[ \color{blue}{\frac{\cos th \cdot \left(a1 \cdot a1 + a2 \cdot a2\right)}{\sqrt{2}}}
\] |
|---|
associate-*r/ [<=]99.3 | \[ \color{blue}{\cos th \cdot \frac{a1 \cdot a1 + a2 \cdot a2}{\sqrt{2}}}
\] |
|---|
fma-def [=>]99.3 | \[ \cos th \cdot \frac{\color{blue}{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}}{\sqrt{2}}
\] |
|---|
Applied egg-rr99.3%
\[\leadsto \cos th \cdot \color{blue}{\left({\left(\mathsf{hypot}\left(a1, a2\right)\right)}^{2} \cdot {2}^{-0.5}\right)}
\]
Proof
[Start]99.3 | \[ \cos th \cdot \frac{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}{\sqrt{2}}
\] |
|---|
div-inv [=>]99.2 | \[ \cos th \cdot \color{blue}{\left(\mathsf{fma}\left(a1, a1, a2 \cdot a2\right) \cdot \frac{1}{\sqrt{2}}\right)}
\] |
|---|
add-sqr-sqrt [=>]99.1 | \[ \cos th \cdot \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)} \cdot \sqrt{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}\right)} \cdot \frac{1}{\sqrt{2}}\right)
\] |
|---|
pow2 [=>]99.1 | \[ \cos th \cdot \left(\color{blue}{{\left(\sqrt{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}\right)}^{2}} \cdot \frac{1}{\sqrt{2}}\right)
\] |
|---|
fma-udef [=>]99.1 | \[ \cos th \cdot \left({\left(\sqrt{\color{blue}{a1 \cdot a1 + a2 \cdot a2}}\right)}^{2} \cdot \frac{1}{\sqrt{2}}\right)
\] |
|---|
hypot-def [=>]99.1 | \[ \cos th \cdot \left({\color{blue}{\left(\mathsf{hypot}\left(a1, a2\right)\right)}}^{2} \cdot \frac{1}{\sqrt{2}}\right)
\] |
|---|
pow1/2 [=>]99.1 | \[ \cos th \cdot \left({\left(\mathsf{hypot}\left(a1, a2\right)\right)}^{2} \cdot \frac{1}{\color{blue}{{2}^{0.5}}}\right)
\] |
|---|
pow-flip [=>]99.3 | \[ \cos th \cdot \left({\left(\mathsf{hypot}\left(a1, a2\right)\right)}^{2} \cdot \color{blue}{{2}^{\left(-0.5\right)}}\right)
\] |
|---|
metadata-eval [=>]99.3 | \[ \cos th \cdot \left({\left(\mathsf{hypot}\left(a1, a2\right)\right)}^{2} \cdot {2}^{\color{blue}{-0.5}}\right)
\] |
|---|
Applied egg-rr99.3%
\[\leadsto \cos th \cdot \left(\color{blue}{\left(a2 \cdot a2 + a1 \cdot a1\right)} \cdot {2}^{-0.5}\right)
\]
Proof
[Start]99.3 | \[ \cos th \cdot \left({\left(\mathsf{hypot}\left(a1, a2\right)\right)}^{2} \cdot {2}^{-0.5}\right)
\] |
|---|
unpow2 [=>]99.3 | \[ \cos th \cdot \left(\color{blue}{\left(\mathsf{hypot}\left(a1, a2\right) \cdot \mathsf{hypot}\left(a1, a2\right)\right)} \cdot {2}^{-0.5}\right)
\] |
|---|
hypot-udef [=>]99.3 | \[ \cos th \cdot \left(\left(\color{blue}{\sqrt{a1 \cdot a1 + a2 \cdot a2}} \cdot \mathsf{hypot}\left(a1, a2\right)\right) \cdot {2}^{-0.5}\right)
\] |
|---|
hypot-udef [=>]99.3 | \[ \cos th \cdot \left(\left(\sqrt{a1 \cdot a1 + a2 \cdot a2} \cdot \color{blue}{\sqrt{a1 \cdot a1 + a2 \cdot a2}}\right) \cdot {2}^{-0.5}\right)
\] |
|---|
add-sqr-sqrt [<=]99.3 | \[ \cos th \cdot \left(\color{blue}{\left(a1 \cdot a1 + a2 \cdot a2\right)} \cdot {2}^{-0.5}\right)
\] |
|---|
+-commutative [=>]99.3 | \[ \cos th \cdot \left(\color{blue}{\left(a2 \cdot a2 + a1 \cdot a1\right)} \cdot {2}^{-0.5}\right)
\] |
|---|
Taylor expanded in a2 around 0 99.3%
\[\leadsto \cos th \cdot \color{blue}{\left(\sqrt{0.5} \cdot {a2}^{2} + \sqrt{0.5} \cdot {a1}^{2}\right)}
\]
Simplified99.3%
\[\leadsto \cos th \cdot \color{blue}{\left(\sqrt{0.5} \cdot \mathsf{fma}\left(a1, a1, a2 \cdot a2\right)\right)}
\]
Proof
[Start]99.3 | \[ \cos th \cdot \left(\sqrt{0.5} \cdot {a2}^{2} + \sqrt{0.5} \cdot {a1}^{2}\right)
\] |
|---|
unpow2 [=>]99.3 | \[ \cos th \cdot \left(\sqrt{0.5} \cdot \color{blue}{\left(a2 \cdot a2\right)} + \sqrt{0.5} \cdot {a1}^{2}\right)
\] |
|---|
unpow2 [=>]99.3 | \[ \cos th \cdot \left(\sqrt{0.5} \cdot \left(a2 \cdot a2\right) + \sqrt{0.5} \cdot \color{blue}{\left(a1 \cdot a1\right)}\right)
\] |
|---|
distribute-lft-in [<=]99.3 | \[ \cos th \cdot \color{blue}{\left(\sqrt{0.5} \cdot \left(a2 \cdot a2 + a1 \cdot a1\right)\right)}
\] |
|---|
+-commutative [=>]99.3 | \[ \cos th \cdot \left(\sqrt{0.5} \cdot \color{blue}{\left(a1 \cdot a1 + a2 \cdot a2\right)}\right)
\] |
|---|
fma-udef [<=]99.3 | \[ \cos th \cdot \left(\sqrt{0.5} \cdot \color{blue}{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}\right)
\] |
|---|
Final simplification99.3%
\[\leadsto \cos th \cdot \left(\sqrt{0.5} \cdot \mathsf{fma}\left(a1, a1, a2 \cdot a2\right)\right)
\]