\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 2.041321864689251512249751826689545856816 \cdot 10^{241}\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 r739020 = x;
double r739021 = y;
double r739022 = r739020 + r739021;
double r739023 = z;
double r739024 = r739022 * r739023;
double r739025 = t;
double r739026 = r739025 + r739021;
double r739027 = a;
double r739028 = r739026 * r739027;
double r739029 = r739024 + r739028;
double r739030 = b;
double r739031 = r739021 * r739030;
double r739032 = r739029 - r739031;
double r739033 = r739020 + r739025;
double r739034 = r739033 + r739021;
double r739035 = r739032 / r739034;
return r739035;
}
double f(double x, double y, double z, double t, double a, double b) {
double r739036 = x;
double r739037 = y;
double r739038 = r739036 + r739037;
double r739039 = z;
double r739040 = r739038 * r739039;
double r739041 = t;
double r739042 = r739041 + r739037;
double r739043 = a;
double r739044 = r739042 * r739043;
double r739045 = r739040 + r739044;
double r739046 = b;
double r739047 = r739037 * r739046;
double r739048 = r739045 - r739047;
double r739049 = r739036 + r739041;
double r739050 = r739049 + r739037;
double r739051 = r739048 / r739050;
double r739052 = -inf.0;
bool r739053 = r739051 <= r739052;
double r739054 = 2.0413218646892515e+241;
bool r739055 = r739051 <= r739054;
double r739056 = !r739055;
bool r739057 = r739053 || r739056;
double r739058 = r739043 + r739039;
double r739059 = r739058 - r739046;
double r739060 = r739057 ? r739059 : r739051;
return r739060;
}




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.1 |
|---|---|
| Target | 11.1 |
| Herbie | 7.4 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 2.0413218646892515e+241 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 61.6
rmApplied clear-num61.6
Taylor expanded around 0 17.2
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 2.0413218646892515e+241Initial program 0.3
Final simplification7.4
herbie shell --seed 2019298
(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)))