\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}\;t \le -1.27341593101006445 \cdot 10^{180}:\\
\;\;\;\;a - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le -3.9930459557533415 \cdot 10^{-21}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le 4.776511014458635 \cdot 10^{-298}:\\
\;\;\;\;z - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le 8.26703641181714224 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le 1.3318142435851507 \cdot 10^{60}:\\
\;\;\;\;z - b \cdot \frac{y}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;a - b \cdot \frac{y}{\left(x + t\right) + 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 temp;
if ((t <= -1.2734159310100645e+180)) {
temp = (a - (b * (y / ((x + t) + y))));
} else {
double temp_1;
if ((t <= -3.9930459557533415e-21)) {
temp_1 = (((fma((x + y), z, ((t + y) * a)) / 1.0) / ((x + t) + y)) - (b * (y / ((x + t) + y))));
} else {
double temp_2;
if ((t <= 4.7765110144586345e-298)) {
temp_2 = (z - (b * (y / ((x + t) + y))));
} else {
double temp_3;
if ((t <= 8.267036411817142e-33)) {
temp_3 = (((fma((x + y), z, ((t + y) * a)) / 1.0) / ((x + t) + y)) - (b * (y / ((x + t) + y))));
} else {
double temp_4;
if ((t <= 1.3318142435851507e+60)) {
temp_4 = (z - (b * (y / ((x + t) + y))));
} else {
temp_4 = (a - (b * (y / ((x + t) + y))));
}
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.4 |
|---|---|
| Target | 11.2 |
| Herbie | 21.5 |
if t < -1.2734159310100645e+180 or 1.3318142435851507e+60 < t Initial program 34.1
rmApplied div-sub34.1
Simplified34.1
rmApplied *-un-lft-identity34.1
Applied *-commutative34.1
Applied times-frac31.5
Simplified31.5
Taylor expanded around 0 21.8
if -1.2734159310100645e+180 < t < -3.9930459557533415e-21 or 4.7765110144586345e-298 < t < 8.267036411817142e-33Initial program 23.5
rmApplied div-sub23.5
Simplified23.5
rmApplied *-un-lft-identity23.5
Applied *-commutative23.5
Applied times-frac20.7
Simplified20.7
if -3.9930459557533415e-21 < t < 4.7765110144586345e-298 or 8.267036411817142e-33 < t < 1.3318142435851507e+60Initial program 22.3
rmApplied div-sub22.3
Simplified22.3
rmApplied *-un-lft-identity22.3
Applied *-commutative22.3
Applied times-frac18.9
Simplified18.9
Taylor expanded around inf 22.1
Final simplification21.5
herbie shell --seed 2020066 +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)))