\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.376417511233807504954447860767241687645 \cdot 10^{123}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;y \le 8.886742017387841076993780424139264576187 \cdot 10^{-21}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\mathsf{fma}\left(a, t + y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}}\\
\mathbf{elif}\;y \le 154639980052450147762700288:\\
\;\;\;\;z\\
\mathbf{elif}\;y \le 15954454677582262648209180778915954688:\\
\;\;\;\;\mathsf{fma}\left(a, t + y, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right) \cdot \frac{1}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r499423 = x;
double r499424 = y;
double r499425 = r499423 + r499424;
double r499426 = z;
double r499427 = r499425 * r499426;
double r499428 = t;
double r499429 = r499428 + r499424;
double r499430 = a;
double r499431 = r499429 * r499430;
double r499432 = r499427 + r499431;
double r499433 = b;
double r499434 = r499424 * r499433;
double r499435 = r499432 - r499434;
double r499436 = r499423 + r499428;
double r499437 = r499436 + r499424;
double r499438 = r499435 / r499437;
return r499438;
}
double f(double x, double y, double z, double t, double a, double b) {
double r499439 = y;
double r499440 = -1.3764175112338075e+123;
bool r499441 = r499439 <= r499440;
double r499442 = a;
double r499443 = z;
double r499444 = r499442 + r499443;
double r499445 = b;
double r499446 = r499444 - r499445;
double r499447 = 8.886742017387841e-21;
bool r499448 = r499439 <= r499447;
double r499449 = 1.0;
double r499450 = x;
double r499451 = t;
double r499452 = r499450 + r499451;
double r499453 = r499452 + r499439;
double r499454 = r499451 + r499439;
double r499455 = r499443 - r499445;
double r499456 = r499439 * r499455;
double r499457 = fma(r499443, r499450, r499456);
double r499458 = fma(r499442, r499454, r499457);
double r499459 = r499453 / r499458;
double r499460 = r499449 / r499459;
double r499461 = 1.5463998005245015e+26;
bool r499462 = r499439 <= r499461;
double r499463 = 1.5954454677582263e+37;
bool r499464 = r499439 <= r499463;
double r499465 = fma(r499450, r499443, r499456);
double r499466 = fma(r499442, r499454, r499465);
double r499467 = r499449 / r499453;
double r499468 = r499466 * r499467;
double r499469 = r499464 ? r499468 : r499446;
double r499470 = r499462 ? r499443 : r499469;
double r499471 = r499448 ? r499460 : r499470;
double r499472 = r499441 ? r499446 : r499471;
return r499472;
}




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 | 17.4 |
if y < -1.3764175112338075e+123 or 1.5954454677582263e+37 < y Initial program 43.3
Simplified43.3
rmApplied add-cube-cbrt43.4
Applied add-cube-cbrt43.5
Applied prod-diff43.5
Applied distribute-lft-in43.5
Simplified43.4
Simplified43.4
rmApplied clear-num43.4
Simplified43.3
Taylor expanded around 0 14.6
if -1.3764175112338075e+123 < y < 8.886742017387841e-21Initial program 17.5
Simplified17.5
rmApplied add-cube-cbrt17.7
Applied add-cube-cbrt17.8
Applied prod-diff17.8
Applied distribute-lft-in17.8
Simplified17.6
Simplified17.6
rmApplied clear-num17.7
Simplified17.6
if 8.886742017387841e-21 < y < 1.5463998005245015e+26Initial program 16.9
Simplified16.9
Taylor expanded around 0 43.0
if 1.5463998005245015e+26 < y < 1.5954454677582263e+37Initial program 17.2
Simplified17.2
rmApplied div-inv17.3
Final simplification17.4
herbie shell --seed 2019304 +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.5813117084150564e153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e82) (/ 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)))