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

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 associate-*l/0.5

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

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

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

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

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

Runtime

Time bar (total: 24.4s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.50.50.10.40%
herbie shell --seed 2018286 +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))))