\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}\;a \le -7.12837458361738554 \cdot 10^{195}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \le -9.28547134870867658 \cdot 10^{124}:\\
\;\;\;\;z\\
\mathbf{elif}\;a \le -2.607767836228133 \cdot 10^{105}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \le 1.33433320957664826 \cdot 10^{227}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\mathsf{fma}\left(x, z, z \cdot y\right) + \left(\left(t + y\right) \cdot a - y \cdot b\right)}}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return (((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if ((a <= -7.128374583617386e+195)) {
VAR = a;
} else {
double VAR_1;
if ((a <= -9.285471348708677e+124)) {
VAR_1 = z;
} else {
double VAR_2;
if ((a <= -2.607767836228133e+105)) {
VAR_2 = a;
} else {
double VAR_3;
if ((a <= 1.3343332095766483e+227)) {
VAR_3 = (1.0 / (((x + t) + y) / (fma(x, z, (z * y)) + (((t + y) * a) - (y * b)))));
} else {
VAR_3 = a;
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 26.5 |
|---|---|
| Target | 11.5 |
| Herbie | 24.5 |
if a < -7.128374583617386e+195 or -9.285471348708677e+124 < a < -2.607767836228133e+105 or 1.3343332095766483e+227 < a Initial program 43.2
Taylor expanded around 0 27.0
if -7.128374583617386e+195 < a < -9.285471348708677e+124Initial program 35.5
Taylor expanded around inf 47.7
if -2.607767836228133e+105 < a < 1.3343332095766483e+227Initial program 22.2
rmApplied *-un-lft-identity22.2
Applied associate-*l*22.2
Simplified22.2
rmApplied clear-num22.3
Simplified22.3
Final simplification24.5
herbie shell --seed 2020078 +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)))