]> www.ginac.de Git - ginac.git/commitdiff
G_numeric: fix numeric evaluation with trailing zeros and y != 1.
authorStefan Weinzierl <stefanw@thep.physik.uni-mainz.de>
Wed, 12 Feb 2014 20:07:40 +0000 (22:07 +0200)
committerAlexei Sheplyakov <Alexei.Sheplyakov@gmail.com>
Wed, 12 Feb 2014 20:07:59 +0000 (22:07 +0200)
Make sure G_numeric makes use of scaling relation (G_do_hoelder) only if
there are no traling zeros. Use G_do_trafo otherwise (which can handle
trailing zeros).

ginac/inifcns_nstdsums.cpp

index 975a81e685ddb18863f4ce6f0625455aef0d36b4..62c6c62f2737cf6b87a34db73bc51060103c1ff5 100644 (file)
@@ -1136,6 +1136,7 @@ G_numeric(const std::vector<cln::cl_N>& x, const std::vector<int>& s,
        // check for convergence and necessary accelerations
        bool need_trafo = false;
        bool need_hoelder = false;
+       bool have_trailing_zero = false;
        std::size_t depth = 0;
        for (std::size_t i = 0; i < x.size(); ++i) {
                if (!zerop(x[i])) {
@@ -1149,14 +1150,16 @@ G_numeric(const std::vector<cln::cl_N>& x, const std::vector<int>& s,
                                need_hoelder = true;
                }
        }
-       if (zerop(x[x.size() - 1]))
+       if (zerop(x[x.size() - 1])) {
+               have_trailing_zero = true;
                need_trafo = true;
+       }
 
        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)
+       if (need_hoelder && !have_trailing_zero)
                return G_do_hoelder(x, s, y);
        
        // convergence transformation