\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 2.863127537388668377708285559713689578666 \cdot 10^{195}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\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 r605335 = x;
double r605336 = y;
double r605337 = r605335 + r605336;
double r605338 = z;
double r605339 = r605337 * r605338;
double r605340 = t;
double r605341 = r605340 + r605336;
double r605342 = a;
double r605343 = r605341 * r605342;
double r605344 = r605339 + r605343;
double r605345 = b;
double r605346 = r605336 * r605345;
double r605347 = r605344 - r605346;
double r605348 = r605335 + r605340;
double r605349 = r605348 + r605336;
double r605350 = r605347 / r605349;
return r605350;
}
double f(double x, double y, double z, double t, double a, double b) {
double r605351 = x;
double r605352 = y;
double r605353 = r605351 + r605352;
double r605354 = z;
double r605355 = r605353 * r605354;
double r605356 = t;
double r605357 = r605356 + r605352;
double r605358 = a;
double r605359 = r605357 * r605358;
double r605360 = r605355 + r605359;
double r605361 = b;
double r605362 = r605352 * r605361;
double r605363 = r605360 - r605362;
double r605364 = r605351 + r605356;
double r605365 = r605364 + r605352;
double r605366 = r605363 / r605365;
double r605367 = -inf.0;
bool r605368 = r605366 <= r605367;
double r605369 = 2.8631275373886684e+195;
bool r605370 = r605366 <= r605369;
double r605371 = !r605370;
bool r605372 = r605368 || r605371;
double r605373 = r605358 + r605354;
double r605374 = r605373 - r605361;
double r605375 = r605372 ? r605374 : r605366;
return r605375;
}




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.8 |
|---|---|
| Target | 11.4 |
| Herbie | 8.0 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 2.8631275373886684e+195 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 59.1
rmApplied clear-num59.1
Taylor expanded around 0 17.4
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 2.8631275373886684e+195Initial program 0.4
Final simplification8.0
herbie shell --seed 2019291
(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.5813117084150564e153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e82) (/ 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)))