\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 \leq -6.91578830349726 \cdot 10^{+35}:\\
\;\;\;\;a - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{elif}\;t \leq -1.8141453022121192 \cdot 10^{-201}:\\
\;\;\;\;\frac{1}{\frac{x + \left(t + y\right)}{\left(y + x\right) \cdot z + \left(t \cdot a + y \cdot \left(a - b\right)\right)}}\\
\mathbf{elif}\;t \leq 1.4608526545304822 \cdot 10^{-170}:\\
\;\;\;\;z - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{elif}\;t \leq 9.042614339967227 \cdot 10^{-130}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z + a \cdot \left(t + y\right)}{x + \left(t + y\right)} - y \cdot \frac{b}{x + \left(t + y\right)}\\
\mathbf{elif}\;t \leq 4.2757245011570004 \cdot 10^{-85}:\\
\;\;\;\;z - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{elif}\;t \leq 1.7871583142091725 \cdot 10^{+19}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z + a \cdot \left(t + y\right)}{x + \left(t + y\right)} - y \cdot \frac{b}{x + \left(t + y\right)}\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y}{x + \left(t + y\right)} \cdot b\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) - ((double) (y * b)))) / ((double) (((double) (x + t)) + y)));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if ((t <= -6.91578830349726e+35)) {
VAR = ((double) (a - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
double VAR_1;
if ((t <= -1.8141453022121192e-201)) {
VAR_1 = (1.0 / (((double) (x + ((double) (t + y)))) / ((double) (((double) (((double) (y + x)) * z)) + ((double) (((double) (t * a)) + ((double) (y * ((double) (a - b))))))))));
} else {
double VAR_2;
if ((t <= 1.4608526545304822e-170)) {
VAR_2 = ((double) (z - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
double VAR_3;
if ((t <= 9.042614339967227e-130)) {
VAR_3 = ((double) ((((double) (((double) (((double) (y + x)) * z)) + ((double) (a * ((double) (t + y)))))) / ((double) (x + ((double) (t + y))))) - ((double) (y * (b / ((double) (x + ((double) (t + y)))))))));
} else {
double VAR_4;
if ((t <= 4.2757245011570004e-85)) {
VAR_4 = ((double) (z - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
double VAR_5;
if ((t <= 1.7871583142091725e+19)) {
VAR_5 = ((double) ((((double) (((double) (((double) (y + x)) * z)) + ((double) (a * ((double) (t + y)))))) / ((double) (x + ((double) (t + y))))) - ((double) (y * (b / ((double) (x + ((double) (t + y)))))))));
} else {
VAR_5 = ((double) (a - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
}
VAR_4 = VAR_5;
}
VAR_3 = VAR_4;
}
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.8 |
|---|---|
| Target | 11.0 |
| Herbie | 22.0 |
if t < -6.91578830349725929e35 or 17871583142091724800 < t Initial program 31.8
rmApplied div-sub31.8
Simplified31.8
Simplified29.5
Taylor expanded around 0 24.7
if -6.91578830349725929e35 < t < -1.81414530221211921e-201Initial program 21.7
rmApplied clear-num21.8
Simplified21.8
if -1.81414530221211921e-201 < t < 1.4608526545304822e-170 or 9.04261433996722738e-130 < t < 4.27572450115700041e-85Initial program 23.2
rmApplied div-sub23.2
Simplified23.2
Simplified20.3
Taylor expanded around inf 17.9
if 1.4608526545304822e-170 < t < 9.04261433996722738e-130 or 4.27572450115700041e-85 < t < 17871583142091724800Initial program 22.4
rmApplied div-sub22.4
Simplified22.4
Simplified18.7
rmApplied div-inv18.7
Applied associate-*l*19.7
Simplified19.7
Final simplification22.0
herbie shell --seed 2020196
(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.0 (/ (+ (+ 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)))