\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 7.6237735172787151 \cdot 10^{229}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r879676 = x;
double r879677 = y;
double r879678 = r879676 + r879677;
double r879679 = z;
double r879680 = r879678 * r879679;
double r879681 = t;
double r879682 = r879681 + r879677;
double r879683 = a;
double r879684 = r879682 * r879683;
double r879685 = r879680 + r879684;
double r879686 = b;
double r879687 = r879677 * r879686;
double r879688 = r879685 - r879687;
double r879689 = r879676 + r879681;
double r879690 = r879689 + r879677;
double r879691 = r879688 / r879690;
return r879691;
}
double f(double x, double y, double z, double t, double a, double b) {
double r879692 = x;
double r879693 = y;
double r879694 = r879692 + r879693;
double r879695 = z;
double r879696 = r879694 * r879695;
double r879697 = t;
double r879698 = r879697 + r879693;
double r879699 = a;
double r879700 = r879698 * r879699;
double r879701 = r879696 + r879700;
double r879702 = b;
double r879703 = r879693 * r879702;
double r879704 = r879701 - r879703;
double r879705 = r879692 + r879697;
double r879706 = r879705 + r879693;
double r879707 = r879704 / r879706;
double r879708 = -inf.0;
bool r879709 = r879707 <= r879708;
double r879710 = 7.623773517278715e+229;
bool r879711 = r879707 <= r879710;
double r879712 = !r879711;
bool r879713 = r879709 || r879712;
double r879714 = r879699 + r879695;
double r879715 = r879714 - r879702;
double r879716 = 1.0;
double r879717 = r879706 / r879704;
double r879718 = r879716 / r879717;
double r879719 = r879713 ? r879715 : r879718;
return r879719;
}




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.4 |
|---|---|
| Target | 11.4 |
| Herbie | 7.9 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 7.623773517278715e+229 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 60.6
rmApplied clear-num60.6
Taylor expanded around 0 17.7
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 7.623773517278715e+229Initial program 0.4
rmApplied clear-num0.5
Final simplification7.9
herbie shell --seed 2020024
(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)))