\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 r838996 = x;
double r838997 = y;
double r838998 = r838996 + r838997;
double r838999 = z;
double r839000 = r838998 * r838999;
double r839001 = t;
double r839002 = r839001 + r838997;
double r839003 = a;
double r839004 = r839002 * r839003;
double r839005 = r839000 + r839004;
double r839006 = b;
double r839007 = r838997 * r839006;
double r839008 = r839005 - r839007;
double r839009 = r838996 + r839001;
double r839010 = r839009 + r838997;
double r839011 = r839008 / r839010;
return r839011;
}
double f(double x, double y, double z, double t, double a, double b) {
double r839012 = z;
double r839013 = -3.0225981366843547e+182;
bool r839014 = r839012 <= r839013;
double r839015 = y;
double r839016 = x;
double r839017 = t;
double r839018 = r839016 + r839017;
double r839019 = r839018 + r839015;
double r839020 = r839015 / r839019;
double r839021 = 1.0;
double r839022 = b;
double r839023 = r839021 / r839022;
double r839024 = r839020 / r839023;
double r839025 = r839012 - r839024;
double r839026 = -6.580972394505658e-07;
bool r839027 = r839012 <= r839026;
double r839028 = r839016 + r839015;
double r839029 = r839017 + r839015;
double r839030 = a;
double r839031 = r839029 * r839030;
double r839032 = fma(r839028, r839012, r839031);
double r839033 = r839032 / r839021;
double r839034 = r839033 / r839019;
double r839035 = r839034 - r839024;
double r839036 = -5.561955879913683e-33;
bool r839037 = r839012 <= r839036;
double r839038 = r839019 / r839022;
double r839039 = r839015 / r839038;
double r839040 = r839030 - r839039;
double r839041 = 2.1883827135341942e-265;
bool r839042 = r839012 <= r839041;
double r839043 = 3.5312042503262674e-186;
bool r839044 = r839012 <= r839043;
double r839045 = 9.836792356441502e-126;
bool r839046 = r839012 <= r839045;
double r839047 = 7.56984045759666e-75;
bool r839048 = r839012 <= r839047;
double r839049 = 4.992279324067696e+56;
bool r839050 = r839012 <= r839049;
double r839051 = r839050 ? r839035 : r839025;
double r839052 = r839048 ? r839040 : r839051;
double r839053 = r839046 ? r839035 : r839052;
double r839054 = r839044 ? r839040 : r839053;
double r839055 = r839042 ? r839035 : r839054;
double r839056 = r839037 ? r839040 : r839055;
double r839057 = r839027 ? r839035 : r839056;
double r839058 = r839014 ? r839025 : r839057;
return r839058;
}




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)))