\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}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} = -\infty \lor \neg \left(\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le 1.3789470957892983 \cdot 10^{302}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r888796 = x;
double r888797 = y;
double r888798 = r888796 + r888797;
double r888799 = z;
double r888800 = r888798 * r888799;
double r888801 = t;
double r888802 = r888801 + r888797;
double r888803 = a;
double r888804 = r888802 * r888803;
double r888805 = r888800 + r888804;
double r888806 = b;
double r888807 = r888797 * r888806;
double r888808 = r888805 - r888807;
double r888809 = r888796 + r888801;
double r888810 = r888809 + r888797;
double r888811 = r888808 / r888810;
return r888811;
}
double f(double x, double y, double z, double t, double a, double b) {
double r888812 = x;
double r888813 = y;
double r888814 = r888812 + r888813;
double r888815 = z;
double r888816 = r888814 * r888815;
double r888817 = t;
double r888818 = r888817 + r888813;
double r888819 = a;
double r888820 = r888818 * r888819;
double r888821 = r888816 + r888820;
double r888822 = b;
double r888823 = r888813 * r888822;
double r888824 = r888821 - r888823;
double r888825 = r888812 + r888817;
double r888826 = r888825 + r888813;
double r888827 = r888824 / r888826;
double r888828 = -inf.0;
bool r888829 = r888827 <= r888828;
double r888830 = 1.3789470957892983e+302;
bool r888831 = r888827 <= r888830;
double r888832 = !r888831;
bool r888833 = r888829 || r888832;
double r888834 = r888819 + r888815;
double r888835 = r888834 - r888822;
double r888836 = r888833 ? r888835 : r888827;
return r888836;
}




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.4 |
|---|---|
| Target | 11.3 |
| Herbie | 7.5 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 1.3789470957892983e+302 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 63.8
rmApplied clear-num63.8
Taylor expanded around 0 17.9
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 1.3789470957892983e+302Initial program 0.3
rmApplied clear-num0.5
rmApplied div-inv0.6
Applied add-cube-cbrt0.6
Applied times-frac0.6
Simplified0.6
Simplified0.5
rmApplied associate-*l/0.3
Simplified0.3
Final simplification7.5
herbie shell --seed 2020047
(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 (/ (+ (+ 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)))