\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}\;y \leq -3.020899892525743 \cdot 10^{+25} \lor \neg \left(y \leq 1.4535349447456728 \cdot 10^{+32}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.020899892525743e+25) (not (<= y 1.4535349447456728e+32))) (- (+ z a) b) (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
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 tmp;
if ((y <= -3.020899892525743e+25) || !(y <= 1.4535349447456728e+32)) {
tmp = (z + a) - b;
} else {
tmp = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
}
return tmp;
}











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.9 |
|---|---|
| Target | 11.5 |
| Herbie | 16.5 |
| Alternative 1 | |
|---|---|
| Error | 23.6 |
| Cost | 1988 |
| Alternative 2 | |
|---|---|
| Error | 23.2 |
| Cost | 1032 |
| Alternative 3 | |
|---|---|
| Error | 27.6 |
| Cost | 2181 |
| Alternative 4 | |
|---|---|
| Error | 26.0 |
| Cost | 1604 |
| Alternative 5 | |
|---|---|
| Error | 35.7 |
| Cost | 1348 |
| Alternative 6 | |
|---|---|
| Error | 43.0 |
| Cost | 64 |
| Alternative 7 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |

if y < -3.02089989252574288e25 or 1.45353494474567276e32 < y Initial program 39.7
Taylor expanded around inf 16.7
Simplified16.7
Simplified16.7
if -3.02089989252574288e25 < y < 1.45353494474567276e32Initial program 16.3
Simplified16.3
Final simplification16.5
herbie shell --seed 2021044
(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)))