]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_nstdsums.cpp
G_numeric: fix evaluation with y == 1
[ginac.git] / ginac / inifcns_nstdsums.cpp
index 62c6c62f2737cf6b87a34db73bc51060103c1ff5..977642d9c64bf0be58cf7badd789b6843a78e7dd 100644 (file)
@@ -1020,9 +1020,8 @@ G_do_hoelder(std::vector<cln::cl_N> x, /* yes, it's passed by value */
                std::vector<int> qlsts;
                for (std::size_t j = r; j >= 1; --j) {
                        qlstx.push_back(cln::cl_N(1) - x[j-1]);
-                       if (instanceof(x[j-1], cln::cl_R_ring) &&
-                           realpart(x[j-1]) > 1 && realpart(x[j-1]) <= 2) {
-                               qlsts.push_back(s[j-1]);
+                       if (instanceof(x[j-1], cln::cl_R_ring) && realpart(x[j-1]) > 1) {
+                               qlsts.push_back(1);
                        } else {
                                qlsts.push_back(-s[j-1]);
                        }
@@ -1150,16 +1149,19 @@ G_numeric(const std::vector<cln::cl_N>& x, const std::vector<int>& s,
                                need_hoelder = true;
                }
        }
-       if (zerop(x[x.size() - 1])) {
-               have_trailing_zero = true;
+       have_trailing_zero = zerop(x.back());
+       if (have_trailing_zero) {
                need_trafo = true;
+               if (y != 1) {
+                       need_hoelder = false;
+               }
        }
 
        if (depth == 1 && x.size() == 2 && !need_trafo)
                return - Li_projection(2, y/x[1], cln::float_format(Digits));
        
        // do acceleration transformation (hoelder convolution [BBB])
-       if (need_hoelder && !have_trailing_zero)
+       if (need_hoelder)
                return G_do_hoelder(x, s, y);
        
        // convergence transformation