\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}\;x \le -1.527978089724184 \cdot 10^{-170}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{1}{\frac{\left(x + t\right) + y}{y}} \cdot b\\
\mathbf{elif}\;x \le 4.9245467165626399 \cdot 10^{-78}:\\
\;\;\;\;a - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;x \le 5.5676276924920386 \cdot 10^{182}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{1}{\frac{\left(x + t\right) + y}{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 r831608 = x;
double r831609 = y;
double r831610 = r831608 + r831609;
double r831611 = z;
double r831612 = r831610 * r831611;
double r831613 = t;
double r831614 = r831613 + r831609;
double r831615 = a;
double r831616 = r831614 * r831615;
double r831617 = r831612 + r831616;
double r831618 = b;
double r831619 = r831609 * r831618;
double r831620 = r831617 - r831619;
double r831621 = r831608 + r831613;
double r831622 = r831621 + r831609;
double r831623 = r831620 / r831622;
return r831623;
}
double f(double x, double y, double z, double t, double a, double b) {
double r831624 = x;
double r831625 = -1.527978089724184e-170;
bool r831626 = r831624 <= r831625;
double r831627 = y;
double r831628 = r831624 + r831627;
double r831629 = z;
double r831630 = r831628 * r831629;
double r831631 = t;
double r831632 = r831631 + r831627;
double r831633 = a;
double r831634 = r831632 * r831633;
double r831635 = r831630 + r831634;
double r831636 = r831624 + r831631;
double r831637 = r831636 + r831627;
double r831638 = r831635 / r831637;
double r831639 = 1.0;
double r831640 = r831637 / r831627;
double r831641 = r831639 / r831640;
double r831642 = b;
double r831643 = r831641 * r831642;
double r831644 = r831638 - r831643;
double r831645 = 4.92454671656264e-78;
bool r831646 = r831624 <= r831645;
double r831647 = r831627 / r831637;
double r831648 = r831647 * r831642;
double r831649 = r831633 - r831648;
double r831650 = 5.567627692492039e+182;
bool r831651 = r831624 <= r831650;
double r831652 = r831629 - r831648;
double r831653 = r831651 ? r831644 : r831652;
double r831654 = r831646 ? r831649 : r831653;
double r831655 = r831626 ? r831644 : r831654;
return r831655;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 27.0 |
|---|---|
| Target | 11.6 |
| Herbie | 22.6 |
if x < -1.527978089724184e-170 or 4.92454671656264e-78 < x < 5.567627692492039e+182Initial program 27.8
rmApplied div-sub27.8
rmApplied associate-/l*25.3
rmApplied associate-/r/24.9
rmApplied clear-num25.0
if -1.527978089724184e-170 < x < 4.92454671656264e-78Initial program 21.3
rmApplied div-sub21.3
rmApplied associate-/l*20.2
rmApplied associate-/r/18.1
Taylor expanded around 0 19.0
if 5.567627692492039e+182 < x Initial program 38.8
rmApplied div-sub38.8
rmApplied associate-/l*36.0
rmApplied associate-/r/36.1
Taylor expanded around inf 19.6
Final simplification22.6
herbie shell --seed 2020081
(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)))