x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} \le -3.2874631937566708 \cdot 10^{283}:\\
\;\;\;\;x + \frac{-z}{\frac{-t}{y - x}}\\
\mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le -1.39263769542628016 \cdot 10^{-44}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le 7.1363608524893538 \cdot 10^{-77}:\\
\;\;\;\;x + \frac{y - x}{-t} \cdot \left(-z\right)\\
\mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le 4.2975414802270641 \cdot 10^{296}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\
\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))) <= -3.287463193756671e+283)) {
VAR = (x + (-z / (-t / (y - x))));
} else {
double VAR_1;
if (((x + ((y - x) * (z / t))) <= -1.3926376954262802e-44)) {
VAR_1 = (x + ((y - x) * (z / t)));
} else {
double VAR_2;
if (((x + ((y - x) * (z / t))) <= 7.136360852489354e-77)) {
VAR_2 = (x + (((y - x) / -t) * -z));
} else {
double VAR_3;
if (((x + ((y - x) * (z / t))) <= 4.297541480227064e+296)) {
VAR_3 = (x + ((y - x) * (z / t)));
} else {
VAR_3 = (x + (((z * y) / t) - ((x * z) / t)));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




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.4 |
if (+ x (* (- y x) (/ z t))) < -3.287463193756671e+283Initial program 17.6
rmApplied clear-num17.6
Applied un-div-inv15.0
rmApplied frac-2neg15.0
Applied associate-/r/12.7
rmApplied clear-num12.7
Applied associate-*l/12.0
Simplified12.0
if -3.287463193756671e+283 < (+ x (* (- y x) (/ z t))) < -1.3926376954262802e-44 or 7.136360852489354e-77 < (+ x (* (- y x) (/ z t))) < 4.297541480227064e+296Initial program 0.1
if -1.3926376954262802e-44 < (+ x (* (- y x) (/ z t))) < 7.136360852489354e-77Initial program 2.7
rmApplied clear-num3.0
Applied un-div-inv3.0
rmApplied frac-2neg3.0
Applied associate-/r/2.6
if 4.297541480227064e+296 < (+ x (* (- y x) (/ z t))) Initial program 27.8
rmApplied clear-num27.8
Applied un-div-inv24.0
rmApplied frac-2neg24.0
Applied associate-/r/10.8
rmApplied clear-num10.9
Applied associate-*l/9.7
Simplified9.7
Taylor expanded around 0 10.5
Final simplification1.4
herbie shell --seed 2020078
(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))))