\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 \leq -1.392895250809098 \cdot 10^{+202} \lor \neg \left(y \leq 9.384766001373891 \cdot 10^{+133}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y \cdot a}{y + \left(t + x\right)} + \left(z \cdot \frac{x}{t + \left(y + x\right)} + \left(a \cdot \frac{t}{t + \left(y + x\right)} + \frac{y}{\sqrt[3]{y + \left(t + x\right)} \cdot \sqrt[3]{y + \left(t + x\right)}} \cdot \frac{z}{\sqrt[3]{y + \left(t + x\right)}}\right)\right)\right) - \frac{y \cdot b}{y + \left(t + x\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 (or (<= y -1.392895250809098e+202) (not (<= y 9.384766001373891e+133)))
(- (+ a z) b)
(-
(+
(/ (* y a) (+ y (+ t x)))
(+
(* z (/ x (+ t (+ y x))))
(+
(* a (/ t (+ t (+ y x))))
(*
(/ y (* (cbrt (+ y (+ t x))) (cbrt (+ y (+ t x)))))
(/ z (cbrt (+ y (+ t x))))))))
(/ (* y b) (+ y (+ t x))))))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 ((y <= -1.392895250809098e+202) || !(y <= 9.384766001373891e+133)) {
tmp = (a + z) - b;
} else {
tmp = (((y * a) / (y + (t + x))) + ((z * (x / (t + (y + x)))) + ((a * (t / (t + (y + x)))) + ((y / (cbrt(y + (t + x)) * cbrt(y + (t + x)))) * (z / cbrt(y + (t + x))))))) - ((y * b) / (y + (t + x)));
}
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.0 |
|---|---|
| Target | 11.1 |
| Herbie | 7.5 |
if y < -1.3928952508090981e202 or 9.3847660013738911e133 < y Initial program 49.7
Taylor expanded around inf 10.2
if -1.3928952508090981e202 < y < 9.3847660013738911e133Initial program 20.1
Taylor expanded around 0 20.1
Simplified20.1
rmApplied *-un-lft-identity_binary64_2463020.1
Applied times-frac_binary64_2463614.4
Simplified14.4
Simplified14.4
rmApplied *-un-lft-identity_binary64_2463014.4
Applied times-frac_binary64_246368.2
Simplified8.2
Simplified8.2
rmApplied add-cube-cbrt_binary64_246658.3
Applied times-frac_binary64_246366.7
Final simplification7.5
herbie shell --seed 2021043
(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)))