\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:\\
\;\;\;\;z\\
\mathbf{elif}\;\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.00011947244809546 \cdot 10^{241}:\\
\;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r1042788 = x;
double r1042789 = y;
double r1042790 = r1042788 + r1042789;
double r1042791 = z;
double r1042792 = r1042790 * r1042791;
double r1042793 = t;
double r1042794 = r1042793 + r1042789;
double r1042795 = a;
double r1042796 = r1042794 * r1042795;
double r1042797 = r1042792 + r1042796;
double r1042798 = b;
double r1042799 = r1042789 * r1042798;
double r1042800 = r1042797 - r1042799;
double r1042801 = r1042788 + r1042793;
double r1042802 = r1042801 + r1042789;
double r1042803 = r1042800 / r1042802;
return r1042803;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1042804 = x;
double r1042805 = y;
double r1042806 = r1042804 + r1042805;
double r1042807 = z;
double r1042808 = r1042806 * r1042807;
double r1042809 = t;
double r1042810 = r1042809 + r1042805;
double r1042811 = a;
double r1042812 = r1042810 * r1042811;
double r1042813 = r1042808 + r1042812;
double r1042814 = b;
double r1042815 = r1042805 * r1042814;
double r1042816 = r1042813 - r1042815;
double r1042817 = r1042804 + r1042809;
double r1042818 = r1042817 + r1042805;
double r1042819 = r1042816 / r1042818;
double r1042820 = -inf.0;
bool r1042821 = r1042819 <= r1042820;
double r1042822 = 3.0001194724480955e+241;
bool r1042823 = r1042819 <= r1042822;
double r1042824 = 1.0;
double r1042825 = r1042824 / r1042818;
double r1042826 = r1042816 * r1042825;
double r1042827 = r1042823 ? r1042826 : r1042807;
double r1042828 = r1042821 ? r1042807 : r1042827;
return r1042828;
}




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.0 |
|---|---|
| Target | 11.3 |
| Herbie | 17.8 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 3.0001194724480955e+241 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 60.8
rmApplied div-inv60.8
rmApplied *-un-lft-identity60.8
Applied associate-*l*60.8
Simplified60.8
Taylor expanded around inf 41.5
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 3.0001194724480955e+241Initial program 0.3
rmApplied div-inv0.4
Final simplification17.8
herbie shell --seed 2020045
(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)))