x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;t \le -2.53387665092588866 \cdot 10^{-304}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{elif}\;t \le 1.3493491951872705 \cdot 10^{-86}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{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) (((double) (y - x)) * z)) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -2.5338766509258887e-304)) {
VAR = ((double) (x + ((double) (((double) (y - x)) / ((double) (t / z))))));
} else {
double VAR_1;
if ((t <= 1.3493491951872705e-86)) {
VAR_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) * ((double) (1.0 / t))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (y - x)) * ((double) (z / t))))));
}
VAR = VAR_1;
}
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 | 1.7 |
if t < -2.53387665092588866e-304Initial program 6.4
rmApplied associate-/l*2.1
if -2.53387665092588866e-304 < t < 1.3493491951872705e-86Initial program 2.5
rmApplied div-inv2.7
if 1.3493491951872705e-86 < t Initial program 7.2
rmApplied *-un-lft-identity7.2
Applied times-frac0.9
Simplified0.9
Final simplification1.7
herbie shell --seed 2020155
(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)))