double code(double x, double y, double z, double t, double a, double b) {
return ((double) (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) - ((double) (y * b)))) / ((double) (((double) (x + t)) + y))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if ((y <= -9.29290126317176e+268)) {
VAR = ((double) (a - ((double) (((double) (y / ((double) (x + ((double) (y + t)))))) * b))));
} else {
double VAR_1;
if ((y <= -1.0983460863810735e+107)) {
VAR_1 = ((double) (z - ((double) (((double) (y / ((double) (x + ((double) (y + t)))))) * b))));
} else {
double VAR_2;
if ((y <= -4.5819374850263585e-19)) {
VAR_2 = ((double) (a - ((double) (((double) (y / ((double) (x + ((double) (y + t)))))) * b))));
} else {
double VAR_3;
if ((y <= -1.5423588976184654e-275)) {
VAR_3 = ((double) (((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (a * ((double) (y + t)))))) - ((double) (y * b)))) * ((double) (1.0 / ((double) (x + ((double) (y + t))))))));
} else {
double VAR_4;
if ((y <= 7.975561165301613e-292)) {
VAR_4 = ((double) (z - ((double) (((double) (y / ((double) (x + ((double) (y + t)))))) * b))));
} else {
double VAR_5;
if ((y <= 2.5716199698900055e+112)) {
VAR_5 = ((double) (((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (a * ((double) (y + t)))))) / ((double) (x + ((double) (y + t)))))) - ((double) (((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) / ((double) (((double) cbrt(((double) (x + ((double) (y + t)))))) * ((double) cbrt(((double) (x + ((double) (y + t)))))))))) * ((double) (b * ((double) (((double) cbrt(y)) / ((double) cbrt(((double) (x + ((double) (y + t))))))))))))));
} else {
VAR_5 = ((double) (a - ((double) (((double) (y / ((double) (x + ((double) (y + t)))))) * b))));
}
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 | 26.5 |
|---|---|
| Target | 11.3 |
| Herbie | 21.2 |
if y < -9.29290126317176004e268 or -1.09834608638107346e107 < y < -4.5819374850263585e-19 or 2.57161996989000555e112 < y Initial program 38.6
rmApplied div-sub38.6
Simplified38.6
Simplified31.7
Taylor expanded around 0 26.5
if -9.29290126317176004e268 < y < -1.09834608638107346e107 or -1.5423588976184654e-275 < y < 7.97556116530161278e-292Initial program 36.9
rmApplied div-sub36.9
Simplified36.9
Simplified31.1
Taylor expanded around inf 28.6
if -4.5819374850263585e-19 < y < -1.5423588976184654e-275Initial program 15.5
rmApplied div-inv15.6
Simplified15.6
if 7.97556116530161278e-292 < y < 2.57161996989000555e112Initial program 17.0
rmApplied div-sub17.0
Simplified17.0
Simplified16.3
rmApplied add-cube-cbrt16.5
Applied add-cube-cbrt16.5
Applied times-frac16.5
Applied associate-*l*16.0
Simplified16.0
Final simplification21.2
herbie shell --seed 2020192
(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)))