\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}\;y \le -1.8800874783927961 \cdot 10^{115} \lor \neg \left(y \le 1.29181664689404663 \cdot 10^{42}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1} \cdot \frac{\mathsf{fma}\left(z, x + y, \mathsf{fma}\left(y, a - b, t \cdot a\right)\right)}{y + \left(x + t\right)}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r1026870 = x;
double r1026871 = y;
double r1026872 = r1026870 + r1026871;
double r1026873 = z;
double r1026874 = r1026872 * r1026873;
double r1026875 = t;
double r1026876 = r1026875 + r1026871;
double r1026877 = a;
double r1026878 = r1026876 * r1026877;
double r1026879 = r1026874 + r1026878;
double r1026880 = b;
double r1026881 = r1026871 * r1026880;
double r1026882 = r1026879 - r1026881;
double r1026883 = r1026870 + r1026875;
double r1026884 = r1026883 + r1026871;
double r1026885 = r1026882 / r1026884;
return r1026885;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1026886 = y;
double r1026887 = -1.880087478392796e+115;
bool r1026888 = r1026886 <= r1026887;
double r1026889 = 1.2918166468940466e+42;
bool r1026890 = r1026886 <= r1026889;
double r1026891 = !r1026890;
bool r1026892 = r1026888 || r1026891;
double r1026893 = a;
double r1026894 = z;
double r1026895 = r1026893 + r1026894;
double r1026896 = b;
double r1026897 = r1026895 - r1026896;
double r1026898 = 1.0;
double r1026899 = sqrt(r1026898);
double r1026900 = x;
double r1026901 = r1026900 + r1026886;
double r1026902 = r1026893 - r1026896;
double r1026903 = t;
double r1026904 = r1026903 * r1026893;
double r1026905 = fma(r1026886, r1026902, r1026904);
double r1026906 = fma(r1026894, r1026901, r1026905);
double r1026907 = r1026900 + r1026903;
double r1026908 = r1026886 + r1026907;
double r1026909 = r1026906 / r1026908;
double r1026910 = r1026899 * r1026909;
double r1026911 = r1026892 ? r1026897 : r1026910;
return r1026911;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 26.4 |
|---|---|
| Target | 11.3 |
| Herbie | 16.2 |
if y < -1.880087478392796e+115 or 1.2918166468940466e+42 < y Initial program 42.7
rmApplied clear-num42.8
Simplified42.8
Taylor expanded around 0 15.0
if -1.880087478392796e+115 < y < 1.2918166468940466e+42Initial program 16.9
rmApplied clear-num17.0
Simplified17.0
Taylor expanded around inf 17.0
Simplified17.0
rmApplied div-inv17.1
Applied add-cube-cbrt17.1
Applied times-frac17.1
Simplified17.1
Simplified17.0
rmApplied *-un-lft-identity17.0
Applied add-sqr-sqrt17.0
Applied times-frac17.0
Applied associate-*l*17.0
Simplified16.9
Final simplification16.2
herbie shell --seed 2020047 +o rules:numerics
(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)))