\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.9547543014469886 \cdot 10^{64}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;y \le 1.0064846682529531 \cdot 10^{68}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;z - y \cdot \frac{b}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r830131 = x;
double r830132 = y;
double r830133 = r830131 + r830132;
double r830134 = z;
double r830135 = r830133 * r830134;
double r830136 = t;
double r830137 = r830136 + r830132;
double r830138 = a;
double r830139 = r830137 * r830138;
double r830140 = r830135 + r830139;
double r830141 = b;
double r830142 = r830132 * r830141;
double r830143 = r830140 - r830142;
double r830144 = r830131 + r830136;
double r830145 = r830144 + r830132;
double r830146 = r830143 / r830145;
return r830146;
}
double f(double x, double y, double z, double t, double a, double b) {
double r830147 = y;
double r830148 = -1.9547543014469886e+64;
bool r830149 = r830147 <= r830148;
double r830150 = a;
double r830151 = b;
double r830152 = x;
double r830153 = t;
double r830154 = r830152 + r830153;
double r830155 = r830154 + r830147;
double r830156 = r830151 / r830155;
double r830157 = r830147 * r830156;
double r830158 = r830150 - r830157;
double r830159 = 1.0064846682529531e+68;
bool r830160 = r830147 <= r830159;
double r830161 = r830152 + r830147;
double r830162 = z;
double r830163 = r830161 * r830162;
double r830164 = r830153 + r830147;
double r830165 = r830164 * r830150;
double r830166 = r830163 + r830165;
double r830167 = r830147 * r830151;
double r830168 = r830166 - r830167;
double r830169 = 1.0;
double r830170 = r830169 / r830155;
double r830171 = r830168 * r830170;
double r830172 = r830162 - r830157;
double r830173 = r830160 ? r830171 : r830172;
double r830174 = r830149 ? r830158 : r830173;
return r830174;
}




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.1 |
|---|---|
| Target | 11.5 |
| Herbie | 20.8 |
if y < -1.9547543014469886e+64Initial program 43.2
rmApplied div-sub43.1
rmApplied *-un-lft-identity43.1
Applied times-frac36.0
Simplified36.0
Taylor expanded around 0 26.9
if -1.9547543014469886e+64 < y < 1.0064846682529531e+68Initial program 16.8
rmApplied div-inv16.9
if 1.0064846682529531e+68 < y Initial program 43.1
rmApplied div-sub43.1
rmApplied *-un-lft-identity43.1
Applied times-frac36.2
Simplified36.2
Taylor expanded around inf 26.8
Final simplification20.8
herbie shell --seed 2020021
(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)))