\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}\;y \le -1.602247384635264296199163215397262441724 \cdot 10^{53} \lor \neg \left(y \le 28044996243696232\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(x + t\right) + y} \cdot \mathsf{fma}\left(a, t + y, \mathsf{fma}\left(y, z - b, x \cdot z\right)\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r1149802 = x;
double r1149803 = y;
double r1149804 = r1149802 + r1149803;
double r1149805 = z;
double r1149806 = r1149804 * r1149805;
double r1149807 = t;
double r1149808 = r1149807 + r1149803;
double r1149809 = a;
double r1149810 = r1149808 * r1149809;
double r1149811 = r1149806 + r1149810;
double r1149812 = b;
double r1149813 = r1149803 * r1149812;
double r1149814 = r1149811 - r1149813;
double r1149815 = r1149802 + r1149807;
double r1149816 = r1149815 + r1149803;
double r1149817 = r1149814 / r1149816;
return r1149817;
}
double f(double x, double y, double z, double t, double a, double b) {
double r1149818 = y;
double r1149819 = -1.6022473846352643e+53;
bool r1149820 = r1149818 <= r1149819;
double r1149821 = 2.804499624369623e+16;
bool r1149822 = r1149818 <= r1149821;
double r1149823 = !r1149822;
bool r1149824 = r1149820 || r1149823;
double r1149825 = a;
double r1149826 = z;
double r1149827 = r1149825 + r1149826;
double r1149828 = b;
double r1149829 = r1149827 - r1149828;
double r1149830 = 1.0;
double r1149831 = x;
double r1149832 = t;
double r1149833 = r1149831 + r1149832;
double r1149834 = r1149833 + r1149818;
double r1149835 = r1149830 / r1149834;
double r1149836 = r1149832 + r1149818;
double r1149837 = r1149826 - r1149828;
double r1149838 = r1149831 * r1149826;
double r1149839 = fma(r1149818, r1149837, r1149838);
double r1149840 = fma(r1149825, r1149836, r1149839);
double r1149841 = r1149835 * r1149840;
double r1149842 = r1149824 ? r1149829 : r1149841;
return r1149842;
}




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.4 |
|---|---|
| Target | 11.6 |
| Herbie | 15.9 |
if y < -1.6022473846352643e+53 or 2.804499624369623e+16 < y Initial program 40.8
Simplified40.8
rmApplied clear-num40.9
Taylor expanded around 0 16.6
if -1.6022473846352643e+53 < y < 2.804499624369623e+16Initial program 15.2
Simplified15.2
rmApplied clear-num15.3
Taylor expanded around inf 15.3
Simplified15.3
rmApplied div-inv15.4
Applied add-cube-cbrt15.4
Applied times-frac15.4
Simplified15.4
Simplified15.3
Final simplification15.9
herbie shell --seed 2019350 +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)))