\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:\\
\;\;\;\;x\\
\mathbf{elif}\;t_2 \leq -2.2057944836670588 \cdot 10^{-269}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_1\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t_2 \leq 2.1560368786804746 \cdot 10^{-245}:\\
\;\;\;\;\begin{array}{l}
t_3 := {\left(y - b\right)}^{2}\\
\mathsf{fma}\left(\frac{y}{z}, \frac{a}{t_3}, \frac{a}{y - b}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{x}{y - b}, \mathsf{fma}\left(\frac{y}{z}, \frac{t}{t_3}, \frac{t}{y - b}\right)\right)
\end{array}\\
\mathbf{elif}\;t_2 \leq 7.965570100955554 \cdot 10^{+305}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\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}\\
\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
(if (<= t_2 -2.2057944836670588e-269)
(/ (fma x y t_1) (fma z (- b y) y))
(if (<= t_2 2.1560368786804746e-245)
(let* ((t_3 (pow (- y b) 2.0)))
(-
(fma (/ y z) (/ a t_3) (/ a (- y b)))
(fma (/ y z) (/ x (- y b)) (fma (/ y z) (/ t t_3) (/ t (- y b))))))
(if (<= t_2 7.965570100955554e+305)
t_2
(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)))))))))))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;
} else if (t_2 <= -2.2057944836670588e-269) {
tmp = fma(x, y, t_1) / fma(z, (b - y), y);
} else if (t_2 <= 2.1560368786804746e-245) {
double t_3 = pow((y - b), 2.0);
tmp = fma((y / z), (a / t_3), (a / (y - b))) - fma((y / z), (x / (y - b)), fma((y / z), (t / t_3), (t / (y - b))));
} else if (t_2 <= 7.965570100955554e+305) {
tmp = t_2;
} else {
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)));
}
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.9 |
|---|---|
| Target | 18.6 |
| Herbie | 6.4 |
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 z around 0 37.1
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2.20579448366705878e-269Initial program 0.3
Simplified0.3
Applied *-un-lft-identity_binary640.3
if -2.20579448366705878e-269 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.15603687868047463e-245Initial program 40.1
Simplified40.1
Taylor expanded in z around -inf 22.4
Simplified8.9
if 2.15603687868047463e-245 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 7.965570100955554e305Initial program 0.3
if 7.965570100955554e305 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 63.8
Simplified63.8
Taylor expanded in z around inf 40.6
Simplified10.3
Final simplification6.4
herbie shell --seed 2021344
(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)))))