\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -5.0662827553965913 \cdot 10^{-47} \lor \neg \left(y \le 202279419.45545077\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 ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -5.066282755396591e-47) || !(y <= 202279419.45545077))) {
VAR = ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
} 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.2 |
|---|---|
| Target | 2.3 |
| Herbie | 1.3 |
if y < -5.066282755396591e-47 or 202279419.45545077 < y Initial program 1.0
if -5.066282755396591e-47 < y < 202279419.45545077Initial program 4.2
rmApplied associate-*l/1.7
Final simplification1.3
herbie shell --seed 2020148
(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))