\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}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le -6.939662278312858132841061974784859759209 \cdot 10^{305}:\\
\;\;\;\;z\\
\mathbf{elif}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le 9.823560067484486557199205658011723736571 \cdot 10^{276}:\\
\;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r517356 = x;
double r517357 = y;
double r517358 = r517356 + r517357;
double r517359 = z;
double r517360 = r517358 * r517359;
double r517361 = t;
double r517362 = r517361 + r517357;
double r517363 = a;
double r517364 = r517362 * r517363;
double r517365 = r517360 + r517364;
double r517366 = b;
double r517367 = r517357 * r517366;
double r517368 = r517365 - r517367;
double r517369 = r517356 + r517361;
double r517370 = r517369 + r517357;
double r517371 = r517368 / r517370;
return r517371;
}
double f(double x, double y, double z, double t, double a, double b) {
double r517372 = x;
double r517373 = y;
double r517374 = r517372 + r517373;
double r517375 = z;
double r517376 = r517374 * r517375;
double r517377 = t;
double r517378 = r517377 + r517373;
double r517379 = a;
double r517380 = r517378 * r517379;
double r517381 = r517376 + r517380;
double r517382 = b;
double r517383 = r517373 * r517382;
double r517384 = r517381 - r517383;
double r517385 = r517372 + r517377;
double r517386 = r517385 + r517373;
double r517387 = r517384 / r517386;
double r517388 = -6.939662278312858e+305;
bool r517389 = r517387 <= r517388;
double r517390 = 9.823560067484487e+276;
bool r517391 = r517387 <= r517390;
double r517392 = r517391 ? r517387 : r517375;
double r517393 = r517389 ? r517375 : r517392;
return r517393;
}




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.8 |
|---|---|
| Target | 11.1 |
| Herbie | 17.1 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -6.939662278312858e+305 or 9.823560067484487e+276 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 63.1
Taylor expanded around inf 40.1
if -6.939662278312858e+305 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 9.823560067484487e+276Initial program 0.3
Final simplification17.1
herbie shell --seed 2019208
(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.5813117084150564e153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e82) (/ 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)))