Average Error: 0.5 → 0.5
Time: 1.9m
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{\left(\sqrt{a1 \cdot a1 + a2 \cdot a2} \cdot \cos th\right) \cdot \sqrt{a1 \cdot a1 + a2 \cdot a2}}{\sqrt{2}}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus th

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 \left(a2 \cdot a2 + a1 \cdot a1\right) \cdot \frac{\cos th}{\sqrt{2}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.5

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

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

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

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

Runtime

Time bar (total: 1.9m)Debug logProfile

herbie shell --seed 2018214 
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))