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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 1.9 |
| Herbie | 1.7 |
Initial program 6.6
Simplified6.7
rmApplied add-cube-cbrt7.1
Applied add-cube-cbrt7.2
Applied times-frac7.2
Applied associate-*r*1.7
Simplified1.7
Final simplification1.7
herbie shell --seed 2020198
(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)))