\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;z \le -1.80427409516903929 \cdot 10^{145} \lor \neg \left(z \le 8822645728086630330000\right):\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\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 VAR;
if (((z <= -1.8042740951690393e+145) || !(z <= 8.82264572808663e+21))) {
VAR = ((t / b) - (a / b));
} else {
VAR = (fma(x, y, (z * (t - a))) / fma((b - y), z, y));
}
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.5 |
|---|---|
| Target | 18.2 |
| Herbie | 20.0 |
if z < -1.8042740951690393e+145 or 8.82264572808663e+21 < z Initial program 43.7
rmApplied clear-num43.7
Simplified43.7
Taylor expanded around inf 34.1
if -1.8042740951690393e+145 < z < 8.82264572808663e+21Initial program 12.0
rmApplied clear-num12.1
Simplified12.1
rmApplied clear-num12.1
rmApplied remove-double-div12.0
Final simplification20.0
herbie shell --seed 2020091 +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)))))