\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}\;z \le -3.022598136684354663412245344550126028397 \cdot 10^{182}:\\
\;\;\;\;z - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le -6.58097239450565769445350948474438013136 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le -5.561955879913683304630071073532749837049 \cdot 10^{-33}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 2.188382713534194168391592823268801705419 \cdot 10^{-265}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le 3.531204250326267435165734577025015017466 \cdot 10^{-186}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 9.836792356441501745440262935078248892751 \cdot 10^{-126}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le 7.569840457596660380072714567516066108349 \cdot 10^{-75}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 4.992279324067695797541286300663075135612 \cdot 10^{56}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{else}:\\
\;\;\;\;z - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r754361 = x;
double r754362 = y;
double r754363 = r754361 + r754362;
double r754364 = z;
double r754365 = r754363 * r754364;
double r754366 = t;
double r754367 = r754366 + r754362;
double r754368 = a;
double r754369 = r754367 * r754368;
double r754370 = r754365 + r754369;
double r754371 = b;
double r754372 = r754362 * r754371;
double r754373 = r754370 - r754372;
double r754374 = r754361 + r754366;
double r754375 = r754374 + r754362;
double r754376 = r754373 / r754375;
return r754376;
}
double f(double x, double y, double z, double t, double a, double b) {
double r754377 = z;
double r754378 = -3.0225981366843547e+182;
bool r754379 = r754377 <= r754378;
double r754380 = y;
double r754381 = x;
double r754382 = t;
double r754383 = r754381 + r754382;
double r754384 = r754383 + r754380;
double r754385 = r754380 / r754384;
double r754386 = 1.0;
double r754387 = b;
double r754388 = r754386 / r754387;
double r754389 = r754385 / r754388;
double r754390 = r754377 - r754389;
double r754391 = -6.580972394505658e-07;
bool r754392 = r754377 <= r754391;
double r754393 = r754381 + r754380;
double r754394 = r754382 + r754380;
double r754395 = a;
double r754396 = r754394 * r754395;
double r754397 = fma(r754393, r754377, r754396);
double r754398 = r754397 / r754386;
double r754399 = r754398 / r754384;
double r754400 = r754399 - r754389;
double r754401 = -5.561955879913683e-33;
bool r754402 = r754377 <= r754401;
double r754403 = r754384 / r754387;
double r754404 = r754380 / r754403;
double r754405 = r754395 - r754404;
double r754406 = 2.1883827135341942e-265;
bool r754407 = r754377 <= r754406;
double r754408 = 3.5312042503262674e-186;
bool r754409 = r754377 <= r754408;
double r754410 = 9.836792356441502e-126;
bool r754411 = r754377 <= r754410;
double r754412 = 7.56984045759666e-75;
bool r754413 = r754377 <= r754412;
double r754414 = 4.992279324067696e+56;
bool r754415 = r754377 <= r754414;
double r754416 = r754415 ? r754400 : r754390;
double r754417 = r754413 ? r754405 : r754416;
double r754418 = r754411 ? r754400 : r754417;
double r754419 = r754409 ? r754405 : r754418;
double r754420 = r754407 ? r754400 : r754419;
double r754421 = r754402 ? r754405 : r754420;
double r754422 = r754392 ? r754400 : r754421;
double r754423 = r754379 ? r754390 : r754422;
return r754423;
}




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.0 |
|---|---|
| Target | 11.3 |
| Herbie | 20.3 |
if z < -3.0225981366843547e+182 or 4.992279324067696e+56 < z Initial program 40.3
rmApplied div-sub40.3
Simplified40.3
rmApplied associate-/l*40.4
rmApplied div-inv40.4
Applied associate-/r*39.6
Taylor expanded around inf 25.0
if -3.0225981366843547e+182 < z < -6.580972394505658e-07 or -5.561955879913683e-33 < z < 2.1883827135341942e-265 or 3.5312042503262674e-186 < z < 9.836792356441502e-126 or 7.56984045759666e-75 < z < 4.992279324067696e+56Initial program 21.4
rmApplied div-sub21.4
Simplified21.4
rmApplied associate-/l*18.2
rmApplied div-inv18.3
Applied associate-/r*17.6
if -6.580972394505658e-07 < z < -5.561955879913683e-33 or 2.1883827135341942e-265 < z < 3.5312042503262674e-186 or 9.836792356441502e-126 < z < 7.56984045759666e-75Initial program 20.2
rmApplied div-sub20.2
Simplified20.2
rmApplied associate-/l*16.1
Taylor expanded around 0 21.0
Final simplification20.3
herbie shell --seed 2020001 +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)))