\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \leq -8.349810058626823 \cdot 10^{-203} \lor \neg \left(y \leq 3.2326137485667516 \cdot 10^{-41}\right):\\
\;\;\;\;\left(\left(x - y\right) \cdot \frac{1}{z - y}\right) \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 -8.349810058626823e-203) (not (<= y 3.2326137485667516e-41))) (* (* (- x y) (/ 1.0 (- 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 <= -8.349810058626823e-203) || !(y <= 3.2326137485667516e-41)) {
tmp = ((x - y) * (1.0 / (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.2 |
if y < -8.34986e-203 or 3.23259e-41 < y Initial program 0.8
rmApplied div-inv_binary64_50690.9
if -8.34986e-203 < y < 3.23259e-41Initial program 5.0
rmApplied associate-*l/_binary64_51305.2
Final simplification2.2
herbie shell --seed 2020231
(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))