\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.788086194814728 \cdot 10^{+257}:\\
\;\;\;\;z + b \cdot \frac{-1}{\frac{y + \left(x + t\right)}{y}}\\
\mathbf{elif}\;y \leq -1.0435287910912604 \cdot 10^{+224}:\\
\;\;\;\;a - b \cdot \frac{y}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq -2.3432962437726123 \cdot 10^{+57} \lor \neg \left(y \leq 1.499046436222361 \cdot 10^{-23}\right):\\
\;\;\;\;z + b \cdot \frac{-1}{\frac{y + \left(x + t\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x + \left(y + t\right)}{z \cdot \left(y + x\right) + \left(t \cdot a + y \cdot \left(a - b\right)\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 (<= y -1.788086194814728e+257)
(+ z (* b (/ -1.0 (/ (+ y (+ x t)) y))))
(if (<= y -1.0435287910912604e+224)
(- a (* b (/ y (+ x (+ y t)))))
(if (or (<= y -2.3432962437726123e+57) (not (<= y 1.499046436222361e-23)))
(+ z (* b (/ -1.0 (/ (+ y (+ x t)) y))))
(/
1.0
(/ (+ x (+ y t)) (+ (* z (+ y x)) (+ (* t a) (* y (- a 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 ((y <= -1.788086194814728e+257)) {
tmp = ((double) (z + ((double) (b * (-1.0 / (((double) (y + ((double) (x + t)))) / y))))));
} else {
double tmp_1;
if ((y <= -1.0435287910912604e+224)) {
tmp_1 = ((double) (a - ((double) (b * (y / ((double) (x + ((double) (y + t)))))))));
} else {
double tmp_2;
if (((y <= -2.3432962437726123e+57) || !(y <= 1.499046436222361e-23))) {
tmp_2 = ((double) (z + ((double) (b * (-1.0 / (((double) (y + ((double) (x + t)))) / y))))));
} else {
tmp_2 = (1.0 / (((double) (x + ((double) (y + t)))) / ((double) (((double) (z * ((double) (y + x)))) + ((double) (((double) (t * a)) + ((double) (y * ((double) (a - b))))))))));
}
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.6 |
|---|---|
| Target | 11.5 |
| Herbie | 21.3 |
if y < -1.78808619481472796e257 or -1.0435287910912604e224 < y < -2.3432962437726123e57 or 1.4990464362223609e-23 < y Initial program Error: 38.0 bits
rmApplied div-subError: 38.0 bits
SimplifiedError: 38.0 bits
SimplifiedError: 31.8 bits
Taylor expanded around inf Error: 27.5 bits
rmApplied clear-numError: 27.6 bits
SimplifiedError: 27.6 bits
if -1.78808619481472796e257 < y < -1.0435287910912604e224Initial program Error: 49.6 bits
rmApplied div-subError: 49.6 bits
SimplifiedError: 49.6 bits
SimplifiedError: 38.0 bits
Taylor expanded around 0 Error: 22.2 bits
if -2.3432962437726123e57 < y < 1.4990464362223609e-23Initial program Error: 15.8 bits
rmApplied clear-numError: 15.9 bits
SimplifiedError: 15.9 bits
Final simplificationError: 21.3 bits
herbie shell --seed 2020204
(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)))