Hello!
Series expansion now works predictably. All terms with the exponent of the expansion variable smaller than the given order are calculated exactly. If the series is not terminating, the Order function is (at least) of the given order.
( GiNaC 1.1.7 changelog ) That sounds nice, but let's consider a simple program. #include <iostream> #include <stdexcept> using namespace std; #include <ginac/ginac.h> using namespace GiNaC; int main(int argc, char** argv) { try { symbol eps("epsilon"); ex part1 = tgamma(2-eps)*pow(eps, -1)*pow(tgamma(3-eps), -1); ex part2 = tgamma(2-eps)*pow(eps, 2)*pow(tgamma(3-eps), -1); ex test = part1 + part2; cout << test << " = " << test.series(eps, 1) << endl; cout << part1 << " = " << part1.series(eps, 1) << endl; cout << part2 << " = " << part2.series(eps, 1) << endl; return 0; } catch ( exception & ee) { cerr << ee.what() << endl; return 1; } } My naive expectations are: 1) first and second lines should be the same 2) third line should be Order(epsilon) But the output is: tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2+tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = Order(epsilon^(-1)) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = 1/2*epsilon^(-1)+1/4+Order(epsilon) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2 = Order(epsilon^(-1)) Is this a bug or a feature? Thanks, Alexei. P.S. $ ginac-config --version 1.1.7 $ g++ --version | head -n 1 g++ (GCC) 3.3.3 (Debian 20040401)
Hi. On Mon, Apr 05, 2004 at 05:11:39PM +0400, Sheplyakov Alexei wrote:
Hello! My naive expectations are: 1) first and second lines should be the same 2) third line should be Order(epsilon)
But the output is:
tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2+tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = Order(epsilon^(-1)) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = 1/2*epsilon^(-1)+1/4+Order(epsilon) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2 = Order(epsilon^(-1))
Is this a bug or a feature?
It's a bug, but it has already been fixed in CVS. Bye, Jens
Hello, On Mon, 5 Apr 2004, Sheplyakov Alexei wrote:
That sounds nice, but let's consider a simple program.
Recently a bug has been found that can cause this kind of behaviour. This bug was fixed in CVS. When I compiled your program with the current 1.2 CVS version I got the output tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2+tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = 1/2*epsilon^(-1)+1/4+Order(epsilon) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^(-1) = 1/2*epsilon^(-1)+1/4+Order(epsilon) tgamma(2-epsilon)*tgamma(3-epsilon)^(-1)*epsilon^2 = Order(epsilon) I do not think it will matter whether you use the 1.2 or the 1.1 CVS-version. The bug should be fixed in both. Regards, Chris Dams
participants (3)
-
Chris Dams
-
Jens Vollinga
-
varg@thsun1.jinr.ru