\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 -3.057173118340997 \cdot 10^{117} \lor \neg \left(y \le 7.82737282511057462 \cdot 10^{99}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, \mathsf{fma}\left(a, t, y \cdot \left(a - b\right)\right)\right)}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r905521 = x;
double r905522 = y;
double r905523 = r905521 + r905522;
double r905524 = z;
double r905525 = r905523 * r905524;
double r905526 = t;
double r905527 = r905526 + r905522;
double r905528 = a;
double r905529 = r905527 * r905528;
double r905530 = r905525 + r905529;
double r905531 = b;
double r905532 = r905522 * r905531;
double r905533 = r905530 - r905532;
double r905534 = r905521 + r905526;
double r905535 = r905534 + r905522;
double r905536 = r905533 / r905535;
return r905536;
}
double f(double x, double y, double z, double t, double a, double b) {
double r905537 = y;
double r905538 = -3.057173118340997e+117;
bool r905539 = r905537 <= r905538;
double r905540 = 7.827372825110575e+99;
bool r905541 = r905537 <= r905540;
double r905542 = !r905541;
bool r905543 = r905539 || r905542;
double r905544 = a;
double r905545 = z;
double r905546 = r905544 + r905545;
double r905547 = b;
double r905548 = r905546 - r905547;
double r905549 = x;
double r905550 = r905549 + r905537;
double r905551 = t;
double r905552 = r905544 - r905547;
double r905553 = r905537 * r905552;
double r905554 = fma(r905544, r905551, r905553);
double r905555 = fma(r905550, r905545, r905554);
double r905556 = r905549 + r905551;
double r905557 = r905556 + r905537;
double r905558 = r905555 / r905557;
double r905559 = r905543 ? r905548 : r905558;
return r905559;
}




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.9 |
|---|---|
| Target | 11.8 |
| Herbie | 16.4 |
if y < -3.057173118340997e+117 or 7.827372825110575e+99 < y Initial program 45.5
rmApplied clear-num45.5
Simplified45.5
Taylor expanded around 0 13.4
if -3.057173118340997e+117 < y < 7.827372825110575e+99Initial program 17.9
rmApplied clear-num18.0
Simplified18.0
rmApplied *-un-lft-identity18.0
Applied *-un-lft-identity18.0
Applied times-frac18.0
Applied add-cube-cbrt18.0
Applied times-frac18.0
Simplified18.0
Simplified17.9
Final simplification16.4
herbie shell --seed 2020043 +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)))