\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}\;a \le -1.2192263232079549 \cdot 10^{244}:\\
\;\;\;\;a - \frac{b}{\frac{\left(x + t\right) + y}{y}}\\
\mathbf{elif}\;a \le -2.1529316069315559 \cdot 10^{134}:\\
\;\;\;\;\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) \cdot \frac{1}{\left(x + t\right) + y} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;a \le -2.4075371916051229 \cdot 10^{-5}:\\
\;\;\;\;a - \frac{b}{\frac{\left(x + t\right) + y}{y}}\\
\mathbf{elif}\;a \le -1.76681565249545171 \cdot 10^{-85}:\\
\;\;\;\;\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) \cdot \frac{1}{\left(x + t\right) + y} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;a \le -1.27994229446098491 \cdot 10^{-129}:\\
\;\;\;\;z - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;a \le -1.6811233784297703 \cdot 10^{-292}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;a \le 2.92090303831041133 \cdot 10^{-291}:\\
\;\;\;\;z\\
\mathbf{elif}\;a \le 9247920914101468920000:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;a - \frac{b}{\frac{\left(x + t\right) + y}{y}}\\
\end{array}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 VAR;
if ((a <= -1.2192263232079549e+244)) {
VAR = (a - (b / (((x + t) + y) / y)));
} else {
double VAR_1;
if ((a <= -2.152931606931556e+134)) {
VAR_1 = (((((x + y) * z) + ((t + y) * a)) * (1.0 / ((x + t) + y))) - (b * (y / ((x + t) + y))));
} else {
double VAR_2;
if ((a <= -2.407537191605123e-05)) {
VAR_2 = (a - (b / (((x + t) + y) / y)));
} else {
double VAR_3;
if ((a <= -1.7668156524954517e-85)) {
VAR_3 = (((((x + y) * z) + ((t + y) * a)) * (1.0 / ((x + t) + y))) - (b * (y / ((x + t) + y))));
} else {
double VAR_4;
if ((a <= -1.2799422944609849e-129)) {
VAR_4 = (z - (b * (y / ((x + t) + y))));
} else {
double VAR_5;
if ((a <= -1.6811233784297703e-292)) {
VAR_5 = ((1.0 / (((x + t) + y) / (((x + y) * z) + ((t + y) * a)))) - (b * (y / ((x + t) + y))));
} else {
double VAR_6;
if ((a <= 2.9209030383104113e-291)) {
VAR_6 = z;
} else {
double VAR_7;
if ((a <= 9.247920914101469e+21)) {
VAR_7 = ((1.0 / (((x + t) + y) / (((x + y) * z) + ((t + y) * a)))) - (b * (y / ((x + t) + y))));
} else {
VAR_7 = (a - (b / (((x + t) + y) / y)));
}
VAR_6 = VAR_7;
}
VAR_5 = VAR_6;
}
VAR_4 = VAR_5;
}
VAR_3 = VAR_4;
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




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 | 27.1 |
|---|---|
| Target | 11.3 |
| Herbie | 21.3 |
if a < -1.2192263232079549e+244 or -2.152931606931556e+134 < a < -2.407537191605123e-05 or 9.247920914101469e+21 < a Initial program 34.9
rmApplied div-sub34.9
rmApplied *-commutative34.9
Applied associate-/l*33.2
Taylor expanded around 0 25.4
if -1.2192263232079549e+244 < a < -2.152931606931556e+134 or -2.407537191605123e-05 < a < -1.7668156524954517e-85Initial program 29.6
rmApplied div-sub29.6
rmApplied *-commutative29.6
Applied associate-/l*27.4
rmApplied div-inv27.4
Simplified27.4
rmApplied div-inv27.5
if -1.7668156524954517e-85 < a < -1.2799422944609849e-129Initial program 20.5
rmApplied div-sub20.5
rmApplied *-commutative20.5
Applied associate-/l*14.1
rmApplied div-inv14.1
Simplified14.1
Taylor expanded around inf 20.0
if -1.2799422944609849e-129 < a < -1.6811233784297703e-292 or 2.9209030383104113e-291 < a < 9.247920914101469e+21Initial program 18.9
rmApplied div-sub18.9
rmApplied *-commutative18.9
Applied associate-/l*14.1
rmApplied div-inv14.1
Simplified14.0
rmApplied clear-num14.1
if -1.6811233784297703e-292 < a < 2.9209030383104113e-291Initial program 24.9
Taylor expanded around inf 31.2
Final simplification21.3
herbie shell --seed 2020071 +o rules:numerics
(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 (/ (+ (+ 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)))