\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -5.910237375042319 \cdot 10^{67} \lor \neg \left(y \le 4.0064465433570219 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + 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 temp;
if (((y <= -5.910237375042319e+67) || !(y <= 4.006446543357022e-49))) {
temp = (((x / y) * (z - t)) + t);
} else {
temp = (((x * (z - t)) / y) + t);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.1 |
| Herbie | 1.5 |
if y < -5.910237375042319e+67 or 4.006446543357022e-49 < y Initial program 0.9
if -5.910237375042319e+67 < y < 4.006446543357022e-49Initial program 3.6
rmApplied add-cube-cbrt4.3
Applied *-un-lft-identity4.3
Applied times-frac4.3
Applied associate-*l*2.3
rmApplied associate-*l/3.1
Applied frac-times3.1
Simplified3.1
Simplified2.3
Final simplification1.5
herbie shell --seed 2020060
(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))