\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\frac{\cos th \cdot \left(a1 \cdot a1\right)}{\sqrt{2}} + \sqrt[3]{0.5} \cdot \left(\frac{\cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \left(a2 \cdot a2\right)\right)(FPCore (a1 a2 th) :precision binary64 (+ (* (/ (cos th) (sqrt 2.0)) (* a1 a1)) (* (/ (cos th) (sqrt 2.0)) (* a2 a2))))
(FPCore (a1 a2 th) :precision binary64 (+ (/ (* (cos th) (* a1 a1)) (sqrt 2.0)) (* (cbrt 0.5) (* (/ (cos th) (fabs (cbrt (sqrt 2.0)))) (* a2 a2)))))
double code(double a1, double a2, double th) {
return ((cos(th) / sqrt(2.0)) * (a1 * a1)) + ((cos(th) / sqrt(2.0)) * (a2 * a2));
}
double code(double a1, double a2, double th) {
return ((cos(th) * (a1 * a1)) / sqrt(2.0)) + (cbrt(0.5) * ((cos(th) / fabs(cbrt(sqrt(2.0)))) * (a2 * a2)));
}






Bits error versus a1






Bits error versus a2






Bits error versus th
Results
| Alternative 1 | |
|---|---|
| Accuracy | 0.5 |
| Cost | 2624 |
| Alternative 2 | |
|---|---|
| Accuracy | 0.5 |
| Cost | 1664 |
| Alternative 3 | |
|---|---|
| Accuracy | 1.4 |
| Cost | 3712 |
Initial program 0.5
rmApplied add-sqr-sqrt_binary64_1000.5
Applied associate-/r*_binary64_220.5
rmApplied associate-*l/_binary64_210.5
rmApplied add-cube-cbrt_binary64_1130.5
Applied sqrt-prod_binary64_940.6
Applied div-inv_binary64_750.5
Applied times-frac_binary64_840.5
Simplified0.5
Taylor expanded around inf 0.6
Simplified0.5
Final simplification0.5
herbie shell --seed 2020322
(FPCore (a1 a2 th)
:name "Migdal et al, Equation (64)"
:precision binary64
(+ (* (/ (cos th) (sqrt 2.0)) (* a1 a1)) (* (/ (cos th) (sqrt 2.0)) (* a2 a2))))