\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -1.23733528834590716 \cdot 10^{-180} \lor \neg \left(y \le 4.31012491618395035 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{x}{y} \cdot z + \left(t - t \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -1.2373352883459072e-180) || !(y <= 4.3101249161839503e-26))) {
VAR = ((double) (((double) (((double) (x / y)) * z)) + ((double) (t - ((double) (t * ((double) (x / y))))))));
} else {
VAR = ((double) (((double) (((double) (x * ((double) (z - t)))) / y)) + t));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.3 |
|---|---|
| Target | 2.3 |
| Herbie | 1.6 |
if y < -1.23733528834590716e-180 or 4.31012491618395035e-26 < y Initial program 1.4
rmApplied sub-neg1.4
Applied distribute-lft-in1.4
Applied associate-+l+1.4
Simplified1.4
if -1.23733528834590716e-180 < y < 4.31012491618395035e-26Initial program 5.3
rmApplied associate-*l/2.4
Final simplification1.6
herbie shell --seed 2020163
(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))