\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 -6.3766260127845671 \cdot 10^{136}:\\
\;\;\;\;z - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le -7.5553554336738665 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{1}{\frac{\frac{\left(x + t\right) + y}{b}}{y}}\\
\mathbf{elif}\;z \le -1.4420526235398581 \cdot 10^{-96}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le -5.2560627363695754 \cdot 10^{-198}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}\right) \cdot \frac{\sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}}{\left(x + t\right) + y} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le -3.0011721532957425 \cdot 10^{-279}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le -8.4694881761373042 \cdot 10^{-290}:\\
\;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\
\mathbf{elif}\;z \le 1.829058436943914 \cdot 10^{-282}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(z, y, \mathsf{fma}\left(a, t, a \cdot y\right)\right)}{1}}{\left(x + t\right) + y} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 5.14388566176424308 \cdot 10^{-183}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 1.1248158106174079 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}\right) \cdot \frac{\sqrt[3]{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}}{\left(x + t\right) + y} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 4.44861392459712437 \cdot 10^{27}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le 1.07400177686964386 \cdot 10^{86}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{1}{\frac{\frac{\left(x + t\right) + y}{b}}{y}}\\
\mathbf{else}:\\
\;\;\;\;z - \frac{y}{\left(x + t\right) + y} \cdot b\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r871498 = x;
double r871499 = y;
double r871500 = r871498 + r871499;
double r871501 = z;
double r871502 = r871500 * r871501;
double r871503 = t;
double r871504 = r871503 + r871499;
double r871505 = a;
double r871506 = r871504 * r871505;
double r871507 = r871502 + r871506;
double r871508 = b;
double r871509 = r871499 * r871508;
double r871510 = r871507 - r871509;
double r871511 = r871498 + r871503;
double r871512 = r871511 + r871499;
double r871513 = r871510 / r871512;
return r871513;
}
double f(double x, double y, double z, double t, double a, double b) {
double r871514 = z;
double r871515 = -6.376626012784567e+136;
bool r871516 = r871514 <= r871515;
double r871517 = y;
double r871518 = x;
double r871519 = t;
double r871520 = r871518 + r871519;
double r871521 = r871520 + r871517;
double r871522 = r871517 / r871521;
double r871523 = b;
double r871524 = r871522 * r871523;
double r871525 = r871514 - r871524;
double r871526 = -7.5553554336738665e-50;
bool r871527 = r871514 <= r871526;
double r871528 = r871518 + r871517;
double r871529 = r871519 + r871517;
double r871530 = a;
double r871531 = r871529 * r871530;
double r871532 = fma(r871528, r871514, r871531);
double r871533 = 1.0;
double r871534 = r871532 / r871533;
double r871535 = r871534 / r871521;
double r871536 = r871521 / r871523;
double r871537 = r871536 / r871517;
double r871538 = r871533 / r871537;
double r871539 = r871535 - r871538;
double r871540 = -1.442052623539858e-96;
bool r871541 = r871514 <= r871540;
double r871542 = r871530 - r871524;
double r871543 = -5.2560627363695754e-198;
bool r871544 = r871514 <= r871543;
double r871545 = cbrt(r871532);
double r871546 = r871545 * r871545;
double r871547 = r871545 / r871521;
double r871548 = r871546 * r871547;
double r871549 = r871548 - r871524;
double r871550 = -3.0011721532957425e-279;
bool r871551 = r871514 <= r871550;
double r871552 = r871517 / r871536;
double r871553 = r871530 - r871552;
double r871554 = -8.469488176137304e-290;
bool r871555 = r871514 <= r871554;
double r871556 = r871528 * r871514;
double r871557 = r871556 + r871531;
double r871558 = r871517 * r871523;
double r871559 = r871557 - r871558;
double r871560 = r871533 / r871521;
double r871561 = r871559 * r871560;
double r871562 = 1.829058436943914e-282;
bool r871563 = r871514 <= r871562;
double r871564 = r871530 * r871517;
double r871565 = fma(r871530, r871519, r871564);
double r871566 = fma(r871514, r871517, r871565);
double r871567 = r871566 / r871533;
double r871568 = r871567 / r871521;
double r871569 = r871568 - r871524;
double r871570 = 5.143885661764243e-183;
bool r871571 = r871514 <= r871570;
double r871572 = 1.124815810617408e-25;
bool r871573 = r871514 <= r871572;
double r871574 = 4.4486139245971244e+27;
bool r871575 = r871514 <= r871574;
double r871576 = 1.0740017768696439e+86;
bool r871577 = r871514 <= r871576;
double r871578 = r871577 ? r871539 : r871525;
double r871579 = r871575 ? r871542 : r871578;
double r871580 = r871573 ? r871549 : r871579;
double r871581 = r871571 ? r871542 : r871580;
double r871582 = r871563 ? r871569 : r871581;
double r871583 = r871555 ? r871561 : r871582;
double r871584 = r871551 ? r871553 : r871583;
double r871585 = r871544 ? r871549 : r871584;
double r871586 = r871541 ? r871542 : r871585;
double r871587 = r871527 ? r871539 : r871586;
double r871588 = r871516 ? r871525 : r871587;
return r871588;
}




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.1 |
| Herbie | 20.4 |
if z < -6.376626012784567e+136 or 1.0740017768696439e+86 < z Initial program 39.4
rmApplied div-sub39.4
Simplified39.4
rmApplied associate-/l*39.7
rmApplied associate-/r/38.8
Taylor expanded around inf 24.4
if -6.376626012784567e+136 < z < -7.5553554336738665e-50 or 4.4486139245971244e+27 < z < 1.0740017768696439e+86Initial program 24.2
rmApplied div-sub24.2
Simplified24.2
rmApplied associate-/l*21.5
rmApplied clear-num21.5
if -7.5553554336738665e-50 < z < -1.442052623539858e-96 or 1.829058436943914e-282 < z < 5.143885661764243e-183 or 1.124815810617408e-25 < z < 4.4486139245971244e+27Initial program 19.1
rmApplied div-sub19.1
Simplified19.1
rmApplied associate-/l*16.5
rmApplied associate-/r/14.8
Taylor expanded around 0 21.8
if -1.442052623539858e-96 < z < -5.2560627363695754e-198 or 5.143885661764243e-183 < z < 1.124815810617408e-25Initial program 17.7
rmApplied div-sub17.7
Simplified17.7
rmApplied associate-/l*14.1
rmApplied associate-/r/13.0
rmApplied *-un-lft-identity13.0
Applied add-cube-cbrt13.6
Applied times-frac13.6
Simplified13.6
Simplified13.6
if -5.2560627363695754e-198 < z < -3.0011721532957425e-279Initial program 20.2
rmApplied div-sub20.1
Simplified20.1
rmApplied associate-/l*16.2
Taylor expanded around 0 18.7
if -3.0011721532957425e-279 < z < -8.469488176137304e-290Initial program 17.9
rmApplied div-inv17.9
if -8.469488176137304e-290 < z < 1.829058436943914e-282Initial program 18.4
rmApplied div-sub18.3
Simplified18.3
rmApplied associate-/l*15.2
rmApplied associate-/r/13.4
Taylor expanded around inf 15.8
Simplified15.8
Final simplification20.4
herbie shell --seed 2020036 +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)))