\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(t + y\right) \cdot a - y \cdot b\right) + \left(x + y\right) \cdot z}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r951834 = x;
double r951835 = y;
double r951836 = r951834 + r951835;
double r951837 = z;
double r951838 = r951836 * r951837;
double r951839 = t;
double r951840 = r951839 + r951835;
double r951841 = a;
double r951842 = r951840 * r951841;
double r951843 = r951838 + r951842;
double r951844 = b;
double r951845 = r951835 * r951844;
double r951846 = r951843 - r951845;
double r951847 = r951834 + r951839;
double r951848 = r951847 + r951835;
double r951849 = r951846 / r951848;
return r951849;
}
double f(double x, double y, double z, double t, double a, double b) {
double r951850 = x;
double r951851 = y;
double r951852 = r951850 + r951851;
double r951853 = z;
double r951854 = r951852 * r951853;
double r951855 = t;
double r951856 = r951855 + r951851;
double r951857 = a;
double r951858 = r951856 * r951857;
double r951859 = r951854 + r951858;
double r951860 = b;
double r951861 = r951851 * r951860;
double r951862 = r951859 - r951861;
double r951863 = r951850 + r951855;
double r951864 = r951863 + r951851;
double r951865 = r951862 / r951864;
double r951866 = -inf.0;
bool r951867 = r951865 <= r951866;
double r951868 = 1.3789470957892983e+302;
bool r951869 = r951865 <= r951868;
double r951870 = !r951869;
bool r951871 = r951867 || r951870;
double r951872 = r951857 + r951853;
double r951873 = r951872 - r951860;
double r951874 = r951858 - r951861;
double r951875 = r951874 + r951854;
double r951876 = r951875 / r951864;
double r951877 = r951871 ? r951873 : r951876;
return r951877;
}




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 inv-pow0.5
rmApplied div-inv0.6
Applied unpow-prod-down0.6
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied associate-*l*0.5
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)))