\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\begin{array}{l}
\mathbf{if}\;y \leq -9.886517996672513 \cdot 10^{+181}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;y \leq -3.539568470212589 \cdot 10^{+134}:\\
\;\;\;\;\left(a \cdot \frac{y}{y + \left(t + x\right)} + \left(\frac{z \cdot x}{y + \left(t + x\right)} + \left(a \cdot \frac{t}{y + \left(t + x\right)} + \frac{y \cdot z}{y + \left(t + x\right)}\right)\right)\right) - \frac{y \cdot b}{y + \left(t + x\right)}\\
\mathbf{elif}\;y \leq -1.7214341601461616 \cdot 10^{+96} \lor \neg \left(y \leq 1.7733936525202268 \cdot 10^{+46}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y \cdot a}{y + \left(t + x\right)} + \left(\left(a \cdot \frac{t}{y + \left(t + x\right)} + \frac{y \cdot z}{y + \left(t + x\right)}\right) + z \cdot \frac{x}{y + \left(t + x\right)}\right)\right) - \frac{y \cdot b}{y + \left(t + x\right)}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(FPCore (x y z t a b)
:precision binary64
(if (<= y -9.886517996672513e+181)
(- (+ a z) b)
(if (<= y -3.539568470212589e+134)
(-
(+
(* a (/ y (+ y (+ t x))))
(+
(/ (* z x) (+ y (+ t x)))
(+ (* a (/ t (+ y (+ t x)))) (/ (* y z) (+ y (+ t x))))))
(/ (* y b) (+ y (+ t x))))
(if (or (<= y -1.7214341601461616e+96)
(not (<= y 1.7733936525202268e+46)))
(- (+ a z) b)
(-
(+
(/ (* y a) (+ y (+ t x)))
(+
(+ (* a (/ t (+ y (+ t x)))) (/ (* y z) (+ y (+ t x))))
(* z (/ x (+ y (+ t x))))))
(/ (* y b) (+ y (+ t x))))))))double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.886517996672513e+181) {
tmp = (a + z) - b;
} else if (y <= -3.539568470212589e+134) {
tmp = ((a * (y / (y + (t + x)))) + (((z * x) / (y + (t + x))) + ((a * (t / (y + (t + x)))) + ((y * z) / (y + (t + x)))))) - ((y * b) / (y + (t + x)));
} else if ((y <= -1.7214341601461616e+96) || !(y <= 1.7733936525202268e+46)) {
tmp = (a + z) - b;
} else {
tmp = (((y * a) / (y + (t + x))) + (((a * (t / (y + (t + x)))) + ((y * z) / (y + (t + x)))) + (z * (x / (y + (t + x)))))) - ((y * b) / (y + (t + x)));
}
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
Results
| Original | 26.6 |
|---|---|
| Target | 11.3 |
| Herbie | 7.6 |
if y < -9.88651799667251276e181 or -3.539568470212589e134 < y < -1.72143416014616156e96 or 1.77339365252022683e46 < y Initial program 43.2
Taylor expanded around inf 14.7
if -9.88651799667251276e181 < y < -3.539568470212589e134Initial program 39.6
Taylor expanded around 0 39.6
Simplified39.6
rmApplied *-un-lft-identity_binary64_2326639.6
Applied times-frac_binary64_2327238.9
Simplified38.9
rmApplied *-un-lft-identity_binary64_2326638.9
Applied times-frac_binary64_2327230.5
if -1.72143416014616156e96 < y < 1.77339365252022683e46Initial program 16.5
Taylor expanded around 0 16.5
Simplified16.5
rmApplied *-un-lft-identity_binary64_2326616.5
Applied times-frac_binary64_232729.7
Simplified9.7
rmApplied *-un-lft-identity_binary64_232669.7
Applied times-frac_binary64_232722.2
Simplified2.2
Final simplification7.6
herbie shell --seed 2021093
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))