\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}\;t \le -1.6986254320624221 \cdot 10^{168}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le -6.3905130963088939 \cdot 10^{97}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le -4.2813816300222497 \cdot 10^{92}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le -2.3344990110164508 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\left(x + t\right) + y}\right)\right) \cdot b\\
\mathbf{elif}\;t \le -2.103108494735924 \cdot 10^{-196}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le -3.0085102585021934 \cdot 10^{-276}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}} - \frac{y}{\left(x + t\right) + y} \cdot b\\
\mathbf{elif}\;t \le 1.6261331649776397 \cdot 10^{-101}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le 2.77683352002521313 \cdot 10^{150}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\left(x + t\right) + y}\right)\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r1192236 = x;
double r1192237 = y;
double r1192238 = r1192236 + r1192237;
double r1192239 = z;
double r1192240 = r1192238 * r1192239;
double r1192241 = t;
double r1192242 = r1192241 + r1192237;
double r1192243 = a;
double r1192244 = r1192242 * r1192243;
double r1192245 = r1192240 + r1192244;
double r1192246 = b;
double r1192247 = r1192237 * r1192246;
double r1192248 = r1192245 - r1192247;
double r1192249 = r1192236 + r1192241;
double r1192250 = r1192249 + r1192237;
double r1192251 = r1192248 / r1192250;
return r1192251;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1192252 = t;
double r1192253 = -1.6986254320624221e+168;
bool r1192254 = r1192252 <= r1192253;
double r1192255 = a;
double r1192256 = y;
double r1192257 = x;
double r1192258 = r1192257 + r1192252;
double r1192259 = r1192258 + r1192256;
double r1192260 = b;
double r1192261 = r1192259 / r1192260;
double r1192262 = r1192256 / r1192261;
double r1192263 = r1192255 - r1192262;
double r1192264 = -6.390513096308894e+97;
bool r1192265 = r1192252 <= r1192264;
double r1192266 = z;
double r1192267 = r1192266 - r1192262;
double r1192268 = -4.2813816300222497e+92;
bool r1192269 = r1192252 <= r1192268;
double r1192270 = -2.334499011016451e-75;
bool r1192271 = r1192252 <= r1192270;
double r1192272 = r1192257 + r1192256;
double r1192273 = r1192252 + r1192256;
double r1192274 = r1192273 * r1192255;
double r1192275 = fma(r1192272, r1192266, r1192274);
double r1192276 = 1.0;
double r1192277 = r1192275 / r1192276;
double r1192278 = r1192277 / r1192259;
double r1192279 = r1192256 / r1192259;
double r1192280 = log1p(r1192279);
double r1192281 = expm1(r1192280);
double r1192282 = r1192281 * r1192260;
double r1192283 = r1192278 - r1192282;
double r1192284 = -2.103108494735924e-196;
bool r1192285 = r1192252 <= r1192284;
double r1192286 = -3.0085102585021934e-276;
bool r1192287 = r1192252 <= r1192286;
double r1192288 = r1192259 / r1192275;
double r1192289 = r1192276 / r1192288;
double r1192290 = r1192279 * r1192260;
double r1192291 = r1192289 - r1192290;
double r1192292 = 1.6261331649776397e-101;
bool r1192293 = r1192252 <= r1192292;
double r1192294 = 2.776833520025213e+150;
bool r1192295 = r1192252 <= r1192294;
double r1192296 = r1192295 ? r1192283 : r1192263;
double r1192297 = r1192293 ? r1192267 : r1192296;
double r1192298 = r1192287 ? r1192291 : r1192297;
double r1192299 = r1192285 ? r1192267 : r1192298;
double r1192300 = r1192271 ? r1192283 : r1192299;
double r1192301 = r1192269 ? r1192263 : r1192300;
double r1192302 = r1192265 ? r1192267 : r1192301;
double r1192303 = r1192254 ? r1192263 : r1192302;
return r1192303;
}




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.5 |
| Herbie | 21.7 |
if t < -1.6986254320624221e+168 or -6.390513096308894e+97 < t < -4.2813816300222497e+92 or 2.776833520025213e+150 < t Initial program 35.3
rmApplied div-sub35.3
Simplified35.3
rmApplied associate-/l*33.1
Taylor expanded around 0 21.3
if -1.6986254320624221e+168 < t < -6.390513096308894e+97 or -2.334499011016451e-75 < t < -2.103108494735924e-196 or -3.0085102585021934e-276 < t < 1.6261331649776397e-101Initial program 24.7
rmApplied div-sub24.7
Simplified24.7
rmApplied associate-/l*23.4
Taylor expanded around inf 23.8
if -4.2813816300222497e+92 < t < -2.334499011016451e-75 or 1.6261331649776397e-101 < t < 2.776833520025213e+150Initial program 23.9
rmApplied div-sub23.9
Simplified23.9
rmApplied associate-/l*20.3
rmApplied associate-/r/20.2
rmApplied expm1-log1p-u20.2
if -2.103108494735924e-196 < t < -3.0085102585021934e-276Initial program 24.5
rmApplied div-sub24.5
Simplified24.5
rmApplied associate-/l*22.7
rmApplied associate-/r/20.4
rmApplied clear-num20.4
Simplified20.4
Final simplification21.7
herbie shell --seed 2020025 +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)))