Average Error: 0.5 → 0.4
Time: 49.0s
Precision: 64
Internal Precision: 384
\[\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 \frac{(a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\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. Applied simplify0.5

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

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

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

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

Runtime

Time bar (total: 49.0s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +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))))