\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := \frac{x \cdot y + t_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;t_2 \leq -4.755410386895729 \cdot 10^{-273}:\\
\;\;\;\;\begin{array}{l}
t_3 := \left(y + z \cdot b\right) - y \cdot z\\
\left(\frac{z \cdot t}{t_3} + \frac{x \cdot y}{t_3}\right) - \frac{z \cdot a}{t_3}
\end{array}\\
\mathbf{elif}\;t_2 \leq 0 \lor \neg \left(t_2 \leq 5.6114041823469945 \cdot 10^{+301}\right):\\
\;\;\;\;\begin{array}{l}
t_4 := {\left(b - y\right)}^{2}\\
\mathsf{fma}\left(\frac{y}{b - y}, \frac{x}{z}, \mathsf{fma}\left(\frac{a}{t_4}, \frac{y}{z}, \frac{t}{b - y}\right)\right) - \mathsf{fma}\left(\frac{y}{t_4}, \frac{t}{z}, \frac{a}{b - y}\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_1\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\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 (* z (- t a))) (t_2 (/ (+ (* x y) t_1) (+ y (* z (- b y))))))
(if (<= t_2 (- INFINITY))
(/ x (- 1.0 z))
(if (<= t_2 -4.755410386895729e-273)
(let* ((t_3 (- (+ y (* z b)) (* y z))))
(- (+ (/ (* z t) t_3) (/ (* x y) t_3)) (/ (* z a) t_3)))
(if (or (<= t_2 0.0) (not (<= t_2 5.6114041823469945e+301)))
(let* ((t_4 (pow (- b y) 2.0)))
(-
(fma (/ y (- b y)) (/ x z) (fma (/ a t_4) (/ y z) (/ t (- b y))))
(fma (/ y t_4) (/ t z) (/ a (- b y)))))
(/ (fma x y t_1) (fma z (- b y) y)))))))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 = z * (t - a);
double t_2 = ((x * y) + t_1) / (y + (z * (b - y)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = x / (1.0 - z);
} else if (t_2 <= -4.755410386895729e-273) {
double t_3 = (y + (z * b)) - (y * z);
tmp = (((z * t) / t_3) + ((x * y) / t_3)) - ((z * a) / t_3);
} else if ((t_2 <= 0.0) || !(t_2 <= 5.6114041823469945e+301)) {
double t_4 = pow((b - y), 2.0);
tmp = fma((y / (b - y)), (x / z), fma((a / t_4), (y / z), (t / (b - y)))) - fma((y / t_4), (t / z), (a / (b - y)));
} else {
tmp = fma(x, y, t_1) / fma(z, (b - y), y);
}
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 | 23.7 |
|---|---|
| Target | 18.7 |
| Herbie | 5.2 |
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 64.0
Simplified64.0
Taylor expanded in y around inf 30.4
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.75541038689572916e-273Initial program 0.3
Simplified0.3
Taylor expanded in x around 0 0.3
if -4.75541038689572916e-273 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 5.61140418234699452e301 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 57.7
Simplified57.7
Taylor expanded in z around inf 34.4
Simplified8.6
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.61140418234699452e301Initial program 0.3
Simplified0.3
Final simplification5.2
herbie shell --seed 2021280
(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)))))