\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)} = -inf.0:\\
\;\;\;\;x\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le -1.1320017857953323 \cdot 10^{-301} \lor \neg \left(\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 0.0\right) \land \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 9.2828732842421297 \cdot 10^{307}:\\
\;\;\;\;\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 (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if (((((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y))))))) <= -inf.0)) {
VAR = x;
} else {
double VAR_1;
if ((((((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y))))))) <= -1.1320017857953323e-301) || (!((((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y))))))) <= 0.0) && ((((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y))))))) <= 9.28287328424213e+307)))) {
VAR_1 = (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))));
} else {
VAR_1 = ((double) ((t / b) - (a / b)));
}
VAR = VAR_1;
}
return VAR;
}




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.7 |
|---|---|
| Target | 18.5 |
| Herbie | 14.9 |
if (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -inf.0Initial program 64.0
rmApplied clear-num64.0
rmApplied div-inv64.0
Applied associate-/r*64.0
Simplified64.0
Taylor expanded around 0 40.1
if -inf.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -1.1320017857953323e-301 or 0.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 9.2828732842421297e307Initial program 0.3
if -1.1320017857953323e-301 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 0.0 or 9.2828732842421297e307 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) Initial program 59.5
rmApplied clear-num59.5
rmApplied div-inv59.5
Applied associate-/r*59.5
Simplified59.5
Taylor expanded around inf 37.1
Final simplification14.9
herbie shell --seed 2020182
(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)))))