x + \frac{y \cdot \left(z - x\right)}{t}x + \frac{1}{\frac{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}{\frac{z - x}{\frac{\sqrt[3]{t}}{\sqrt[3]{y}}}}}double code(double x, double y, double z, double t) {
return (x + ((y * (z - x)) / t));
}
double code(double x, double y, double z, double t) {
return (x + (1.0 / (((cbrt(t) * cbrt(t)) / (cbrt(y) * cbrt(y))) / ((z - x) / (cbrt(t) / cbrt(y))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.3 |
|---|---|
| Target | 2.0 |
| Herbie | 0.9 |
Initial program 6.3
rmApplied sub-neg6.3
Applied distribute-lft-in6.3
rmApplied clear-num6.4
Simplified1.9
rmApplied add-cube-cbrt2.4
Applied add-cube-cbrt2.5
Applied times-frac2.5
Applied associate-/l*0.9
Final simplification0.9
herbie shell --seed 2020053
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))