\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le 1.0508318923791141 \cdot 10^{-263} \lor \neg \left(y \le 5.8969616447109301 \cdot 10^{-135}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= 1.050831892379114e-263) || !(y <= 5.89696164471093e-135))) {
VAR = ((double) (((double) (((double) (x / ((double) (z - y)))) - ((double) (y / ((double) (z - y)))))) * t));
} else {
VAR = ((double) (((double) (((double) (x - y)) * t)) / ((double) (z - y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.1 |
| Herbie | 2.0 |
if y < 1.0508318923791141e-263 or 5.8969616447109301e-135 < y Initial program 1.6
rmApplied div-sub1.6
if 1.0508318923791141e-263 < y < 5.8969616447109301e-135Initial program 6.2
rmApplied associate-*l/5.4
Final simplification2.0
herbie shell --seed 2020150
(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))