\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}\;y \le -1.0677618729601775 \cdot 10^{258}:\\
\;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \le -6821795244285730230000 \lor \neg \left(y \le 4.32234753106425839 \cdot 10^{-38} \lor \neg \left(y \le 2.8904966271832427 \cdot 10^{109}\right) \land y \le 1.8982219138742053 \cdot 10^{145}\right):\\
\;\;\;\;z - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b\right) \cdot \frac{1}{x + \left(y + t\right)}\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return ((double) (((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 ((y <= -1.0677618729601775e+258)) {
VAR = ((double) (a - ((double) (y * ((double) (b / ((double) (x + ((double) (y + t))))))))));
} else {
double VAR_1;
if (((y <= -6.82179524428573e+21) || !((y <= 4.3223475310642584e-38) || (!(y <= 2.8904966271832427e+109) && (y <= 1.8982219138742053e+145))))) {
VAR_1 = ((double) (z - ((double) (y * ((double) (b / ((double) (x + ((double) (y + t))))))))));
} else {
VAR_1 = ((double) (((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (a * ((double) (y + t)))))) - ((double) (y * b)))) * ((double) (1.0 / ((double) (x + ((double) (y + t))))))));
}
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.3 |
|---|---|
| Target | 11.0 |
| Herbie | 21.5 |
if y < -1.0677618729601775e258Initial program 54.0
rmApplied div-sub54.0
Simplified54.0
Simplified45.4
Taylor expanded around 0 22.1
if -1.0677618729601775e258 < y < -6821795244285730230000 or 4.32234753106425839e-38 < y < 2.8904966271832427e109 or 1.8982219138742053e145 < y Initial program 35.4
rmApplied div-sub35.4
Simplified35.4
Simplified29.8
Taylor expanded around inf 27.6
if -6821795244285730230000 < y < 4.32234753106425839e-38 or 2.8904966271832427e109 < y < 1.8982219138742053e145Initial program 16.0
rmApplied div-inv16.1
Simplified16.1
Final simplification21.5
herbie shell --seed 2020181
(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)))