\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 -3.5923451958019774 \cdot 10^{+56}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;y \leq -1.5383444662198045 \cdot 10^{-99}:\\
\;\;\;\;\left(\frac{y \cdot a}{x + \left(y + t\right)} + \left(\frac{x}{\frac{x + \left(y + t\right)}{z}} + \left(\frac{t}{\frac{x + \left(y + t\right)}{a}} + \frac{y \cdot z}{x + \left(y + t\right)}\right)\right)\right) - \frac{y \cdot b}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq -5.98723732135947 \cdot 10^{-163}:\\
\;\;\;\;\frac{1}{\frac{x + \left(y + t\right)}{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}}\\
\mathbf{elif}\;y \leq 5.0281505230896065 \cdot 10^{+98}:\\
\;\;\;\;\left(\frac{y \cdot a}{x + \left(y + t\right)} + \left(\left(\frac{t}{\frac{x + \left(y + t\right)}{a}} + \frac{y \cdot z}{x + \left(y + t\right)}\right) + \frac{x}{\sqrt[3]{x + \left(y + t\right)} \cdot \sqrt[3]{x + \left(y + t\right)}} \cdot \frac{z}{\sqrt[3]{x + \left(y + t\right)}}\right)\right) - \frac{y \cdot b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - 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 (<= y -3.5923451958019774e+56)
(- (+ z a) b)
(if (<= y -1.5383444662198045e-99)
(-
(+
(/ (* y a) (+ x (+ y t)))
(+
(/ x (/ (+ x (+ y t)) z))
(+ (/ t (/ (+ x (+ y t)) a)) (/ (* y z) (+ x (+ y t))))))
(/ (* y b) (+ x (+ y t))))
(if (<= y -5.98723732135947e-163)
(/ 1.0 (/ (+ x (+ y t)) (- (+ (* z (+ y x)) (* a (+ y t))) (* y b))))
(if (<= y 5.0281505230896065e+98)
(-
(+
(/ (* y a) (+ x (+ y t)))
(+
(+ (/ t (/ (+ x (+ y t)) a)) (/ (* y z) (+ x (+ y t))))
(*
(/ x (* (cbrt (+ x (+ y t))) (cbrt (+ x (+ y t)))))
(/ z (cbrt (+ x (+ y t)))))))
(/ (* y b) (+ x (+ y t))))
(- (+ z a) b))))))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 <= -3.5923451958019774e+56) {
tmp = (z + a) - b;
} else if (y <= -1.5383444662198045e-99) {
tmp = (((y * a) / (x + (y + t))) + ((x / ((x + (y + t)) / z)) + ((t / ((x + (y + t)) / a)) + ((y * z) / (x + (y + t)))))) - ((y * b) / (x + (y + t)));
} else if (y <= -5.98723732135947e-163) {
tmp = 1.0 / ((x + (y + t)) / (((z * (y + x)) + (a * (y + t))) - (y * b)));
} else if (y <= 5.0281505230896065e+98) {
tmp = (((y * a) / (x + (y + t))) + (((t / ((x + (y + t)) / a)) + ((y * z) / (x + (y + t)))) + ((x / (cbrt(x + (y + t)) * cbrt(x + (y + t)))) * (z / cbrt(x + (y + t)))))) - ((y * b) / (x + (y + t)));
} else {
tmp = (z + a) - b;
}
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.9 |
|---|---|
| Target | 11.4 |
| Herbie | 10.5 |
if y < -3.59234519580197738e56 or 5.0281505230896065e98 < y Initial program 43.0
Taylor expanded around inf 14.0
Simplified14.0
if -3.59234519580197738e56 < y < -1.53834446621980454e-99Initial program 18.6
Taylor expanded around 0 18.6
Simplified18.6
rmApplied associate-/l*_binary64_2048314.4
rmApplied associate-/l*_binary64_204837.5
if -1.53834446621980454e-99 < y < -5.98723732135947004e-163Initial program 14.8
rmApplied clear-num_binary64_2053714.9
Simplified14.9
if -5.98723732135947004e-163 < y < 5.0281505230896065e98Initial program 17.0
Taylor expanded around 0 17.0
Simplified17.0
rmApplied associate-/l*_binary64_2048314.3
rmApplied add-cube-cbrt_binary64_2057314.6
Applied times-frac_binary64_205447.9
Final simplification10.5
herbie shell --seed 2021007
(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)))