\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \le -9.08989183024131518 \cdot 10^{187}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{z - t}{\frac{y}{x}} + t\\
\end{array}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 VAR;
if (((x / y) <= -9.089891830241315e+187)) {
VAR = (((x * (z - t)) / y) + t);
} else {
VAR = (((z - t) / (y / x)) + t);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.3 |
| Herbie | 1.5 |
if (/ x y) < -9.089891830241315e+187Initial program 16.3
rmApplied associate-*l/2.6
if -9.089891830241315e+187 < (/ x y) Initial program 1.5
rmApplied clear-num1.6
Applied associate-*l/1.5
Simplified1.5
Final simplification1.5
herbie shell --seed 2020078 +o rules:numerics
(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))