Average Error: 0.5 → 0.4
Time: 60.0s
Precision: 64
Internal Precision: 128
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
\[\frac{(a2 \cdot a2 + \left(a1 \cdot a1\right))_* \cdot \cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus th

Derivation

  1. Initial program 0.5

    \[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  2. Initial simplification0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*\]
  3. Using strategy rm
  4. Applied associate-*l/0.5

    \[\leadsto \color{blue}{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{2}}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.6

    \[\leadsto \frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}}\]
  7. Applied associate-/r*0.5

    \[\leadsto \color{blue}{\frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{2}}}}\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.5

    \[\leadsto \frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{\sqrt{2}}}}{\sqrt{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}}}}\]
  10. Applied sqrt-prod0.7

    \[\leadsto \frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{\sqrt{2}}}}{\color{blue}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \sqrt{\sqrt[3]{\sqrt{2}}}}}\]
  11. Applied div-inv0.5

    \[\leadsto \frac{\color{blue}{\left(\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*\right) \cdot \frac{1}{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \sqrt{\sqrt[3]{\sqrt{2}}}}\]
  12. Applied times-frac0.4

    \[\leadsto \color{blue}{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}}\]
  13. Simplified0.4

    \[\leadsto \color{blue}{\frac{(a2 \cdot a2 + \left(a1 \cdot a1\right))_* \cdot \cos th}{\left|\sqrt[3]{\sqrt{2}}\right|}} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\]
  14. Final simplification0.4

    \[\leadsto \frac{(a2 \cdot a2 + \left(a1 \cdot a1\right))_* \cdot \cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\]

Runtime

Time bar (total: 60.0s)Debug logProfile

herbie shell --seed 2018348 +o rules:numerics
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))