x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} = -inf.0 \lor \neg \left(x + \left(y - x\right) \cdot \frac{z}{t} \le 1.8984011221778871 \cdot 10^{232}\right):\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x + ((double) (((double) (y - x)) * ((double) (z / t)))))) <= -inf.0) || !(((double) (x + ((double) (((double) (y - x)) * ((double) (z / t)))))) <= 1.898401122177887e+232))) {
VAR = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
} else {
VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.3 |
| Herbie | 2.2 |
if (+ x (* (- y x) (/ z t))) < -inf.0 or 1.8984011221778871e232 < (+ x (* (- y x) (/ z t))) Initial program 12.8
rmApplied associate-*r/13.4
if -inf.0 < (+ x (* (- y x) (/ z t))) < 1.8984011221778871e232Initial program 0.8
Final simplification2.2
herbie shell --seed 2020179
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))