\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \leq -2.1281528084172094 \cdot 10^{-169} \lor \neg \left(t \leq -6.174035256837851 \cdot 10^{-304}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.1281528084172094e-169) (not (<= t -6.174035256837851e-304))) (+ t (* (/ x y) (- z t))) (+ t (/ (* x (- z t)) y))))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1281528084172094e-169) || !(t <= -6.174035256837851e-304)) {
tmp = t + ((x / y) * (z - t));
} else {
tmp = t + ((x * (z - t)) / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.5 |
| Herbie | 2.2 |
if t < -2.1281528084172094e-169 or -6.1740352568378508e-304 < t Initial program 1.8
if -2.1281528084172094e-169 < t < -6.1740352568378508e-304Initial program 5.8
rmApplied associate-*l/_binary645.6
Final simplification2.2
herbie shell --seed 2020224
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))