Average Error: 0.5 → 0.5
Time: 1.3m
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)\]
\[\cos th \cdot \left(\frac{a2}{\sqrt[3]{\sqrt{2}}} \cdot \frac{a2}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}\right) + \left(a1 \cdot a1\right) \cdot \frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\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. Using strategy rm
  3. Applied associate-*l/0.5

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

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

    \[\leadsto \color{blue}{\frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th \cdot \left(a2 \cdot a2\right)}{\sqrt{2}}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th \cdot \left(a2 \cdot a2\right)}{\sqrt{\color{blue}{1 \cdot 2}}}\]
  9. Applied sqrt-prod0.5

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

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

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

    \[\leadsto \frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \cos th \cdot \frac{a2 \cdot a2}{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}}}\]
  14. Applied times-frac0.5

    \[\leadsto \frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \cos th \cdot \color{blue}{\left(\frac{a2}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \frac{a2}{\sqrt[3]{\sqrt{2}}}\right)}\]
  15. Final simplification0.5

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

Reproduce

herbie shell --seed 2019089 +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))))