\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -9.1585731778171103 \cdot 10^{-40} \lor \neg \left(y \le 2.03532850985060222 \cdot 10^{71}\right):\\
\;\;\;\;x \cdot \frac{z - t}{y} + 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 (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -9.15857317781711e-40) || !(y <= 2.0353285098506022e+71))) {
VAR = ((x * ((z - t) / y)) + t);
} else {
VAR = (((x * (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.1 |
| Herbie | 1.4 |
if y < -9.15857317781711e-40 or 2.0353285098506022e+71 < y Initial program 1.0
rmApplied div-inv1.0
Applied associate-*l*1.0
Simplified0.9
if -9.15857317781711e-40 < y < 2.0353285098506022e+71Initial program 3.5
rmApplied associate-*l/2.1
Final simplification1.4
herbie shell --seed 2020079
(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))