x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} \le -4.7151087056876726 \cdot 10^{104}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \le 1.974753568692679 \cdot 10^{262}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}double code(double x, double y, double z, double t) {
return (x + (((y - x) * z) / t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((x + (((y - x) * z) / t)) <= -4.7151087056876726e+104)) {
VAR = (x + ((y - x) * (z / t)));
} else {
double VAR_1;
if (((x + (((y - x) * z) / t)) <= 1.974753568692679e+262)) {
VAR_1 = (x + (((y - x) * z) / t));
} else {
VAR_1 = (x + ((y - x) / (t / z)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 1.9 |
| Herbie | 1.5 |
if (+ x (/ (* (- y x) z) t)) < -4.7151087056876726e+104Initial program 12.1
rmApplied *-un-lft-identity12.1
Applied times-frac2.4
Simplified2.4
if -4.7151087056876726e+104 < (+ x (/ (* (- y x) z) t)) < 1.974753568692679e+262Initial program 1.1
if 1.974753568692679e+262 < (+ x (/ (* (- y x) z) t)) Initial program 32.8
rmApplied associate-/l*2.2
Final simplification1.5
herbie shell --seed 2020102
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))