2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
2 \cdot \left(x \cdot y + \left(z \cdot t - \sqrt[3]{c} \cdot \left(\left(a + c \cdot b\right) \cdot \left(i \cdot {\left(\sqrt[3]{c}\right)}^{2}\right)\right)\right)\right)(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (+ (* x y) (- (* z t) (* (cbrt c) (* (+ a (* c b)) (* i (pow (cbrt c) 2.0))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (((double) (((double) (a + ((double) (b * c)))) * c)) * i))))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (((double) cbrt(c)) * ((double) (((double) (a + ((double) (c * b)))) * ((double) (i * ((double) pow(((double) cbrt(c)), 2.0))))))))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus i
Results
| Original | 6.6 |
|---|---|
| Target | 1.6 |
| Herbie | 2.6 |
Initial program Error: 6.6 bits
SimplifiedError: 5.0 bits
rmApplied add-cube-cbrtError: 5.3 bits
Applied associate-*l*Error: 5.3 bits
SimplifiedError: 3.7 bits
rmApplied associate-*l*Error: 3.7 bits
SimplifiedError: 2.6 bits
Final simplificationError: 2.6 bits
herbie shell --seed 2020204
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))