\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.28364647930015676 \cdot 10^{60} \lor \neg \left(y \le -1.0932202536774648 \cdot 10^{-278} \lor \neg \left(y \le 2.1354481372959581 \cdot 10^{-289} \lor \neg \left(y \le 2.29423840239453002 \cdot 10^{-41}\right)\right)\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{\left(x + t\right) + y} + \frac{\mathsf{fma}\left(y, a - b, a \cdot t\right)}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r895250 = x;
double r895251 = y;
double r895252 = r895250 + r895251;
double r895253 = z;
double r895254 = r895252 * r895253;
double r895255 = t;
double r895256 = r895255 + r895251;
double r895257 = a;
double r895258 = r895256 * r895257;
double r895259 = r895254 + r895258;
double r895260 = b;
double r895261 = r895251 * r895260;
double r895262 = r895259 - r895261;
double r895263 = r895250 + r895255;
double r895264 = r895263 + r895251;
double r895265 = r895262 / r895264;
return r895265;
}
double f(double x, double y, double z, double t, double a, double b) {
double r895266 = y;
double r895267 = -1.2836464793001568e+60;
bool r895268 = r895266 <= r895267;
double r895269 = -1.0932202536774648e-278;
bool r895270 = r895266 <= r895269;
double r895271 = 2.135448137295958e-289;
bool r895272 = r895266 <= r895271;
double r895273 = 2.29423840239453e-41;
bool r895274 = r895266 <= r895273;
double r895275 = !r895274;
bool r895276 = r895272 || r895275;
double r895277 = !r895276;
bool r895278 = r895270 || r895277;
double r895279 = !r895278;
bool r895280 = r895268 || r895279;
double r895281 = a;
double r895282 = z;
double r895283 = r895281 + r895282;
double r895284 = b;
double r895285 = r895283 - r895284;
double r895286 = x;
double r895287 = r895286 + r895266;
double r895288 = r895282 * r895287;
double r895289 = t;
double r895290 = r895286 + r895289;
double r895291 = r895290 + r895266;
double r895292 = r895288 / r895291;
double r895293 = r895281 - r895284;
double r895294 = r895281 * r895289;
double r895295 = fma(r895266, r895293, r895294);
double r895296 = r895295 / r895291;
double r895297 = r895292 + r895296;
double r895298 = r895280 ? r895285 : r895297;
return r895298;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 26.3 |
|---|---|
| Target | 11.3 |
| Herbie | 17.9 |
if y < -1.2836464793001568e+60 or -1.0932202536774648e-278 < y < 2.135448137295958e-289 or 2.29423840239453e-41 < y Initial program 36.2
rmApplied pow136.2
rmApplied *-un-lft-identity36.2
Applied unpow-prod-down36.2
Applied associate-/l*36.3
Taylor expanded around 0 20.2
if -1.2836464793001568e+60 < y < -1.0932202536774648e-278 or 2.135448137295958e-289 < y < 2.29423840239453e-41Initial program 15.4
rmApplied pow115.4
rmApplied *-un-lft-identity15.4
Applied unpow-prod-down15.4
Applied associate-/l*15.4
rmApplied div-inv15.6
Applied add-sqr-sqrt15.6
Applied unpow-prod-down15.6
Applied times-frac15.5
Simplified15.5
Simplified15.4
rmApplied fma-udef15.4
Applied distribute-lft-in15.4
Simplified15.4
Simplified15.3
Final simplification17.9
herbie shell --seed 2020062 +o rules:numerics
(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)))