Average Error: 0.5 → 0.5
Time: 5.4m
Precision: 64
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
\[\left(\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{\sqrt{2}}}} \cdot \frac{1}{\sqrt{\sqrt{\sqrt{2}}}}\right) \cdot \left(a2 \cdot a2\right) + \frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\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-sqr-sqrt0.5

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

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

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

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

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

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\frac{\cos th}{\color{blue}{\sqrt{1} \cdot \sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  10. Applied *-un-lft-identity0.5

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

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

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

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

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

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

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

Reproduce

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