\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 -2.09253904820276937 \cdot 10^{87} \lor \neg \left(y \le 1.1685565590472489 \cdot 10^{-98} \lor \neg \left(y \le 1.8899870319995665 \cdot 10^{-88} \lor \neg \left(y \le 1.1685265508795281 \cdot 10^{44}\right)\right)\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, x + y, \left(t + y\right) \cdot a - y \cdot b\right)}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r940911 = x;
double r940912 = y;
double r940913 = r940911 + r940912;
double r940914 = z;
double r940915 = r940913 * r940914;
double r940916 = t;
double r940917 = r940916 + r940912;
double r940918 = a;
double r940919 = r940917 * r940918;
double r940920 = r940915 + r940919;
double r940921 = b;
double r940922 = r940912 * r940921;
double r940923 = r940920 - r940922;
double r940924 = r940911 + r940916;
double r940925 = r940924 + r940912;
double r940926 = r940923 / r940925;
return r940926;
}
double f(double x, double y, double z, double t, double a, double b) {
double r940927 = y;
double r940928 = -2.0925390482027694e+87;
bool r940929 = r940927 <= r940928;
double r940930 = 1.168556559047249e-98;
bool r940931 = r940927 <= r940930;
double r940932 = 1.8899870319995665e-88;
bool r940933 = r940927 <= r940932;
double r940934 = 1.1685265508795281e+44;
bool r940935 = r940927 <= r940934;
double r940936 = !r940935;
bool r940937 = r940933 || r940936;
double r940938 = !r940937;
bool r940939 = r940931 || r940938;
double r940940 = !r940939;
bool r940941 = r940929 || r940940;
double r940942 = a;
double r940943 = z;
double r940944 = r940942 + r940943;
double r940945 = b;
double r940946 = r940944 - r940945;
double r940947 = x;
double r940948 = r940947 + r940927;
double r940949 = t;
double r940950 = r940949 + r940927;
double r940951 = r940950 * r940942;
double r940952 = r940927 * r940945;
double r940953 = r940951 - r940952;
double r940954 = fma(r940943, r940948, r940953);
double r940955 = r940947 + r940949;
double r940956 = r940955 + r940927;
double r940957 = r940954 / r940956;
double r940958 = r940941 ? r940946 : r940957;
return r940958;
}




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 | 27.1 |
|---|---|
| Target | 11.5 |
| Herbie | 16.0 |
if y < -2.0925390482027694e+87 or 1.168556559047249e-98 < y < 1.8899870319995665e-88 or 1.1685265508795281e+44 < y Initial program 41.7
rmApplied clear-num41.8
Simplified41.8
Taylor expanded around 0 15.3
if -2.0925390482027694e+87 < y < 1.168556559047249e-98 or 1.8899870319995665e-88 < y < 1.1685265508795281e+44Initial program 16.5
rmApplied clear-num16.6
Simplified16.6
rmApplied *-un-lft-identity16.6
Applied *-un-lft-identity16.6
Applied times-frac16.6
Applied add-cube-cbrt16.6
Applied times-frac16.6
Simplified16.6
Simplified16.5
Final simplification16.0
herbie shell --seed 2020046 +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)))