\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 \lor \neg \left(\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.3789470957892983 \cdot 10^{302}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r882351 = x;
double r882352 = y;
double r882353 = r882351 + r882352;
double r882354 = z;
double r882355 = r882353 * r882354;
double r882356 = t;
double r882357 = r882356 + r882352;
double r882358 = a;
double r882359 = r882357 * r882358;
double r882360 = r882355 + r882359;
double r882361 = b;
double r882362 = r882352 * r882361;
double r882363 = r882360 - r882362;
double r882364 = r882351 + r882356;
double r882365 = r882364 + r882352;
double r882366 = r882363 / r882365;
return r882366;
}
double f(double x, double y, double z, double t, double a, double b) {
double r882367 = x;
double r882368 = y;
double r882369 = r882367 + r882368;
double r882370 = z;
double r882371 = r882369 * r882370;
double r882372 = t;
double r882373 = r882372 + r882368;
double r882374 = a;
double r882375 = r882373 * r882374;
double r882376 = r882371 + r882375;
double r882377 = b;
double r882378 = r882368 * r882377;
double r882379 = r882376 - r882378;
double r882380 = r882367 + r882372;
double r882381 = r882380 + r882368;
double r882382 = r882379 / r882381;
double r882383 = -inf.0;
bool r882384 = r882382 <= r882383;
double r882385 = 1.3789470957892983e+302;
bool r882386 = r882382 <= r882385;
double r882387 = !r882386;
bool r882388 = r882384 || r882387;
double r882389 = r882374 + r882370;
double r882390 = r882389 - r882377;
double r882391 = 1.0;
double r882392 = r882391 * r882382;
double r882393 = r882388 ? r882390 : r882392;
return r882393;
}




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.4 |
|---|---|
| Target | 11.3 |
| Herbie | 7.5 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 1.3789470957892983e+302 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 63.8
rmApplied clear-num63.8
Taylor expanded around 0 17.9
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 1.3789470957892983e+302Initial program 0.3
rmApplied clear-num0.5
rmApplied sub-neg0.5
rmApplied associate-/r/0.5
rmApplied *-un-lft-identity0.5
Applied associate-*l*0.5
Simplified0.3
Final simplification7.5
herbie shell --seed 2020047
(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)))