Average Error: 0.5 → 0.5
Time: 55.7s
Precision: 64
Internal Precision: 576
\[\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((a1 \cdot a1 + \left(a2 \cdot a2\right))_* \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{2}}}\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. Initial simplification0.5

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

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

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

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

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

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

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

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

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

Runtime

Time bar (total: 55.7s)Debug logProfile

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