\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 -3.11318533103244395 \cdot 10^{-288}:\\
\;\;\;\;\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(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 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 r958379 = x;
double r958380 = y;
double r958381 = r958379 + r958380;
double r958382 = z;
double r958383 = r958381 * r958382;
double r958384 = t;
double r958385 = r958384 + r958380;
double r958386 = a;
double r958387 = r958385 * r958386;
double r958388 = r958383 + r958387;
double r958389 = b;
double r958390 = r958380 * r958389;
double r958391 = r958388 - r958390;
double r958392 = r958379 + r958384;
double r958393 = r958392 + r958380;
double r958394 = r958391 / r958393;
return r958394;
}
double f(double x, double y, double z, double t, double a, double b) {
double r958395 = z;
double r958396 = -6.376626012784567e+136;
bool r958397 = r958395 <= r958396;
double r958398 = y;
double r958399 = x;
double r958400 = t;
double r958401 = r958399 + r958400;
double r958402 = r958401 + r958398;
double r958403 = r958398 / r958402;
double r958404 = b;
double r958405 = r958403 * r958404;
double r958406 = r958395 - r958405;
double r958407 = -7.5553554336738665e-50;
bool r958408 = r958395 <= r958407;
double r958409 = r958399 + r958398;
double r958410 = r958400 + r958398;
double r958411 = a;
double r958412 = r958410 * r958411;
double r958413 = fma(r958409, r958395, r958412);
double r958414 = 1.0;
double r958415 = r958413 / r958414;
double r958416 = r958415 / r958402;
double r958417 = r958402 / r958404;
double r958418 = r958417 / r958398;
double r958419 = r958414 / r958418;
double r958420 = r958416 - r958419;
double r958421 = -1.442052623539858e-96;
bool r958422 = r958395 <= r958421;
double r958423 = r958411 - r958405;
double r958424 = -5.2560627363695754e-198;
bool r958425 = r958395 <= r958424;
double r958426 = cbrt(r958413);
double r958427 = r958426 * r958426;
double r958428 = r958426 / r958402;
double r958429 = r958427 * r958428;
double r958430 = r958429 - r958405;
double r958431 = -3.0011721532957425e-279;
bool r958432 = r958395 <= r958431;
double r958433 = r958398 / r958417;
double r958434 = r958411 - r958433;
double r958435 = -3.113185331032444e-288;
bool r958436 = r958395 <= r958435;
double r958437 = r958409 * r958395;
double r958438 = r958437 + r958412;
double r958439 = r958398 * r958404;
double r958440 = r958438 - r958439;
double r958441 = r958414 / r958402;
double r958442 = r958440 * r958441;
double r958443 = 1.829058436943914e-282;
bool r958444 = r958395 <= r958443;
double r958445 = 5.143885661764243e-183;
bool r958446 = r958395 <= r958445;
double r958447 = 1.124815810617408e-25;
bool r958448 = r958395 <= r958447;
double r958449 = 4.4486139245971244e+27;
bool r958450 = r958395 <= r958449;
double r958451 = 1.0740017768696439e+86;
bool r958452 = r958395 <= r958451;
double r958453 = r958452 ? r958420 : r958406;
double r958454 = r958450 ? r958423 : r958453;
double r958455 = r958448 ? r958430 : r958454;
double r958456 = r958446 ? r958423 : r958455;
double r958457 = r958444 ? r958420 : r958456;
double r958458 = r958436 ? r958442 : r958457;
double r958459 = r958432 ? r958434 : r958458;
double r958460 = r958425 ? r958430 : r958459;
double r958461 = r958422 ? r958423 : r958460;
double r958462 = r958408 ? r958420 : r958461;
double r958463 = r958397 ? r958406 : r958462;
return r958463;
}




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 -3.113185331032444e-288 < z < 1.829058436943914e-282 or 4.4486139245971244e+27 < z < 1.0740017768696439e+86Initial program 23.1
rmApplied div-sub23.1
Simplified23.1
rmApplied associate-/l*20.4
rmApplied clear-num20.4
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 < -3.113185331032444e-288Initial program 19.4
rmApplied div-inv19.4
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)))