x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;t \le -3.0489408480972455 \cdot 10^{64} \lor \neg \left(t \le 9.9076978621992896 \cdot 10^{21}\right):\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot 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 (((t <= -3.0489408480972455e+64) || !(t <= 9.90769786219929e+21))) {
VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
} else {
VAR = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.4 |
| Herbie | 1.7 |
if t < -3.0489408480972455e64 or 9.9076978621992896e21 < t Initial program 1.3
if -3.0489408480972455e64 < t < 9.9076978621992896e21Initial program 3.2
rmApplied associate-*r/2.3
Final simplification1.7
herbie shell --seed 2020162
(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))))