\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
t_2 := \mathsf{fma}\left(\frac{y}{b - y}, \frac{x}{z}, \mathsf{fma}\left(\frac{a}{t_1}, \frac{y}{z}, \frac{t}{b - y}\right)\right) - \mathsf{fma}\left(\frac{y}{t_1}, \frac{t}{z}, \frac{a}{b - y}\right)\\
\mathbf{if}\;z \leq -369640450397408.9:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.910612387742409 \cdot 10^{-279}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot t - z \cdot a\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \left(y + z \cdot b\right) - z \cdot y\\
t_4 := \frac{z \cdot t}{t_3}\\
\mathbf{if}\;z \leq 6.002196668933548 \cdot 10^{-210}:\\
\;\;\;\;t_4 + \left(\mathsf{fma}\left(z, x, x\right) - \left(\frac{z \cdot a}{y} + \frac{b \cdot \left(z \cdot x\right)}{y}\right)\right)\\
\mathbf{elif}\;z \leq 95120340125.92792:\\
\;\;\;\;t_4 + \frac{\mathsf{fma}\left(x, y, z \cdot \left(-a\right)\right) + \mathsf{fma}\left(-a, z, z \cdot a\right)}{t_3}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow (- b y) 2.0))
(t_2
(-
(fma (/ y (- b y)) (/ x z) (fma (/ a t_1) (/ y z) (/ t (- b y))))
(fma (/ y t_1) (/ t z) (/ a (- b y))))))
(if (<= z -369640450397408.9)
t_2
(if (<= z -3.910612387742409e-279)
(/ (fma x y (- (* z t) (* z a))) (fma z (- b y) y))
(let* ((t_3 (- (+ y (* z b)) (* z y))) (t_4 (/ (* z t) t_3)))
(if (<= z 6.002196668933548e-210)
(+ t_4 (- (fma z x x) (+ (/ (* z a) y) (/ (* b (* z x)) y))))
(if (<= z 95120340125.92792)
(+ t_4 (/ (+ (fma x y (* z (- a))) (fma (- a) z (* z a))) t_3))
t_2)))))))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 t_1 = pow((b - y), 2.0);
double t_2 = fma((y / (b - y)), (x / z), fma((a / t_1), (y / z), (t / (b - y)))) - fma((y / t_1), (t / z), (a / (b - y)));
double tmp;
if (z <= -369640450397408.9) {
tmp = t_2;
} else if (z <= -3.910612387742409e-279) {
tmp = fma(x, y, ((z * t) - (z * a))) / fma(z, (b - y), y);
} else {
double t_3 = (y + (z * b)) - (z * y);
double t_4 = (z * t) / t_3;
double tmp_1;
if (z <= 6.002196668933548e-210) {
tmp_1 = t_4 + (fma(z, x, x) - (((z * a) / y) + ((b * (z * x)) / y)));
} else if (z <= 95120340125.92792) {
tmp_1 = t_4 + ((fma(x, y, (z * -a)) + fma(-a, z, (z * a))) / t_3);
} else {
tmp_1 = t_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 22.9 |
|---|---|
| Target | 18.0 |
| Herbie | 6.1 |
if z < -369640450397408.88 or 95120340125.927917 < z Initial program 39.1
Simplified39.1
Taylor expanded in z around inf 22.2
Simplified3.6
if -369640450397408.88 < z < -3.9106123877424087e-279Initial program 8.7
Simplified8.7
Applied *-un-lft-identity_binary648.7
Applied cancel-sign-sub-inv_binary648.7
Applied distribute-lft-in_binary648.7
if -3.9106123877424087e-279 < z < 6.0021966689335478e-210Initial program 8.5
Simplified8.5
Applied clear-num_binary648.7
Taylor expanded in x around 0 8.5
Simplified8.5
Taylor expanded in z around 0 14.6
Simplified9.4
if 6.0021966689335478e-210 < z < 95120340125.927917Initial program 7.5
Simplified7.5
Applied clear-num_binary647.7
Taylor expanded in x around 0 7.5
Simplified7.5
Applied prod-diff_binary647.5
Final simplification6.1
herbie shell --seed 2021313
(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)))))