\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}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} = -\infty:\\
\;\;\;\;a\\
\mathbf{elif}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le 1.844992431635832879534054317188597285325 \cdot 10^{273}:\\
\;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + y\right) + t}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r577691 = x;
double r577692 = y;
double r577693 = r577691 + r577692;
double r577694 = z;
double r577695 = r577693 * r577694;
double r577696 = t;
double r577697 = r577696 + r577692;
double r577698 = a;
double r577699 = r577697 * r577698;
double r577700 = r577695 + r577699;
double r577701 = b;
double r577702 = r577692 * r577701;
double r577703 = r577700 - r577702;
double r577704 = r577691 + r577696;
double r577705 = r577704 + r577692;
double r577706 = r577703 / r577705;
return r577706;
}
double f(double x, double y, double z, double t, double a, double b) {
double r577707 = x;
double r577708 = y;
double r577709 = r577707 + r577708;
double r577710 = z;
double r577711 = r577709 * r577710;
double r577712 = t;
double r577713 = r577712 + r577708;
double r577714 = a;
double r577715 = r577713 * r577714;
double r577716 = r577711 + r577715;
double r577717 = b;
double r577718 = r577708 * r577717;
double r577719 = r577716 - r577718;
double r577720 = r577707 + r577712;
double r577721 = r577720 + r577708;
double r577722 = r577719 / r577721;
double r577723 = -inf.0;
bool r577724 = r577722 <= r577723;
double r577725 = 1.8449924316358329e+273;
bool r577726 = r577722 <= r577725;
double r577727 = 1.0;
double r577728 = r577709 + r577712;
double r577729 = r577727 / r577728;
double r577730 = r577719 * r577729;
double r577731 = r577726 ? r577730 : r577710;
double r577732 = r577724 ? r577714 : r577731;
return r577732;
}




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.2 |
|---|---|
| Target | 11.2 |
| Herbie | 17.6 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0Initial program 64.0
Taylor expanded around 0 39.3
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 1.8449924316358329e+273Initial program 0.3
rmApplied div-inv0.5
rmApplied clear-num0.5
Simplified0.5
if 1.8449924316358329e+273 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 62.6
Taylor expanded around inf 41.3
Final simplification17.6
herbie shell --seed 2019326
(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)))