\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 -3.68171615921960069 \cdot 10^{31}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;y \le 5855665.9178303052:\\
\;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\
\mathbf{elif}\;y \le 1.6758839092655142 \cdot 10^{255}:\\
\;\;\;\;z - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\
\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 <= -3.6817161592196007e+31)) {
VAR = ((double) (a - ((double) (y * ((double) (b / ((double) (((double) (x + t)) + y))))))));
} else {
double VAR_1;
if ((y <= 5855665.917830305)) {
VAR_1 = ((double) (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) - ((double) (y * b)))) * ((double) (1.0 / ((double) (((double) (x + t)) + y))))));
} else {
double VAR_2;
if ((y <= 1.6758839092655142e+255)) {
VAR_2 = ((double) (z - ((double) (y * ((double) (b / ((double) (((double) (x + t)) + y))))))));
} else {
VAR_2 = ((double) (a - ((double) (y * ((double) (b / ((double) (((double) (x + t)) + y))))))));
}
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.6 |
|---|---|
| Target | 11.3 |
| Herbie | 20.5 |
if y < -3.68171615921960069e31 or 1.6758839092655142e255 < y Initial program 42.9
rmApplied div-sub42.9
rmApplied *-un-lft-identity42.9
Applied times-frac35.6
Simplified35.6
Taylor expanded around 0 25.9
if -3.68171615921960069e31 < y < 5855665.9178303052Initial program 14.8
rmApplied div-inv14.9
if 5855665.9178303052 < y < 1.6758839092655142e255Initial program 36.0
rmApplied div-sub36.0
rmApplied *-un-lft-identity36.0
Applied times-frac30.1
Simplified30.1
Taylor expanded around inf 27.9
Final simplification20.5
herbie shell --seed 2020174
(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)))