\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \leq -1.1321875610025753 \cdot 10^{-11} \lor \neg \left(y \leq 1.16814932569234 \cdot 10^{-71}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.1321875610025753e-11) (not (<= y 1.16814932569234e-71))) (* (/ (- x y) (- z y)) t) (/ (* (- x y) t) (- z y))))
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 tmp;
if ((y <= -1.1321875610025753e-11) || !(y <= 1.16814932569234e-71)) {
tmp = ((x - y) / (z - y)) * t;
} else {
tmp = ((x - y) * t) / (z - y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.0 |
| Herbie | 2.1 |
if y < -1.13218756100257535e-11 or 1.16814932569234008e-71 < y Initial program 0.3
if -1.13218756100257535e-11 < y < 1.16814932569234008e-71Initial program 4.8
rmApplied associate-*l/_binary64_161985.1
Final simplification2.1
herbie shell --seed 2020281
(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))