\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(x + y, z, \mathsf{fma}\left(t, a, y \cdot \left(a - b\right)\right)\right)}{t + \left(x + y\right)}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r978540 = x;
double r978541 = y;
double r978542 = r978540 + r978541;
double r978543 = z;
double r978544 = r978542 * r978543;
double r978545 = t;
double r978546 = r978545 + r978541;
double r978547 = a;
double r978548 = r978546 * r978547;
double r978549 = r978544 + r978548;
double r978550 = b;
double r978551 = r978541 * r978550;
double r978552 = r978549 - r978551;
double r978553 = r978540 + r978545;
double r978554 = r978553 + r978541;
double r978555 = r978552 / r978554;
return r978555;
}
double f(double x, double y, double z, double t, double a, double b) {
double r978556 = y;
double r978557 = -1.880087478392796e+115;
bool r978558 = r978556 <= r978557;
double r978559 = 1.2918166468940466e+42;
bool r978560 = r978556 <= r978559;
double r978561 = !r978560;
bool r978562 = r978558 || r978561;
double r978563 = a;
double r978564 = z;
double r978565 = r978563 + r978564;
double r978566 = b;
double r978567 = r978565 - r978566;
double r978568 = 1.0;
double r978569 = sqrt(r978568);
double r978570 = x;
double r978571 = r978570 + r978556;
double r978572 = t;
double r978573 = r978563 - r978566;
double r978574 = r978556 * r978573;
double r978575 = fma(r978572, r978563, r978574);
double r978576 = fma(r978571, r978564, r978575);
double r978577 = r978572 + r978571;
double r978578 = r978576 / r978577;
double r978579 = r978569 * r978578;
double r978580 = r978562 ? r978567 : r978579;
return r978580;
}




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
rmApplied fma-udef17.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)))