\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:\\
\;\;\;\;1 \cdot 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.5402997186520582 \cdot 10^{277}:\\
\;\;\;\;\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}:\\
\;\;\;\;1 \cdot a\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r770289 = x;
double r770290 = y;
double r770291 = r770289 + r770290;
double r770292 = z;
double r770293 = r770291 * r770292;
double r770294 = t;
double r770295 = r770294 + r770290;
double r770296 = a;
double r770297 = r770295 * r770296;
double r770298 = r770293 + r770297;
double r770299 = b;
double r770300 = r770290 * r770299;
double r770301 = r770298 - r770300;
double r770302 = r770289 + r770294;
double r770303 = r770302 + r770290;
double r770304 = r770301 / r770303;
return r770304;
}
double f(double x, double y, double z, double t, double a, double b) {
double r770305 = x;
double r770306 = y;
double r770307 = r770305 + r770306;
double r770308 = z;
double r770309 = r770307 * r770308;
double r770310 = t;
double r770311 = r770310 + r770306;
double r770312 = a;
double r770313 = r770311 * r770312;
double r770314 = r770309 + r770313;
double r770315 = b;
double r770316 = r770306 * r770315;
double r770317 = r770314 - r770316;
double r770318 = r770305 + r770310;
double r770319 = r770318 + r770306;
double r770320 = r770317 / r770319;
double r770321 = -inf.0;
bool r770322 = r770320 <= r770321;
double r770323 = 1.0;
double r770324 = r770323 * r770308;
double r770325 = 3.5402997186520582e+277;
bool r770326 = r770320 <= r770325;
double r770327 = r770323 / r770319;
double r770328 = r770317 * r770327;
double r770329 = r770323 * r770312;
double r770330 = r770326 ? r770328 : r770329;
double r770331 = r770322 ? r770324 : r770330;
return r770331;
}




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 | 17.9 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0Initial program 64.0
rmApplied div-inv64.0
rmApplied *-un-lft-identity64.0
Applied associate-*l*64.0
Simplified64.0
Taylor expanded around inf 40.1
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 3.5402997186520582e+277Initial program 0.3
rmApplied div-inv0.4
if 3.5402997186520582e+277 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 62.4
rmApplied div-inv62.4
rmApplied *-un-lft-identity62.4
Applied associate-*l*62.4
Simplified62.4
Taylor expanded around 0 42.2
Final simplification17.9
herbie shell --seed 2020046
(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)))