\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}\;z \le -3.022598136684354663412245344550126028397 \cdot 10^{182}:\\
\;\;\;\;z - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le -6.58097239450565769445350948474438013136 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le -5.561955879913683304630071073532749837049 \cdot 10^{-33}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 2.188382713534194168391592823268801705419 \cdot 10^{-265}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le 3.531204250326267435165734577025015017466 \cdot 10^{-186}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 9.836792356441501745440262935078248892751 \cdot 10^{-126}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{elif}\;z \le 7.569840457596660380072714567516066108349 \cdot 10^{-75}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;z \le 4.992279324067695797541286300663075135612 \cdot 10^{56}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\mathbf{else}:\\
\;\;\;\;z - \frac{\frac{y}{\left(x + t\right) + y}}{\frac{1}{b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r800229 = x;
double r800230 = y;
double r800231 = r800229 + r800230;
double r800232 = z;
double r800233 = r800231 * r800232;
double r800234 = t;
double r800235 = r800234 + r800230;
double r800236 = a;
double r800237 = r800235 * r800236;
double r800238 = r800233 + r800237;
double r800239 = b;
double r800240 = r800230 * r800239;
double r800241 = r800238 - r800240;
double r800242 = r800229 + r800234;
double r800243 = r800242 + r800230;
double r800244 = r800241 / r800243;
return r800244;
}
double f(double x, double y, double z, double t, double a, double b) {
double r800245 = z;
double r800246 = -3.0225981366843547e+182;
bool r800247 = r800245 <= r800246;
double r800248 = y;
double r800249 = x;
double r800250 = t;
double r800251 = r800249 + r800250;
double r800252 = r800251 + r800248;
double r800253 = r800248 / r800252;
double r800254 = 1.0;
double r800255 = b;
double r800256 = r800254 / r800255;
double r800257 = r800253 / r800256;
double r800258 = r800245 - r800257;
double r800259 = -6.580972394505658e-07;
bool r800260 = r800245 <= r800259;
double r800261 = r800249 + r800248;
double r800262 = r800250 + r800248;
double r800263 = a;
double r800264 = r800262 * r800263;
double r800265 = fma(r800261, r800245, r800264);
double r800266 = r800265 / r800254;
double r800267 = r800266 / r800252;
double r800268 = r800267 - r800257;
double r800269 = -5.561955879913683e-33;
bool r800270 = r800245 <= r800269;
double r800271 = r800252 / r800255;
double r800272 = r800248 / r800271;
double r800273 = r800263 - r800272;
double r800274 = 2.1883827135341942e-265;
bool r800275 = r800245 <= r800274;
double r800276 = 3.5312042503262674e-186;
bool r800277 = r800245 <= r800276;
double r800278 = 9.836792356441502e-126;
bool r800279 = r800245 <= r800278;
double r800280 = 7.56984045759666e-75;
bool r800281 = r800245 <= r800280;
double r800282 = 4.992279324067696e+56;
bool r800283 = r800245 <= r800282;
double r800284 = r800283 ? r800268 : r800258;
double r800285 = r800281 ? r800273 : r800284;
double r800286 = r800279 ? r800268 : r800285;
double r800287 = r800277 ? r800273 : r800286;
double r800288 = r800275 ? r800268 : r800287;
double r800289 = r800270 ? r800273 : r800288;
double r800290 = r800260 ? r800268 : r800289;
double r800291 = r800247 ? r800258 : r800290;
return r800291;
}




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 | 27.0 |
|---|---|
| Target | 11.3 |
| Herbie | 20.3 |
if z < -3.0225981366843547e+182 or 4.992279324067696e+56 < z Initial program 40.3
rmApplied div-sub40.3
Simplified40.3
rmApplied associate-/l*40.4
rmApplied div-inv40.4
Applied associate-/r*39.6
Taylor expanded around inf 25.0
if -3.0225981366843547e+182 < z < -6.580972394505658e-07 or -5.561955879913683e-33 < z < 2.1883827135341942e-265 or 3.5312042503262674e-186 < z < 9.836792356441502e-126 or 7.56984045759666e-75 < z < 4.992279324067696e+56Initial program 21.4
rmApplied div-sub21.4
Simplified21.4
rmApplied associate-/l*18.2
rmApplied div-inv18.3
Applied associate-/r*17.6
if -6.580972394505658e-07 < z < -5.561955879913683e-33 or 2.1883827135341942e-265 < z < 3.5312042503262674e-186 or 9.836792356441502e-126 < z < 7.56984045759666e-75Initial program 20.2
rmApplied div-sub20.2
Simplified20.2
rmApplied associate-/l*16.1
Taylor expanded around 0 21.0
Final simplification20.3
herbie shell --seed 2020001 +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)))