\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} = -\infty \lor \neg \left(\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le 4.0696574754080134 \cdot 10^{161}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r891537 = x;
double r891538 = y;
double r891539 = r891537 + r891538;
double r891540 = z;
double r891541 = r891539 * r891540;
double r891542 = t;
double r891543 = r891542 + r891538;
double r891544 = a;
double r891545 = r891543 * r891544;
double r891546 = r891541 + r891545;
double r891547 = b;
double r891548 = r891538 * r891547;
double r891549 = r891546 - r891548;
double r891550 = r891537 + r891542;
double r891551 = r891550 + r891538;
double r891552 = r891549 / r891551;
return r891552;
}
double f(double x, double y, double z, double t, double a, double b) {
double r891553 = x;
double r891554 = y;
double r891555 = r891553 + r891554;
double r891556 = z;
double r891557 = r891555 * r891556;
double r891558 = t;
double r891559 = r891558 + r891554;
double r891560 = a;
double r891561 = r891559 * r891560;
double r891562 = r891557 + r891561;
double r891563 = b;
double r891564 = r891554 * r891563;
double r891565 = r891562 - r891564;
double r891566 = r891553 + r891558;
double r891567 = r891566 + r891554;
double r891568 = r891565 / r891567;
double r891569 = -inf.0;
bool r891570 = r891568 <= r891569;
double r891571 = 4.0696574754080134e+161;
bool r891572 = r891568 <= r891571;
double r891573 = !r891572;
bool r891574 = r891570 || r891573;
double r891575 = r891560 + r891556;
double r891576 = r891575 - r891563;
double r891577 = r891574 ? r891576 : r891568;
return r891577;
}




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.1 |
| Herbie | 8.3 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 4.0696574754080134e+161 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 57.0
rmApplied clear-num57.0
Taylor expanded around 0 17.3
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 4.0696574754080134e+161Initial program 0.4
Final simplification8.3
herbie shell --seed 2020049
(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 (/ (+ (+ 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)))