\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \leq -1.5747647500589528 \cdot 10^{+20}:\\
\;\;\;\;\left(z \cdot \frac{x}{y} + t\right) + t \cdot \left(x \cdot \frac{-1}{y}\right)\\
\mathbf{elif}\;y \leq 7.139296702863165 \cdot 10^{-108}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
(FPCore (x y z t)
:precision binary64
(if (<= y -1.5747647500589528e+20)
(+ (+ (* z (/ x y)) t) (* t (* x (/ -1.0 y))))
(if (<= y 7.139296702863165e-108)
(+ t (/ (* x (- z t)) y))
(+ t (* (/ x y) (- z t))))))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 (y <= -1.5747647500589528e+20) {
tmp = ((z * (x / y)) + t) + (t * (x * (-1.0 / y)));
} else if (y <= 7.139296702863165e-108) {
tmp = t + ((x * (z - t)) / y);
} else {
tmp = t + ((x / y) * (z - t));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.3 |
| Herbie | 1.4 |
if y < -157476475005895279000Initial program 1.1
rmApplied sub-neg_binary641.1
Applied distribute-rgt-in_binary641.1
Applied associate-+l+_binary641.1
Simplified1.1
rmApplied *-un-lft-identity_binary641.1
Applied distribute-rgt-out--_binary641.1
rmApplied div-inv_binary641.1
Applied cancel-sign-sub-inv_binary641.1
Applied distribute-rgt-in_binary641.1
Applied associate-+r+_binary641.1
Simplified1.1
if -157476475005895279000 < y < 7.13929670286316481e-108Initial program 4.0
rmApplied associate-*l/_binary642.1
if 7.13929670286316481e-108 < y Initial program 1.2
Final simplification1.4
herbie shell --seed 2020273
(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))