\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \le -8.7762358588158641 \cdot 10^{52} \lor \neg \left(t \le -4.81058165284924211 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{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 (((t <= -8.776235858815864e+52) || !(t <= -4.810581652849242e-152))) {
VAR = ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
} else {
VAR = ((double) (((double) (x * ((double) (((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.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.5 |
if t < -8.776235858815864e+52 or -4.810581652849242e-152 < t Initial program 2.1
if -8.776235858815864e+52 < t < -4.810581652849242e-152Initial program 1.4
rmApplied div-inv1.5
Applied associate-*l*4.4
Simplified4.4
Final simplification2.5
herbie shell --seed 2020122
(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))