Average Error: 0.5 → 0.5
Time: 1.1m
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{\frac{\frac{\cos th \cdot \left(a2 \cdot a2\right)}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{2}}} + \frac{\left(a1 \cdot a1\right) \cdot \cos th}{\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 associate-*l/0.5

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

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

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

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

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

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

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

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

Reproduce

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