\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 \le -5.35235414659780861 \cdot 10^{48}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;y \le -1.92517275137635566 \cdot 10^{-61}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y \cdot \left(a - b\right) + a \cdot t\right)}{\left(x + t\right) + y}\\
\mathbf{elif}\;y \le -2.51501501672513634 \cdot 10^{-116}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \le 5.45003729820436518 \cdot 10^{86}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y \cdot \left(a - b\right) + a \cdot t\right)}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}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 <= -5.3523541465978086e+48)) {
VAR = ((double) (((double) (a + z)) - b));
} else {
double VAR_1;
if ((y <= -1.9251727513763557e-61)) {
VAR_1 = ((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (y * ((double) (a - b)))) + ((double) (a * t)))))) / ((double) (((double) (x + t)) + y))));
} else {
double VAR_2;
if ((y <= -2.5150150167251363e-116)) {
VAR_2 = a;
} else {
double VAR_3;
if ((y <= 5.450037298204365e+86)) {
VAR_3 = ((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (y * ((double) (a - b)))) + ((double) (a * t)))))) / ((double) (((double) (x + t)) + y))));
} else {
VAR_3 = ((double) (((double) (a + z)) - 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.5 |
|---|---|
| Target | 11.3 |
| Herbie | 16.7 |
if y < -5.3523541465978086e+48 or 5.450037298204365e+86 < y Initial program 43.1
rmApplied clear-num43.1
Taylor expanded around 0 15.3
if -5.3523541465978086e+48 < y < -1.9251727513763557e-61 or -2.5150150167251363e-116 < y < 5.450037298204365e+86Initial program 15.6
rmApplied add-cube-cbrt16.0
Applied associate-*r*16.0
rmApplied *-un-lft-identity16.0
Applied associate-/r*16.0
Simplified15.6
if -1.9251727513763557e-61 < y < -2.5150150167251363e-116Initial program 14.6
Taylor expanded around 0 44.2
Final simplification16.7
herbie shell --seed 2020140
(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)))