\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 8.8061629631279907 \cdot 10^{244}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \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 r815596 = x;
double r815597 = y;
double r815598 = r815596 + r815597;
double r815599 = z;
double r815600 = r815598 * r815599;
double r815601 = t;
double r815602 = r815601 + r815597;
double r815603 = a;
double r815604 = r815602 * r815603;
double r815605 = r815600 + r815604;
double r815606 = b;
double r815607 = r815597 * r815606;
double r815608 = r815605 - r815607;
double r815609 = r815596 + r815601;
double r815610 = r815609 + r815597;
double r815611 = r815608 / r815610;
return r815611;
}
double f(double x, double y, double z, double t, double a, double b) {
double r815612 = x;
double r815613 = y;
double r815614 = r815612 + r815613;
double r815615 = z;
double r815616 = r815614 * r815615;
double r815617 = t;
double r815618 = r815617 + r815613;
double r815619 = a;
double r815620 = r815618 * r815619;
double r815621 = r815616 + r815620;
double r815622 = b;
double r815623 = r815613 * r815622;
double r815624 = r815621 - r815623;
double r815625 = r815612 + r815617;
double r815626 = r815625 + r815613;
double r815627 = r815624 / r815626;
double r815628 = -inf.0;
bool r815629 = r815627 <= r815628;
double r815630 = 8.806162963127991e+244;
bool r815631 = r815627 <= r815630;
double r815632 = !r815631;
bool r815633 = r815629 || r815632;
double r815634 = r815619 + r815615;
double r815635 = r815634 - r815622;
double r815636 = 1.0;
double r815637 = r815636 * r815627;
double r815638 = r815633 ? r815635 : r815637;
return r815638;
}




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.7 |
|---|---|
| Target | 11.1 |
| Herbie | 7.4 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 8.806162963127991e+244 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 61.6
rmApplied clear-num61.6
Taylor expanded around 0 16.9
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 8.806162963127991e+244Initial program 0.3
rmApplied clear-num0.4
rmApplied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied add-cube-cbrt0.4
Applied times-frac0.4
Simplified0.4
Simplified0.3
Final simplification7.4
herbie shell --seed 2020039
(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)))