\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.8094282358139013 \cdot 10^{93}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;a \le 1.8555915042103347 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{\left(x + t\right) + y}} \cdot b\right)\\
\mathbf{elif}\;a \le 1.3909060355411578 \cdot 10^{-42}:\\
\;\;\;\;z - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;a \le 7.87267627449342466 \cdot 10^{48}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\frac{\sqrt[3]{\left(x + t\right) + y}}{b}}\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot 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 VAR;
if ((a <= -1.8094282358139013e+93)) {
VAR = (a - ((y / ((x + t) + y)) * b));
} else {
double VAR_1;
if ((a <= 1.8555915042103347e-100)) {
VAR_1 = (((fma((x + y), z, ((t + y) * a)) / 1.0) / ((x + t) + y)) - (((cbrt(y) * cbrt(y)) / (cbrt(((x + t) + y)) * cbrt(((x + t) + y)))) * ((cbrt(y) / cbrt(((x + t) + y))) * b)));
} else {
double VAR_2;
if ((a <= 1.3909060355411578e-42)) {
VAR_2 = (z - ((y / ((x + t) + y)) * b));
} else {
double VAR_3;
if ((a <= 7.872676274493425e+48)) {
VAR_3 = (((fma((x + y), z, ((t + y) * a)) / 1.0) / ((x + t) + y)) - ((y / (cbrt(((x + t) + y)) * cbrt(((x + t) + y)))) / (cbrt(((x + t) + y)) / b)));
} else {
VAR_3 = (a - ((y / ((x + t) + y)) * b));
}
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 | 26.4 |
|---|---|
| Target | 11.2 |
| Herbie | 19.5 |
if a < -1.8094282358139013e+93 or 7.872676274493425e+48 < a Initial program 38.2
rmApplied div-sub38.2
Simplified38.2
rmApplied associate-/l*37.9
rmApplied associate-/r/37.2
Taylor expanded around 0 26.4
if -1.8094282358139013e+93 < a < 1.8555915042103347e-100Initial program 18.5
rmApplied div-sub18.5
Simplified18.5
rmApplied associate-/l*15.7
rmApplied associate-/r/15.0
rmApplied add-cube-cbrt15.3
Applied add-cube-cbrt15.2
Applied times-frac15.2
Applied associate-*l*14.4
if 1.8555915042103347e-100 < a < 1.3909060355411578e-42Initial program 23.1
rmApplied div-sub23.1
Simplified23.1
rmApplied associate-/l*16.6
rmApplied associate-/r/16.5
Taylor expanded around inf 23.4
if 1.3909060355411578e-42 < a < 7.872676274493425e+48Initial program 20.5
rmApplied div-sub20.5
Simplified20.5
rmApplied associate-/l*16.5
rmApplied *-un-lft-identity16.5
Applied add-cube-cbrt16.8
Applied times-frac16.8
Applied associate-/r*16.1
Simplified16.1
Final simplification19.5
herbie shell --seed 2020075 +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)))