\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}\;z \le -1.9324464993872985 \cdot 10^{161}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le -3.21777700749054 \cdot 10^{-212}:\\
\;\;\;\;\frac{{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right)}^{1}}{\left(x + t\right) + y} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 4.9830269560747303 \cdot 10^{-230}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 5.11133884308971345 \cdot 10^{-138}:\\
\;\;\;\;\frac{{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right)}^{1}}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;z \le 2.2961033508151134 \cdot 10^{-92}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 2.02082285385241078 \cdot 10^{-10}:\\
\;\;\;\;\frac{{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right)}^{1}}{\left(x + t\right) + y} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 2688.7700160430627:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 3.8981084817894228 \cdot 10^{118}:\\
\;\;\;\;\frac{{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right)}^{1}}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\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 temp;
if ((z <= -1.9324464993872985e+161)) {
temp = (z - (y / (((x + t) + y) / b)));
} else {
double temp_1;
if ((z <= -3.21777700749054e-212)) {
temp_1 = ((pow((((x + y) * z) + ((t + y) * a)), 1.0) / ((x + t) + y)) - ((y / ((x + t) + y)) * b));
} else {
double temp_2;
if ((z <= 4.98302695607473e-230)) {
temp_2 = (a - (y / (((x + t) + y) / b)));
} else {
double temp_3;
if ((z <= 5.1113388430897134e-138)) {
temp_3 = ((pow((((x + y) * z) + ((t + y) * a)), 1.0) / ((x + t) + y)) - (y * (b / ((x + t) + y))));
} else {
double temp_4;
if ((z <= 2.2961033508151134e-92)) {
temp_4 = (a - (y / (((x + t) + y) / b)));
} else {
double temp_5;
if ((z <= 2.0208228538524108e-10)) {
temp_5 = ((pow((((x + y) * z) + ((t + y) * a)), 1.0) / ((x + t) + y)) - ((y / ((x + t) + y)) * b));
} else {
double temp_6;
if ((z <= 2688.7700160430627)) {
temp_6 = (a - (y / (((x + t) + y) / b)));
} else {
double temp_7;
if ((z <= 3.898108481789423e+118)) {
temp_7 = ((pow((((x + y) * z) + ((t + y) * a)), 1.0) / ((x + t) + y)) - (y * (b / ((x + t) + y))));
} else {
temp_7 = (z - (y / (((x + t) + y) / b)));
}
temp_6 = temp_7;
}
temp_5 = temp_6;
}
temp_4 = temp_5;
}
temp_3 = temp_4;
}
temp_2 = temp_3;
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}




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.5 |
| Herbie | 20.6 |
if z < -1.9324464993872985e+161 or 3.898108481789423e+118 < z Initial program 40.7
rmApplied pow140.7
rmApplied div-sub40.7
rmApplied associate-/l*40.7
Taylor expanded around inf 25.9
if -1.9324464993872985e+161 < z < -3.21777700749054e-212 or 2.2961033508151134e-92 < z < 2.0208228538524108e-10Initial program 21.8
rmApplied pow121.8
rmApplied div-sub21.8
rmApplied associate-/l*18.8
rmApplied associate-/r/18.1
if -3.21777700749054e-212 < z < 4.98302695607473e-230 or 5.1113388430897134e-138 < z < 2.2961033508151134e-92 or 2.0208228538524108e-10 < z < 2688.7700160430627Initial program 19.7
rmApplied pow119.7
rmApplied div-sub19.7
rmApplied associate-/l*17.1
Taylor expanded around 0 19.6
if 4.98302695607473e-230 < z < 5.1113388430897134e-138 or 2688.7700160430627 < z < 3.898108481789423e+118Initial program 22.0
rmApplied pow122.0
rmApplied div-sub22.0
rmApplied *-un-lft-identity22.0
Applied times-frac18.9
Simplified18.9
Final simplification20.6
herbie shell --seed 2020058
(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)))