\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;z \le -3.79681007453336803 \cdot 10^{235} \lor \neg \left(z \le 9.3702509275758488 \cdot 10^{111}\right):\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, t - a, -x \cdot y\right)}{-\mathsf{fma}\left(b - y, z, y\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 <= -3.796810074533368e+235) || !(z <= 9.370250927575849e+111))) {
temp = ((t / b) - (a / b));
} else {
temp = (fma(-z, (t - a), -(x * y)) / -fma((b - y), z, y));
}
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.4 |
|---|---|
| Target | 17.3 |
| Herbie | 19.2 |
if z < -3.796810074533368e+235 or 9.370250927575849e+111 < z Initial program 49.2
rmApplied clear-num49.2
Simplified49.2
Taylor expanded around inf 34.0
if -3.796810074533368e+235 < z < 9.370250927575849e+111Initial program 15.3
rmApplied div-inv15.4
Simplified15.4
rmApplied add-cube-cbrt15.8
Applied associate-*r*15.8
rmApplied frac-2neg15.8
Applied associate-*r/15.8
Simplified15.3
Final simplification19.2
herbie shell --seed 2020066 +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)))))