X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns_nstdsums.cpp;h=67b06bae54f605599aa09d5acbb06352d9f714c5;hp=e21e311d2fd44c6b19a3ebbfb14ff61dcf4461dc;hb=11c0c610d6f47476b82f3ab118b0be37ed3ef747;hpb=96fc556787518794919137fc6d0e98e002c32ff5 diff --git a/ginac/inifcns_nstdsums.cpp b/ginac/inifcns_nstdsums.cpp index e21e311d..67b06bae 100644 --- a/ginac/inifcns_nstdsums.cpp +++ b/ginac/inifcns_nstdsums.cpp @@ -337,10 +337,10 @@ cln::cl_N Li_projection(int n, const cln::cl_N& x, const cln::float_format_t& pr // the switching point was empirically determined. the optimal point // depends on hardware, Digits, ... so an approx value is okay. // it solves also the problem with precision due to the u=-log(1-x) transformation - if (cln::abs(cln::realpart(x)) < 0.25) { - + if (cln::abs(x) < 0.25) { return Li2_do_sum(x); } else { + // Li2_do_sum practically doesn't converge near x == ±I return Li2_do_sum_Xn(x); } } else { @@ -366,9 +366,10 @@ cln::cl_N Li_projection(int n, const cln::cl_N& x, const cln::float_format_t& pr if (cln::realpart(x) < 0.5) { // choose the faster algorithm // with n>=12 the "normal" summation always wins against the method with Xn - if ((cln::abs(cln::realpart(x)) < 0.3) || (n >= 12)) { + if ((cln::abs(x) < 0.3) || (n >= 12)) { return Lin_do_sum(n, x); } else { + // Li2_do_sum practically doesn't converge near x == ±I return Lin_do_sum_Xn(n, x); } } else {