\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \leq -4.0115871199600727 \cdot 10^{-286} \lor \neg \left(t \leq 1.5416204891117621 \cdot 10^{-148}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) ((x / y) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((t <= -4.0115871199600727e-286) || !(t <= 1.5416204891117621e-148))) {
VAR = ((double) (t + ((double) ((x / y) * ((double) (z - t))))));
} else {
VAR = ((double) (t + ((double) (x * (((double) (z - 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.1 |
| Herbie | 1.8 |
if t < -4.0115871199600727e-286 or 1.5416204891117621e-148 < t Initial program 1.2
if -4.0115871199600727e-286 < t < 1.5416204891117621e-148Initial program 4.8
Simplified4.3
Final simplification1.8
herbie shell --seed 2020199
(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))