x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;t \le -2.3190062364282818 \cdot 10^{87} \lor \neg \left(t \le -7.1064035504258002 \cdot 10^{-228}\right):\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{-t}{\left(y - x\right) \cdot \left(-z\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 (((t <= -2.319006236428282e+87) || !(t <= -7.1064035504258e-228))) {
VAR = (x + ((y - x) * (z / t)));
} else {
VAR = (x + (1.0 / (-t / ((y - x) * -z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.3 |
|---|---|
| Target | 2.1 |
| Herbie | 2.2 |
if t < -2.319006236428282e+87 or -7.1064035504258e-228 < t Initial program 7.5
rmApplied associate-/l*2.1
rmApplied div-inv2.3
Simplified2.2
if -2.319006236428282e+87 < t < -7.1064035504258e-228Initial program 2.0
rmApplied associate-/l*2.0
rmApplied clear-num2.1
rmApplied frac-2neg2.1
Applied associate-/l/2.2
Final simplification2.2
herbie shell --seed 2020071 +o rules:numerics
(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)))