x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;z \le 8.72237655502040412 \cdot 10^{-83}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;z \le 2.11625050668119009 \cdot 10^{206}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\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 temp;
if ((z <= 8.722376555020404e-83)) {
temp = (x + ((y - x) * (z / t)));
} else {
double temp_1;
if ((z <= 2.11625050668119e+206)) {
temp_1 = (x + (((y - x) / t) * z));
} else {
temp_1 = (x + ((y - x) / (t / z)));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.2 |
| Herbie | 2.0 |
if z < 8.722376555020404e-83Initial program 5.0
rmApplied *-un-lft-identity5.0
Applied times-frac1.9
Simplified1.9
if 8.722376555020404e-83 < z < 2.11625050668119e+206Initial program 7.7
rmApplied associate-/l*2.2
rmApplied associate-/r/1.4
if 2.11625050668119e+206 < z Initial program 25.3
rmApplied associate-/l*7.6
Final simplification2.0
herbie shell --seed 2020060
(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)))