\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}\;x \leq -7.641226480775408 \cdot 10^{+152}:\\
\;\;\;\;z - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{elif}\;x \leq -1.8247044229002758 \cdot 10^{-63}:\\
\;\;\;\;\frac{1}{\frac{x + \left(y + t\right)}{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}}\\
\mathbf{elif}\;x \leq -8.356989394689423 \cdot 10^{-155}:\\
\;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{elif}\;x \leq 4.7718969032047944 \cdot 10^{-259}:\\
\;\;\;\;\frac{1}{\frac{x + \left(y + t\right)}{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}}\\
\mathbf{elif}\;x \leq 4.42050953563121 \cdot 10^{-70}:\\
\;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{elif}\;x \leq 1.3074456987728244 \cdot 10^{+23} \lor \neg \left(x \leq 5.097253656774694 \cdot 10^{+222}\right) \land x \leq 2.6713640281165073 \cdot 10^{+251}:\\
\;\;\;\;\left(\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;z - y \cdot \frac{b}{x + \left(y + t\right)}\\
\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 (<= x -7.641226480775408e+152)
(- z (* y (/ b (+ x (+ y t)))))
(if (<= x -1.8247044229002758e-63)
(/ 1.0 (/ (+ x (+ y t)) (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b))))
(if (<= x -8.356989394689423e-155)
(- a (* y (/ b (+ x (+ y t)))))
(if (<= x 4.7718969032047944e-259)
(/ 1.0 (/ (+ x (+ y t)) (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b))))
(if (<= x 4.42050953563121e-70)
(- a (* y (/ b (+ x (+ y t)))))
(if (or (<= x 1.3074456987728244e+23)
(and (not (<= x 5.097253656774694e+222))
(<= x 2.6713640281165073e+251)))
(*
(- (+ (* z (+ x y)) (* (+ y t) a)) (* y b))
(/ 1.0 (+ x (+ y t))))
(- z (* y (/ b (+ x (+ y t))))))))))))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 tmp;
if (x <= -7.641226480775408e+152) {
tmp = z - (y * (b / (x + (y + t))));
} else if (x <= -1.8247044229002758e-63) {
tmp = 1.0 / ((x + (y + t)) / (((z * (x + y)) + ((y + t) * a)) - (y * b)));
} else if (x <= -8.356989394689423e-155) {
tmp = a - (y * (b / (x + (y + t))));
} else if (x <= 4.7718969032047944e-259) {
tmp = 1.0 / ((x + (y + t)) / (((z * (x + y)) + ((y + t) * a)) - (y * b)));
} else if (x <= 4.42050953563121e-70) {
tmp = a - (y * (b / (x + (y + t))));
} else if ((x <= 1.3074456987728244e+23) || (!(x <= 5.097253656774694e+222) && (x <= 2.6713640281165073e+251))) {
tmp = (((z * (x + y)) + ((y + t) * a)) - (y * b)) * (1.0 / (x + (y + t)));
} else {
tmp = z - (y * (b / (x + (y + t))));
}
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.3 |
|---|---|
| Target | 11.2 |
| Herbie | 22.6 |
if x < -7.6412264807754081e152 or 1.30744569877282435e23 < x < 5.09725365677469421e222 or 2.6713640281165073e251 < x Initial program 32.5
rmApplied div-sub_binary6432.5
Simplified32.5
Simplified32.5
rmApplied *-un-lft-identity_binary6432.5
Applied times-frac_binary6429.6
Simplified29.6
Taylor expanded around inf 22.8
if -7.6412264807754081e152 < x < -1.82470442290027577e-63 or -8.356989394689423e-155 < x < 4.7718969032047944e-259Initial program 23.2
rmApplied clear-num_binary6423.3
Simplified23.3
if -1.82470442290027577e-63 < x < -8.356989394689423e-155 or 4.7718969032047944e-259 < x < 4.4205095356312101e-70Initial program 22.4
rmApplied div-sub_binary6422.4
Simplified22.4
Simplified22.4
rmApplied *-un-lft-identity_binary6422.4
Applied times-frac_binary6422.0
Simplified22.0
Taylor expanded around 0 20.7
if 4.4205095356312101e-70 < x < 1.30744569877282435e23 or 5.09725365677469421e222 < x < 2.6713640281165073e251Initial program 24.0
rmApplied div-inv_binary6424.1
Simplified24.1
Final simplification22.6
herbie shell --seed 2020219
(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)))