\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 := y + z \cdot \left(b - y\right)\\
t_3 := \frac{x \cdot y + t_1}{t_2}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;t_3 \leq -5.737180884435787 \cdot 10^{-281}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_1\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_4 := \frac{y}{b - y}\\
t_5 := {\left(b - y\right)}^{2}\\
t_6 := \frac{t}{b - y}\\
t_7 := \mathsf{fma}\left(\frac{y}{t_5}, \frac{t}{z}, \frac{a}{b - y}\right)\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(t_4, \frac{x}{z}, \mathsf{fma}\left(\frac{a}{t_5}, \frac{y}{z}, t_6\right)\right) - t_7\\
\mathbf{elif}\;t_3 \leq 1.0968421907966705 \cdot 10^{+270}:\\
\;\;\;\;\frac{z \cdot t}{t_2} + \frac{x \cdot y - z \cdot a}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_4, \frac{x}{z}, t_6\right) - t_7\\
\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 (* z (- t a)))
(t_2 (+ y (* z (- b y))))
(t_3 (/ (+ (* x y) t_1) t_2)))
(if (<= t_3 (- INFINITY))
(/ x (- 1.0 z))
(if (<= t_3 -5.737180884435787e-281)
(/ (fma x y t_1) (fma z (- b y) y))
(let* ((t_4 (/ y (- b y)))
(t_5 (pow (- b y) 2.0))
(t_6 (/ t (- b y)))
(t_7 (fma (/ y t_5) (/ t z) (/ a (- b y)))))
(if (<= t_3 0.0)
(- (fma t_4 (/ x z) (fma (/ a t_5) (/ y z) t_6)) t_7)
(if (<= t_3 1.0968421907966705e+270)
(+ (/ (* z t) t_2) (/ (- (* x y) (* z a)) t_2))
(- (fma t_4 (/ x z) t_6) t_7))))))))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 = y + (z * (b - y));
double t_3 = ((x * y) + t_1) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = x / (1.0 - z);
} else if (t_3 <= -5.737180884435787e-281) {
tmp = fma(x, y, t_1) / fma(z, (b - y), y);
} else {
double t_4 = y / (b - y);
double t_5 = pow((b - y), 2.0);
double t_6 = t / (b - y);
double t_7 = fma((y / t_5), (t / z), (a / (b - y)));
double tmp_1;
if (t_3 <= 0.0) {
tmp_1 = fma(t_4, (x / z), fma((a / t_5), (y / z), t_6)) - t_7;
} else if (t_3 <= 1.0968421907966705e+270) {
tmp_1 = ((z * t) / t_2) + (((x * y) - (z * a)) / t_2);
} else {
tmp_1 = fma(t_4, (x / z), t_6) - t_7;
}
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 | 23.1 |
|---|---|
| Target | 17.8 |
| Herbie | 5.7 |
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 32.3
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.7371808844357872e-281Initial program 0.4
Simplified0.4
if -5.7371808844357872e-281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 42.7
Simplified42.7
Taylor expanded in z around inf 19.0
Simplified3.5
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0968421907966705e270Initial program 0.3
Simplified0.3
Taylor expanded in x around 0 0.3
Simplified0.3
if 1.0968421907966705e270 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 60.8
Simplified60.8
Taylor expanded in z around inf 40.5
Simplified13.1
Taylor expanded in a around 0 12.2
Final simplification5.7
herbie shell --seed 2022081
(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)))))