\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 3.8381343719672391 \cdot 10^{237}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r812777 = x;
double r812778 = y;
double r812779 = r812777 + r812778;
double r812780 = z;
double r812781 = r812779 * r812780;
double r812782 = t;
double r812783 = r812782 + r812778;
double r812784 = a;
double r812785 = r812783 * r812784;
double r812786 = r812781 + r812785;
double r812787 = b;
double r812788 = r812778 * r812787;
double r812789 = r812786 - r812788;
double r812790 = r812777 + r812782;
double r812791 = r812790 + r812778;
double r812792 = r812789 / r812791;
return r812792;
}
double f(double x, double y, double z, double t, double a, double b) {
double r812793 = x;
double r812794 = y;
double r812795 = r812793 + r812794;
double r812796 = z;
double r812797 = r812795 * r812796;
double r812798 = t;
double r812799 = r812798 + r812794;
double r812800 = a;
double r812801 = r812799 * r812800;
double r812802 = r812797 + r812801;
double r812803 = b;
double r812804 = r812794 * r812803;
double r812805 = r812802 - r812804;
double r812806 = r812793 + r812798;
double r812807 = r812806 + r812794;
double r812808 = r812805 / r812807;
double r812809 = -inf.0;
bool r812810 = r812808 <= r812809;
double r812811 = 3.838134371967239e+237;
bool r812812 = r812808 <= r812811;
double r812813 = !r812812;
bool r812814 = r812810 || r812813;
double r812815 = r812800 + r812796;
double r812816 = r812815 - r812803;
double r812817 = 1.0;
double r812818 = r812807 / r812805;
double r812819 = r812817 / r812818;
double r812820 = r812814 ? r812816 : r812819;
return r812820;
}




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.5 |
|---|---|
| Target | 11.2 |
| Herbie | 7.7 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 3.838134371967239e+237 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 61.4
rmApplied clear-num61.4
Taylor expanded around 0 17.4
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 3.838134371967239e+237Initial program 0.3
rmApplied clear-num0.4
Final simplification7.7
herbie shell --seed 2020064
(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)))