x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} = -\infty:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le 1.42650305201034258 \cdot 10^{295}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\
\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 (((x + ((y - x) * (z / t))) <= -inf.0)) {
temp = (x + (((y - x) * z) / t));
} else {
double temp_1;
if (((x + ((y - x) * (z / t))) <= 1.4265030520103426e+295)) {
temp_1 = (x + ((y - x) * (z / t)));
} else {
temp_1 = (x + (((y - x) * z) * (1.0 / t)));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.2 |
| Herbie | 1.0 |
if (+ x (* (- y x) (/ z t))) < -inf.0Initial program 64.0
rmApplied associate-*r/0.2
if -inf.0 < (+ x (* (- y x) (/ z t))) < 1.4265030520103426e+295Initial program 0.7
if 1.4265030520103426e+295 < (+ x (* (- y x) (/ z t))) Initial program 27.7
rmApplied div-inv27.8
Applied associate-*r*11.4
Final simplification1.0
herbie shell --seed 2020066 +o rules:numerics
(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.887) (+ 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))))