\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 -7.54604617832960005102079361542831870441 \cdot 10^{69}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;t \le -2.632278416537802118024728875798452017694 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right) \cdot \frac{1}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le -2.174335218912759403700187318955087136727 \cdot 10^{-161}:\\
\;\;\;\;z - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le -9.250829612163244108772702176335834099995 \cdot 10^{-285}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\mathsf{fma}\left(z, x + y, \mathsf{fma}\left(a, t, y \cdot \left(a - b\right)\right)\right)}}\\
\mathbf{elif}\;t \le 9.397456832359988907465683858953352290869 \cdot 10^{-87}:\\
\;\;\;\;z - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le 1.461133878385138783060255757669285121099 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right) \cdot \frac{1}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}\\
\mathbf{elif}\;t \le 1.496290467533260437541871475611451409569 \cdot 10^{94}:\\
\;\;\;\;z - y \cdot \frac{b}{\left(x + t\right) + y}\\
\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 r1047308 = x;
double r1047309 = y;
double r1047310 = r1047308 + r1047309;
double r1047311 = z;
double r1047312 = r1047310 * r1047311;
double r1047313 = t;
double r1047314 = r1047313 + r1047309;
double r1047315 = a;
double r1047316 = r1047314 * r1047315;
double r1047317 = r1047312 + r1047316;
double r1047318 = b;
double r1047319 = r1047309 * r1047318;
double r1047320 = r1047317 - r1047319;
double r1047321 = r1047308 + r1047313;
double r1047322 = r1047321 + r1047309;
double r1047323 = r1047320 / r1047322;
return r1047323;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1047324 = t;
double r1047325 = -7.5460461783296e+69;
bool r1047326 = r1047324 <= r1047325;
double r1047327 = a;
double r1047328 = y;
double r1047329 = x;
double r1047330 = r1047329 + r1047324;
double r1047331 = r1047330 + r1047328;
double r1047332 = b;
double r1047333 = r1047331 / r1047332;
double r1047334 = r1047328 / r1047333;
double r1047335 = r1047327 - r1047334;
double r1047336 = -2.632278416537802e-46;
bool r1047337 = r1047324 <= r1047336;
double r1047338 = r1047329 + r1047328;
double r1047339 = z;
double r1047340 = r1047324 + r1047328;
double r1047341 = r1047340 * r1047327;
double r1047342 = fma(r1047338, r1047339, r1047341);
double r1047343 = 1.0;
double r1047344 = r1047343 / r1047331;
double r1047345 = r1047342 * r1047344;
double r1047346 = r1047328 * r1047332;
double r1047347 = r1047346 / r1047331;
double r1047348 = r1047345 - r1047347;
double r1047349 = -2.1743352189127594e-161;
bool r1047350 = r1047324 <= r1047349;
double r1047351 = r1047332 / r1047331;
double r1047352 = r1047328 * r1047351;
double r1047353 = r1047339 - r1047352;
double r1047354 = -9.250829612163244e-285;
bool r1047355 = r1047324 <= r1047354;
double r1047356 = r1047327 - r1047332;
double r1047357 = r1047328 * r1047356;
double r1047358 = fma(r1047327, r1047324, r1047357);
double r1047359 = fma(r1047339, r1047338, r1047358);
double r1047360 = r1047331 / r1047359;
double r1047361 = r1047343 / r1047360;
double r1047362 = 9.397456832359989e-87;
bool r1047363 = r1047324 <= r1047362;
double r1047364 = 1.4611338783851388e-12;
bool r1047365 = r1047324 <= r1047364;
double r1047366 = 1.4962904675332604e+94;
bool r1047367 = r1047324 <= r1047366;
double r1047368 = r1047367 ? r1047353 : r1047335;
double r1047369 = r1047365 ? r1047348 : r1047368;
double r1047370 = r1047363 ? r1047353 : r1047369;
double r1047371 = r1047355 ? r1047361 : r1047370;
double r1047372 = r1047350 ? r1047353 : r1047371;
double r1047373 = r1047337 ? r1047348 : r1047372;
double r1047374 = r1047326 ? r1047335 : r1047373;
return r1047374;
}




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.6 |
| Herbie | 23.1 |
if t < -7.5460461783296e+69 or 1.4962904675332604e+94 < t Initial program 33.4
rmApplied div-sub33.4
Simplified33.4
rmApplied associate-/l*30.3
Taylor expanded around 0 23.5
if -7.5460461783296e+69 < t < -2.632278416537802e-46 or 9.397456832359989e-87 < t < 1.4611338783851388e-12Initial program 21.6
rmApplied div-sub21.6
Simplified21.6
rmApplied div-inv21.7
if -2.632278416537802e-46 < t < -2.1743352189127594e-161 or -9.250829612163244e-285 < t < 9.397456832359989e-87 or 1.4611338783851388e-12 < t < 1.4962904675332604e+94Initial program 22.6
rmApplied div-sub22.6
Simplified22.6
rmApplied *-un-lft-identity22.6
Applied times-frac21.6
Simplified21.6
Taylor expanded around inf 23.8
if -2.1743352189127594e-161 < t < -9.250829612163244e-285Initial program 20.7
rmApplied clear-num20.8
Simplified20.8
Final simplification23.1
herbie shell --seed 2019351 +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)))