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)) <= -3.4578441984957297e+136)) {
VAR = ((double) (y * ((double) (x / z))));
} else {
double VAR_1;
if ((((double) (y / z)) <= -2.994087309324921e-208)) {
VAR_1 = ((double) (((double) (y / z)) * x));
} else {
double VAR_2;
if ((((double) (y / z)) <= 4.221322586165302e-202)) {
VAR_2 = ((double) (((double) (y * x)) / z));
} else {
double VAR_3;
if ((((double) (y / z)) <= 4.614671660723258e+132)) {
VAR_3 = ((double) (((double) (y / z)) * x));
} else {
VAR_3 = ((double) (y * ((double) (x / z))));
}
VAR_2 = VAR_3;
}
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.7 |
|---|---|
| Target | 1.5 |
| Herbie | 0.8 |
if (/ y z) < -3.4578441984957297e136 or 4.61467166072325781e132 < (/ y z) Initial program 32.5
Simplified16.0
rmApplied add-cube-cbrt16.9
Applied *-un-lft-identity16.9
Applied times-frac16.9
Applied associate-*r*4.9
Simplified4.9
Taylor expanded around 0 2.9
Simplified2.9
if -3.4578441984957297e136 < (/ y z) < -2.99408730932492112e-208 or 4.2213225861653017e-202 < (/ y z) < 4.61467166072325781e132Initial program 6.9
Simplified0.2
if -2.99408730932492112e-208 < (/ y z) < 4.2213225861653017e-202Initial program 18.4
Simplified11.4
rmApplied associate-*r/0.6
Final simplification0.8
herbie shell --seed 2020190
(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)))