]> www.ginac.de Git - ginac.git/commitdiff
Fixed bugs found by Jianqiang Zhao.
authorJens Vollinga <jensv@nikhef.nl>
Thu, 3 Apr 2008 09:56:57 +0000 (11:56 +0200)
committerJens Vollinga <jensv@nikhef.nl>
Thu, 3 Apr 2008 10:04:20 +0000 (12:04 +0200)
ginac/inifcns_nstdsums.cpp

index e92e8eb22f9b95e4ec85c855bf9b46efd5693358..138f5e34431acb0d1b72b1e378a8ee0200d44726 100644 (file)
@@ -492,6 +492,12 @@ cln::cl_N multipleLi_do_sum(const std::vector<int>& s, const std::vector<cln::cl
                        flag_accidental_zero = cln::zerop(t[k+1]);
                        t[k] = t[k] + t[k+1] * cln::expt(x[k], q+j-1-k) / cln::expt(cln::cl_I(q+j-1-k), s[k]);
                }
                        flag_accidental_zero = cln::zerop(t[k+1]);
                        t[k] = t[k] + t[k+1] * cln::expt(x[k], q+j-1-k) / cln::expt(cln::cl_I(q+j-1-k), s[k]);
                }
+               q++;
+               t[j-1] = t[j-1] + cln::expt(x[j-1], q) / cln::expt(cln::cl_I(q),s[j-1]) * one;
+               for (int k=j-2; k>=0; k--) {
+                       flag_accidental_zero = cln::zerop(t[k+1]);
+                       t[k] = t[k] + t[k+1] * cln::expt(x[k], q+j-1-k) / cln::expt(cln::cl_I(q+j-1-k), s[k]);
+               }
        } while ( (t[0] != t0buf) || flag_accidental_zero );
 
        return t[0];
        } while ( (t[0] != t0buf) || flag_accidental_zero );
 
        return t[0];
@@ -991,7 +997,7 @@ ex G_numeric(const lst& x, const lst& s, const ex& y)
        if (x.op(x.nops()-1).is_zero()) {
                need_trafo = true;
        }
        if (x.op(x.nops()-1).is_zero()) {
                need_trafo = true;
        }
-       if (depth == 1 && !need_trafo) {
+       if (depth == 1 && x.nops() == 2 && !need_trafo) {
                return -Li(x.nops(), y / x.op(x.nops()-1)).evalf();
        }
        
                return -Li(x.nops(), y / x.op(x.nops()-1)).evalf();
        }