\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}\;x \le -1.51042017274667401 \cdot 10^{171}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;x \le -1.50708683770980189 \cdot 10^{134}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;x \le -485115.40011078131:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\mathbf{elif}\;x \le -6.6876587271108054 \cdot 10^{-170}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;x \le -2.860753366813772 \cdot 10^{-271}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}, \frac{1}{\left(x + t\right) + y}, -\frac{y \cdot b}{\left(x + t\right) + y}\right)\\
\mathbf{elif}\;x \le 6.7642958276510964 \cdot 10^{-203}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{elif}\;x \le 9.7109844173215245 \cdot 10^{230}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x + y, z, \left(t + y\right) \cdot a\right)}{1}}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r1229180 = x;
double r1229181 = y;
double r1229182 = r1229180 + r1229181;
double r1229183 = z;
double r1229184 = r1229182 * r1229183;
double r1229185 = t;
double r1229186 = r1229185 + r1229181;
double r1229187 = a;
double r1229188 = r1229186 * r1229187;
double r1229189 = r1229184 + r1229188;
double r1229190 = b;
double r1229191 = r1229181 * r1229190;
double r1229192 = r1229189 - r1229191;
double r1229193 = r1229180 + r1229185;
double r1229194 = r1229193 + r1229181;
double r1229195 = r1229192 / r1229194;
return r1229195;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1229196 = x;
double r1229197 = -1.510420172746674e+171;
bool r1229198 = r1229196 <= r1229197;
double r1229199 = z;
double r1229200 = y;
double r1229201 = t;
double r1229202 = r1229196 + r1229201;
double r1229203 = r1229202 + r1229200;
double r1229204 = b;
double r1229205 = r1229203 / r1229204;
double r1229206 = r1229200 / r1229205;
double r1229207 = r1229199 - r1229206;
double r1229208 = -1.5070868377098019e+134;
bool r1229209 = r1229196 <= r1229208;
double r1229210 = r1229196 + r1229200;
double r1229211 = r1229201 + r1229200;
double r1229212 = a;
double r1229213 = r1229211 * r1229212;
double r1229214 = fma(r1229210, r1229199, r1229213);
double r1229215 = 1.0;
double r1229216 = r1229214 / r1229215;
double r1229217 = r1229216 / r1229203;
double r1229218 = r1229204 / r1229203;
double r1229219 = r1229200 * r1229218;
double r1229220 = r1229217 - r1229219;
double r1229221 = -485115.4001107813;
bool r1229222 = r1229196 <= r1229221;
double r1229223 = -6.687658727110805e-170;
bool r1229224 = r1229196 <= r1229223;
double r1229225 = r1229212 - r1229219;
double r1229226 = -2.8607533668137723e-271;
bool r1229227 = r1229196 <= r1229226;
double r1229228 = r1229215 / r1229203;
double r1229229 = r1229200 * r1229204;
double r1229230 = r1229229 / r1229203;
double r1229231 = -r1229230;
double r1229232 = fma(r1229216, r1229228, r1229231);
double r1229233 = 6.764295827651096e-203;
bool r1229234 = r1229196 <= r1229233;
double r1229235 = 9.710984417321525e+230;
bool r1229236 = r1229196 <= r1229235;
double r1229237 = r1229236 ? r1229220 : r1229207;
double r1229238 = r1229234 ? r1229225 : r1229237;
double r1229239 = r1229227 ? r1229232 : r1229238;
double r1229240 = r1229224 ? r1229225 : r1229239;
double r1229241 = r1229222 ? r1229207 : r1229240;
double r1229242 = r1229209 ? r1229220 : r1229241;
double r1229243 = r1229198 ? r1229207 : r1229242;
return r1229243;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 26.8 |
|---|---|
| Target | 10.8 |
| Herbie | 23.1 |
if x < -1.510420172746674e+171 or -1.5070868377098019e+134 < x < -485115.4001107813 or 9.710984417321525e+230 < x Initial program 33.1
rmApplied div-sub33.1
Simplified33.1
rmApplied associate-/l*30.2
Taylor expanded around inf 23.8
if -1.510420172746674e+171 < x < -1.5070868377098019e+134 or 6.764295827651096e-203 < x < 9.710984417321525e+230Initial program 25.6
rmApplied div-sub25.6
Simplified25.6
rmApplied *-un-lft-identity25.6
Applied times-frac23.4
Simplified23.4
if -485115.4001107813 < x < -6.687658727110805e-170 or -2.8607533668137723e-271 < x < 6.764295827651096e-203Initial program 23.6
rmApplied div-sub23.6
Simplified23.6
rmApplied *-un-lft-identity23.6
Applied times-frac22.2
Simplified22.2
Taylor expanded around 0 22.6
if -6.687658727110805e-170 < x < -2.8607533668137723e-271Initial program 21.0
rmApplied div-sub21.0
Simplified21.0
rmApplied *-un-lft-identity21.0
Applied div-inv21.0
Applied times-frac21.0
Applied fma-neg21.0
Final simplification23.1
herbie shell --seed 2020060 +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.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)))