\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 -1.23026288465321788 \cdot 10^{-300}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 0.0:\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 4.17068802715010518 \cdot 10^{302}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\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) (((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) (((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) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))))) <= -1.2302628846532179e-300)) {
VAR_1 = ((double) (((double) (1.0 / ((double) fma(((double) (b - y)), z, y)))) * ((double) fma(x, y, ((double) (z * ((double) (t - a))))))));
} else {
double VAR_2;
if ((((double) (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))))) <= 0.0)) {
VAR_2 = ((double) (((double) (t / b)) - ((double) (a / b))));
} else {
double VAR_3;
if ((((double) (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y)))))))) <= 4.170688027150105e+302)) {
VAR_3 = ((double) (((double) (1.0 / ((double) fma(((double) (b - y)), z, y)))) * ((double) fma(x, y, ((double) (z * ((double) (t - a))))))));
} else {
VAR_3 = ((double) (((double) (t / b)) - ((double) (a / b))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
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.0 |
|---|---|
| Target | 17.9 |
| Herbie | 14.2 |
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.3
if -inf.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -1.2302628846532179e-300 or 0.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 4.170688027150105e+302Initial program 0.3
rmApplied clear-num0.5
Simplified0.5
rmApplied div-inv0.6
Applied add-cube-cbrt0.6
Applied times-frac0.6
Simplified0.6
Simplified0.4
if -1.2302628846532179e-300 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 0.0 or 4.170688027150105e+302 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) Initial program 58.6
rmApplied clear-num58.7
Simplified58.7
Taylor expanded around inf 36.6
Final simplification14.2
herbie shell --seed 2020120 +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)))))