\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -104469830838636080 \lor \neg \left(y \le 5.2104471588359449 \cdot 10^{-206}\right):\\
\;\;\;\;\left(\left(x - y\right) \cdot \frac{1}{z - y}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}double code(double x, double y, double z, double t) {
return (((x - y) / (z - y)) * t);
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -1.0446983083863608e+17) || !(y <= 5.210447158835945e-206))) {
VAR = (((x - y) * (1.0 / (z - y))) * t);
} else {
VAR = ((x - y) * (t / (z - y)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.3 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if y < -1.0446983083863608e+17 or 5.210447158835945e-206 < y Initial program 1.0
rmApplied div-inv1.1
if -1.0446983083863608e+17 < y < 5.210447158835945e-206Initial program 4.9
rmApplied div-inv5.0
Applied associate-*l*5.0
Simplified4.9
Final simplification2.3
herbie shell --seed 2020075
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))