\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \leq -2.0915467853000205 \cdot 10^{-42} \lor \neg \left(y \leq 1.9469965754910335 \cdot 10^{-177}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{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 -2.0915467853000205e-42) (not (<= y 1.9469965754910335e-177))) (* (- (/ x (- z y)) (/ y (- z y))) t) (/ (* t (- x y)) (- z y))))
double code(double x, double y, double z, double t) {
return ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
}
double code(double x, double y, double z, double t) {
double tmp;
if (((y <= -2.0915467853000205e-42) || !(y <= 1.9469965754910335e-177))) {
tmp = ((double) (((double) ((x / ((double) (z - y))) - (y / ((double) (z - y))))) * t));
} else {
tmp = (((double) (t * ((double) (x - y)))) / ((double) (z - y)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.3 |
|---|---|
| Target | 2.3 |
| Herbie | 2.4 |
if y < -2.0915467853000205e-42 or 1.9469965754910335e-177 < y Initial program 0.8
rmApplied div-sub_binary640.8
if -2.0915467853000205e-42 < y < 1.9469965754910335e-177Initial program 5.6
rmApplied associate-*l/_binary646.1
Final simplification2.4
herbie shell --seed 2020210
(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))