\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)} \le -1.3127884619435154 \cdot 10^{296}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right) - \frac{a}{\frac{\mathsf{fma}\left(z, b - y, y\right)}{z}}\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \le 3.858636314203592 \cdot 10^{306}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, x \cdot y\right)}{\mathsf{fma}\left(z, b - y, y\right)} - \frac{a}{\left(\frac{y}{z} + b\right) - y}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{a}{\left(\frac{y}{z} + b\right) - y}\\
\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 (((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= -1.3127884619435154e+296)) {
VAR = (fma(x, z, x) - (a / (fma(z, (b - y), y) / z)));
} else {
double VAR_1;
if (((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= 3.858636314203592e+306)) {
VAR_1 = ((fma(t, z, (x * y)) / fma(z, (b - y), y)) - (a / (((y / z) + b) - y)));
} else {
VAR_1 = (0.0 - (a / (((y / z) + b) - y)));
}
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.5 |
|---|---|
| Target | 18.0 |
| Herbie | 14.8 |
if (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -1.3127884619435154e+296Initial program 62.8
rmApplied sub-neg62.8
Applied distribute-lft-in62.8
Applied associate-+r+62.8
Simplified62.8
rmApplied distribute-rgt-neg-out62.8
Applied unsub-neg62.8
Applied div-sub62.8
Simplified62.8
Simplified50.7
Taylor expanded around 0 27.6
Simplified27.6
if -1.3127884619435154e+296 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 3.858636314203592e+306Initial program 6.5
rmApplied sub-neg6.5
Applied distribute-lft-in6.5
Applied associate-+r+6.5
Simplified6.5
rmApplied distribute-rgt-neg-out6.5
Applied unsub-neg6.5
Applied div-sub6.5
Simplified6.5
Simplified7.1
Taylor expanded around 0 4.8
if 3.858636314203592e+306 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) Initial program 63.9
rmApplied sub-neg63.9
Applied distribute-lft-in63.9
Applied associate-+r+63.9
Simplified63.9
rmApplied distribute-rgt-neg-out63.9
Applied unsub-neg63.9
Applied div-sub63.9
Simplified63.9
Simplified58.7
Taylor expanded around 0 48.4
Taylor expanded around inf 42.3
Final simplification14.8
herbie shell --seed 2020102 +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)))))