double code(double x, double y, double z, double t) {
return ((double) (x * ((double) (((double) (((double) (y / z)) * t)) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (y / z)) <= -inf.0)) {
VAR = ((double) (((double) (y * x)) / z));
} else {
double VAR_1;
if ((((double) (y / z)) <= -2.804420989472457e-172)) {
VAR_1 = ((double) (((double) (y / z)) * x));
} else {
double VAR_2;
if (((((double) (y / z)) <= 2.719780834364527e-272) || !(((double) (y / z)) <= 7.265617949894509e+189))) {
VAR_2 = ((double) (y * ((double) (x / z))));
} else {
VAR_2 = ((double) (x / ((double) (z / y))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.4 |
|---|---|
| Target | 1.3 |
| Herbie | 0.5 |
if (/ y z) < -inf.0Initial program 64.0
Simplified64.0
rmApplied associate-*r/0.3
if -inf.0 < (/ y z) < -2.8044209894724572e-172Initial program 9.4
Simplified0.3
if -2.8044209894724572e-172 < (/ y z) < 2.719780834364527e-272 or 7.265617949894509e189 < (/ y z) Initial program 21.6
Simplified13.5
rmApplied add-cube-cbrt13.9
Applied *-un-lft-identity13.9
Applied times-frac13.9
Applied associate-*r*3.8
Simplified3.8
Taylor expanded around 0 0.5
Simplified0.9
if 2.719780834364527e-272 < (/ y z) < 7.265617949894509e189Initial program 8.7
Simplified0.2
rmApplied associate-*r/9.5
rmApplied associate-/l*0.2
Final simplification0.5
herbie shell --seed 2020180
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:precision binary64
:herbie-target
(if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))
(* x (/ (* (/ y z) t) t)))