\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;z \le -2.10529586811968693 \cdot 10^{131} \lor \neg \left(z \le 4.85537482711178077 \cdot 10^{196}\right):\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(b - y, z, y\right)}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}}\\
\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 (((z <= -2.105295868119687e+131) || !(z <= 4.855374827111781e+196))) {
temp = ((t / b) - (a / b));
} else {
temp = (1.0 / (fma((b - y), z, y) / fma(x, y, (z * (t - a)))));
}
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 | 22.7 |
|---|---|
| Target | 17.8 |
| Herbie | 19.2 |
if z < -2.105295868119687e+131 or 4.855374827111781e+196 < z Initial program 49.9
rmApplied clear-num49.9
Simplified49.9
Taylor expanded around inf 33.6
if -2.105295868119687e+131 < z < 4.855374827111781e+196Initial program 14.8
rmApplied clear-num15.0
Simplified14.9
Final simplification19.2
herbie shell --seed 2020058 +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)))))