\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.8781444753116508 \cdot 10^{76}:\\
\;\;\;\;z - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;z \le -1.331450716195835 \cdot 10^{-231}:\\
\;\;\;\;\frac{\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 7.62480360204854082 \cdot 10^{-203}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 7.11326089674771819 \cdot 10^{108}:\\
\;\;\;\;\frac{\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{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 r570565 = x;
double r570566 = y;
double r570567 = r570565 + r570566;
double r570568 = z;
double r570569 = r570567 * r570568;
double r570570 = t;
double r570571 = r570570 + r570566;
double r570572 = a;
double r570573 = r570571 * r570572;
double r570574 = r570569 + r570573;
double r570575 = b;
double r570576 = r570566 * r570575;
double r570577 = r570574 - r570576;
double r570578 = r570565 + r570570;
double r570579 = r570578 + r570566;
double r570580 = r570577 / r570579;
return r570580;
}
double f(double x, double y, double z, double t, double a, double b) {
double r570581 = z;
double r570582 = -3.878144475311651e+76;
bool r570583 = r570581 <= r570582;
double r570584 = y;
double r570585 = x;
double r570586 = t;
double r570587 = r570585 + r570586;
double r570588 = r570587 + r570584;
double r570589 = r570584 / r570588;
double r570590 = b;
double r570591 = r570589 * r570590;
double r570592 = r570581 - r570591;
double r570593 = -1.331450716195835e-231;
bool r570594 = r570581 <= r570593;
double r570595 = r570585 + r570584;
double r570596 = r570586 + r570584;
double r570597 = a;
double r570598 = r570596 * r570597;
double r570599 = fma(r570595, r570581, r570598);
double r570600 = r570599 / r570588;
double r570601 = r570600 - r570591;
double r570602 = 7.624803602048541e-203;
bool r570603 = r570581 <= r570602;
double r570604 = r570588 / r570590;
double r570605 = r570584 / r570604;
double r570606 = r570597 - r570605;
double r570607 = 7.113260896747718e+108;
bool r570608 = r570581 <= r570607;
double r570609 = r570608 ? r570601 : r570592;
double r570610 = r570603 ? r570606 : r570609;
double r570611 = r570594 ? r570601 : r570610;
double r570612 = r570583 ? r570592 : r570611;
return r570612;
}




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.8 |
|---|---|
| Target | 11.3 |
| Herbie | 19.6 |
if z < -3.878144475311651e+76 or 7.113260896747718e+108 < z Initial program 40.4
rmApplied div-sub40.4
Simplified40.4
rmApplied associate-/l*40.5
rmApplied associate-/r/39.7
Taylor expanded around inf 25.4
if -3.878144475311651e+76 < z < -1.331450716195835e-231 or 7.624803602048541e-203 < z < 7.113260896747718e+108Initial program 20.3
rmApplied div-sub20.3
Simplified20.3
rmApplied associate-/l*16.6
rmApplied associate-/r/16.0
if -1.331450716195835e-231 < z < 7.624803602048541e-203Initial program 17.5
rmApplied div-sub17.5
Simplified17.5
rmApplied associate-/l*15.0
Taylor expanded around 0 18.3
Final simplification19.6
herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
: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.0 (/ (+ (+ 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)))