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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.1 |
| Herbie | 0.5 |
if (/ (* y (- z t)) (- z a)) < -inf.0Initial program 64.0
Simplified0.1
rmApplied div-inv0.2
if -inf.0 < (/ (* y (- z t)) (- z a)) < 7.9744885781628544e230Initial program 0.2
if 7.9744885781628544e230 < (/ (* y (- z t)) (- z a)) Initial program 52.6
Simplified1.8
rmApplied clear-num1.9
rmApplied associate-/r/1.9
Applied associate-*r*3.0
Simplified2.9
Final simplification0.5
herbie shell --seed 2020191
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))