double code(double x, double y, double z, double t) {
return ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= -1.9170945823704876e+37)) {
VAR = ((double) (1.0 / ((double) (((double) (y - t)) * ((double) (z / ((double) (x * 2.0))))))));
} else {
double VAR_1;
if ((z <= 6.676781766092113e-43)) {
VAR_1 = ((double) (((double) (x * 2.0)) / ((double) (z * ((double) (y - t))))));
} else {
VAR_1 = ((double) (((double) (x * ((double) (2.0 / z)))) / ((double) (y - t))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.5 |
if z < -1.91709458237048765e37Initial program 11.8
Simplified9.2
rmApplied associate-*r/9.2
rmApplied clear-num9.5
Simplified2.8
if -1.91709458237048765e37 < z < 6.676781766092113e-43Initial program 2.7
Simplified3.0
rmApplied associate-*r/2.7
if 6.676781766092113e-43 < z Initial program 8.9
Simplified7.3
rmApplied associate-*r/7.3
rmApplied associate-/r*2.1
Simplified2.1
Final simplification2.5
herbie shell --seed 2020180
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))