\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} = -\infty:\\
\;\;\;\;x\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 3.90603739421509999 \cdot 10^{305}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return (((x * y) + (z * (t - a))) / (y + (z * (b - y))));
}
double code(double x, double y, double z, double t, double a, double b) {
double temp;
if (((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= -inf.0)) {
temp = x;
} else {
double temp_1;
if (((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= 3.9060373942151e+305)) {
temp_1 = (((x * y) + (z * (t - a))) / (y + (z * (b - y))));
} else {
temp_1 = ((t / b) - (a / b));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 23.3 |
|---|---|
| Target | 18.2 |
| Herbie | 16.3 |
if (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -inf.0Initial program 64.0
rmApplied clear-num64.0
Simplified64.0
Taylor expanded around 0 36.8
if -inf.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 3.9060373942151e+305Initial program 6.2
if 3.9060373942151e+305 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) Initial program 63.9
rmApplied clear-num63.9
Simplified63.9
Taylor expanded around inf 41.2
Final simplification16.3
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))