\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} \le -6.939662278312858132841061974784859759209 \cdot 10^{305}:\\
\;\;\;\;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 9.823560067484486557199205658011723736571 \cdot 10^{276}:\\
\;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\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 r579114 = x;
double r579115 = y;
double r579116 = r579114 + r579115;
double r579117 = z;
double r579118 = r579116 * r579117;
double r579119 = t;
double r579120 = r579119 + r579115;
double r579121 = a;
double r579122 = r579120 * r579121;
double r579123 = r579118 + r579122;
double r579124 = b;
double r579125 = r579115 * r579124;
double r579126 = r579123 - r579125;
double r579127 = r579114 + r579119;
double r579128 = r579127 + r579115;
double r579129 = r579126 / r579128;
return r579129;
}
double f(double x, double y, double z, double t, double a, double b) {
double r579130 = x;
double r579131 = y;
double r579132 = r579130 + r579131;
double r579133 = z;
double r579134 = r579132 * r579133;
double r579135 = t;
double r579136 = r579135 + r579131;
double r579137 = a;
double r579138 = r579136 * r579137;
double r579139 = r579134 + r579138;
double r579140 = b;
double r579141 = r579131 * r579140;
double r579142 = r579139 - r579141;
double r579143 = r579130 + r579135;
double r579144 = r579143 + r579131;
double r579145 = r579142 / r579144;
double r579146 = -6.939662278312858e+305;
bool r579147 = r579145 <= r579146;
double r579148 = 9.823560067484487e+276;
bool r579149 = r579145 <= r579148;
double r579150 = r579149 ? r579145 : r579133;
double r579151 = r579147 ? r579133 : r579150;
return r579151;
}




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.8 |
|---|---|
| Target | 11.1 |
| Herbie | 17.1 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -6.939662278312858e+305 or 9.823560067484487e+276 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 63.1
Taylor expanded around inf 40.1
if -6.939662278312858e+305 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 9.823560067484487e+276Initial program 0.3
Final simplification17.1
herbie shell --seed 2019208 +o rules:numerics
(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.5813117084150564e153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e82) (/ 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)))