\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}
t_1 := y + \left(t + x\right)\\
\mathbf{if}\;y \leq -4.942401878015299 \cdot 10^{+169} \lor \neg \left(y \leq 5.335083905977998 \cdot 10^{+118}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y \cdot z}{t_1} + \left(z \cdot \frac{x}{t_1} + \left(\frac{a}{\frac{t_1}{t}} + \frac{y}{\frac{t_1}{a}}\right)\right)\right) - \frac{y \cdot b}{t_1}\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x))))
(if (or (<= y -4.942401878015299e+169) (not (<= y 5.335083905977998e+118)))
(- (+ a z) b)
(-
(+
(/ (* y z) t_1)
(+ (* z (/ x t_1)) (+ (/ a (/ t_1 t)) (/ y (/ t_1 a)))))
(/ (* y b) t_1)))))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 t_1 = y + (t + x);
double tmp;
if ((y <= -4.942401878015299e+169) || !(y <= 5.335083905977998e+118)) {
tmp = (a + z) - b;
} else {
tmp = (((y * z) / t_1) + ((z * (x / t_1)) + ((a / (t_1 / t)) + (y / (t_1 / a))))) - ((y * b) / t_1);
}
return tmp;
}




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 | 27.2 |
|---|---|
| Target | 11.0 |
| Herbie | 7.3 |
if y < -4.942401878015299e169 or 5.33508390597799842e118 < y Initial program 47.9
Simplified47.9
Taylor expanded in y around inf 10.7
if -4.942401878015299e169 < y < 5.33508390597799842e118Initial program 19.4
Simplified19.4
Taylor expanded in a around 0 19.4
Applied *-un-lft-identity_binary6419.4
Applied times-frac_binary6413.3
Simplified13.3
Simplified13.3
Applied associate-/l*_binary646.7
Simplified6.7
Applied associate-/l*_binary646.0
Simplified6.0
Final simplification7.3
herbie shell --seed 2022160
(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)))