\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \le -1.8030915408536723 \cdot 10^{-221} \lor \neg \left(\frac{x}{y} \le 0.0\right):\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \left(\frac{z}{y} - \frac{t}{y}\right)\\
\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 (((((double) (x / y)) <= -1.8030915408536723e-221) || !(((double) (x / y)) <= 0.0))) {
VAR = ((double) (t + ((double) (((double) (x / y)) * ((double) (z - t))))));
} else {
VAR = ((double) (t + ((double) (x * ((double) (((double) (z / y)) - ((double) (t / y))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.3 |
| Herbie | 1.5 |
if (/ x y) < -1.8030915408536723e-221 or 0.0 < (/ x y) Initial program 1.8
if -1.8030915408536723e-221 < (/ x y) < 0.0Initial program 2.4
Simplified0.2
rmApplied div-sub0.2
Final simplification1.5
herbie shell --seed 2020185
(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))