Average Error: 0.5 → 0.5
Time: 9.9s
Precision: 64
Internal precision: 384
\[\frac{\cos th}{\sqrt{2}} \cdot {a1}^2 + \frac{\cos th}{\sqrt{2}} \cdot {a2}^2\]
\[\frac{\frac{{a2}^2 + a1 \cdot a1}{\sqrt{2}}}{\frac{1}{\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 {a1}^2 + \frac{\cos th}{\sqrt{2}} \cdot {a2}^2\]
  2. Applied simplify 0.5

    \[\leadsto \color{blue}{\frac{{a2}^2 + a1 \cdot a1}{\frac{\sqrt{2}}{\cos th}}}\]
  3. Using strategy rm
  4. Applied div-inv 0.5

    \[\leadsto \frac{{a2}^2 + a1 \cdot a1}{\color{blue}{\sqrt{2} \cdot \frac{1}{\cos th}}}\]
  5. Applied associate-/r* 0.5

    \[\leadsto \color{blue}{\frac{\frac{{a2}^2 + a1 \cdot a1}{\sqrt{2}}}{\frac{1}{\cos th}}}\]
  6. Removed slow pow expressions

Runtime

Time bar (total: 9.9s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (sqr a1)) (* (/ (cos th) (sqrt 2)) (sqr a2))))