double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (a - t))))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (((double) (z - t)) / ((double) (a - t)))) <= -inf.0)) {
VAR = ((double) (x + ((double) (((double) (((double) (z * y)) - ((double) (t * y)))) / ((double) (a - t))))));
} else {
VAR = ((double) (x + ((double) (y / ((double) (((double) (a - t)) / ((double) (z - t))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if (/ (- z t) (- a t)) < -inf.0Initial program 64.0
rmApplied associate-*r/0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
if -inf.0 < (/ (- z t) (- a t)) Initial program 0.8
rmApplied associate-*r/10.7
rmApplied associate-/l*0.8
Final simplification0.8
herbie shell --seed 2020192
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))