double code(double x, double y, double z, double t) {
return ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= 7.04921950447944e-271)) {
VAR = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
} else {
VAR = ((double) (((double) (1.0 / ((double) (y - z)))) * ((double) (x / ((double) (t - z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 8.2 |
| Herbie | 2.3 |
if z < 7.0492195044794397e-271Initial program 7.2
rmApplied associate-/r*2.5
if 7.0492195044794397e-271 < z Initial program 7.5
rmApplied *-un-lft-identity7.5
Applied times-frac2.0
Final simplification2.3
herbie shell --seed 2020190
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))