\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 -5.154331974388478 \cdot 10^{+155}:\\
\;\;\;\;a - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{elif}\;t \leq -1.4522351045742406 \cdot 10^{+51}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z + a \cdot \left(t + y\right)}{x + \left(t + y\right)} - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{elif}\;t \leq 2.4212981744305287 \cdot 10^{-236}:\\
\;\;\;\;z - \frac{y}{\frac{x + \left(t + y\right)}{b}}\\
\mathbf{elif}\;t \leq 5.663926007528674 \cdot 10^{+142}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z + a \cdot \left(t + y\right)}{x + \left(t + y\right)} - \frac{y}{x + \left(t + y\right)} \cdot b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y}{x + \left(t + y\right)} \cdot b\\
\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
(if (<= t -5.154331974388478e+155)
(- a (* (/ y (+ x (+ t y))) b))
(if (<= t -1.4522351045742406e+51)
(-
(/ (+ (* (+ y x) z) (* a (+ t y))) (+ x (+ t y)))
(* (/ y (+ x (+ t y))) b))
(if (<= t 2.4212981744305287e-236)
(- z (/ y (/ (+ x (+ t y)) b)))
(if (<= t 5.663926007528674e+142)
(-
(/ (+ (* (+ y x) z) (* a (+ t y))) (+ x (+ t y)))
(* (/ y (+ x (+ t y))) b))
(- a (* (/ y (+ x (+ t y))) b)))))))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 tmp;
if ((t <= -5.154331974388478e+155)) {
tmp = ((double) (a - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
double tmp_1;
if ((t <= -1.4522351045742406e+51)) {
tmp_1 = ((double) ((((double) (((double) (((double) (y + x)) * z)) + ((double) (a * ((double) (t + y)))))) / ((double) (x + ((double) (t + y))))) - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
double tmp_2;
if ((t <= 2.4212981744305287e-236)) {
tmp_2 = ((double) (z - (y / (((double) (x + ((double) (t + y)))) / b))));
} else {
double tmp_3;
if ((t <= 5.663926007528674e+142)) {
tmp_3 = ((double) ((((double) (((double) (((double) (y + x)) * z)) + ((double) (a * ((double) (t + y)))))) / ((double) (x + ((double) (t + y))))) - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
} else {
tmp_3 = ((double) (a - ((double) ((y / ((double) (x + ((double) (t + y))))) * b))));
}
tmp_2 = tmp_3;
}
tmp_1 = tmp_2;
}
tmp = tmp_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 | 26.2 |
|---|---|
| Target | 11.5 |
| Herbie | 21.3 |
if t < -5.1543319743884775e155 or 5.6639260075286743e142 < t Initial program 34.8
rmApplied div-sub_binary6434.8
Simplified34.8
Simplified34.8
rmApplied associate-/l*_binary6431.7
rmApplied associate-/r/_binary6431.9
Taylor expanded around 0 20.2
if -5.1543319743884775e155 < t < -1.45223510457424062e51 or 2.42129817443052866e-236 < t < 5.6639260075286743e142Initial program 24.2
rmApplied div-sub_binary6424.2
Simplified24.2
Simplified24.2
rmApplied associate-/l*_binary6422.1
rmApplied associate-/r/_binary6421.1
if -1.45223510457424062e51 < t < 2.42129817443052866e-236Initial program 22.1
rmApplied div-sub_binary6422.1
Simplified22.1
Simplified22.1
rmApplied associate-/l*_binary6420.6
Taylor expanded around inf 22.3
Final simplification21.3
herbie shell --seed 2020205
(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)))