\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -4.19917722190934078 \cdot 10^{68}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{elif}\;y \le 7.7389096725433433 \cdot 10^{-28}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{z - t}} + 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 <= -4.199177221909341e+68)) {
VAR = ((double) (((double) (x * ((double) (((double) (z - t)) / y)))) + t));
} else {
double VAR_1;
if ((y <= 7.738909672543343e-28)) {
VAR_1 = ((double) (((double) (((double) (x * ((double) (z - t)))) / y)) + t));
} else {
VAR_1 = ((double) (((double) (x / ((double) (y / ((double) (z - t)))))) + t));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.3 |
| Herbie | 1.5 |
if y < -4.19917722190934078e68Initial program 1.3
rmApplied div-inv1.3
Applied associate-*l*1.6
Simplified1.6
if -4.19917722190934078e68 < y < 7.7389096725433433e-28Initial program 3.2
rmApplied associate-*l/1.8
if 7.7389096725433433e-28 < y Initial program 0.9
rmApplied associate-*l/8.3
rmApplied associate-/l*1.0
Final simplification1.5
herbie shell --seed 2020153
(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))