Average Error: 0.5 → 0.5
Time: 1.8m
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)\]
\[\frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}} \cdot \left(a2 \cdot a2 + 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. Applied simplify0.5

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

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

    \[\leadsto \color{blue}{\frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}}} \cdot \left(a2 \cdot a2 + a1 \cdot a1\right)\]
  6. Removed slow pow expressions.

Runtime

Time bar (total: 1.8m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))