\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:\\
\;\;\;\;z\\
\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 3.00011947244809546 \cdot 10^{241}:\\
\;\;\;\;\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\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r873210 = x;
double r873211 = y;
double r873212 = r873210 + r873211;
double r873213 = z;
double r873214 = r873212 * r873213;
double r873215 = t;
double r873216 = r873215 + r873211;
double r873217 = a;
double r873218 = r873216 * r873217;
double r873219 = r873214 + r873218;
double r873220 = b;
double r873221 = r873211 * r873220;
double r873222 = r873219 - r873221;
double r873223 = r873210 + r873215;
double r873224 = r873223 + r873211;
double r873225 = r873222 / r873224;
return r873225;
}
double f(double x, double y, double z, double t, double a, double b) {
double r873226 = x;
double r873227 = y;
double r873228 = r873226 + r873227;
double r873229 = z;
double r873230 = r873228 * r873229;
double r873231 = t;
double r873232 = r873231 + r873227;
double r873233 = a;
double r873234 = r873232 * r873233;
double r873235 = r873230 + r873234;
double r873236 = b;
double r873237 = r873227 * r873236;
double r873238 = r873235 - r873237;
double r873239 = r873226 + r873231;
double r873240 = r873239 + r873227;
double r873241 = r873238 / r873240;
double r873242 = -inf.0;
bool r873243 = r873241 <= r873242;
double r873244 = 3.0001194724480955e+241;
bool r873245 = r873241 <= r873244;
double r873246 = 1.0;
double r873247 = r873246 / r873240;
double r873248 = r873238 * r873247;
double r873249 = r873245 ? r873248 : r873229;
double r873250 = r873243 ? r873229 : r873249;
return r873250;
}




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 | 26.0 |
|---|---|
| Target | 11.3 |
| Herbie | 17.8 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 3.0001194724480955e+241 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 60.8
rmApplied div-inv60.8
rmApplied *-un-lft-identity60.8
Applied associate-*l*60.8
Simplified60.8
Taylor expanded around inf 41.5
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 3.0001194724480955e+241Initial program 0.3
rmApplied div-inv0.4
Final simplification17.8
herbie shell --seed 2020045
(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)))