Average Error: 0.5 → 0.5
Time: 5.5m
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)\]
\[\sqrt[3]{\frac{\cos th}{2} \cdot \frac{\cos th \cdot \cos th}{\sqrt{2}}} \cdot \left(a2 \cdot a2\right) + \frac{\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}}} \cdot \left(a1 \cdot a1\right)\]

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 add-cbrt-cube0.8

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\color{blue}{\sqrt[3]{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  4. Applied add-cbrt-cube0.9

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

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

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

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

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

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

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

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

Reproduce

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