*/
/*
- * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
// 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 {
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 {
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) {
+ if (imagpart(x[j-1])==0 && realpart(x[j-1]) >= 1) {
qlsts.push_back(1);
} else {
qlsts.push_back(-s[j-1]);