Hi all, I come across an issue about the series on an expression involving positive symbol, i.e., possymbol in GiNaC. the problem can be reproduced by the following program (test.cpp), for example, we compile the test.cpp to test, and then run the test program several times, we will see different outputs. for example, we can run the bash script in the terminal: for n in {1..20}; do ./test; done PS: if we change the possymbol to symbol in the test.cpp, we will always get correct result. Best regards! Feng --- #include "ginac/ginac.h" using namespace std; using namespace GiNaC; int main() { possymbol t("t"); symbol m("m"), ep("ep"); symtab table; table["ep"] = ep; table["t"] = t; table["m"] = m; parser reader(table); ex in1 = reader("(-3/2*t^2*(2*t*m^2-3*m^2*(-1+t))^(-1)*(-1+t)^(-1))"); ex in2 = reader("((3*pow(m,-2)*pow(-3+t,-1)*pow(-1+t,-1)*pow(t,2))/2)"); cout << "in1-in2 = " << normal(in1-in2) << endl; in1 = pow(in1,-1+ep)*tgamma(ep); in2 = pow(in2,-1+ep)*tgamma(ep); ex diff = series_to_poly(series(in1-in2,ep,1)); lst repl = lst{ep==2,m==1,t==1/ex(3)}; cout << "diff = " << normal(diff.subs(repl)) << endl; return 0; }
I got a more compact case for this issue, by changing the in1 and in2 to ex in1 = reader("t^2/(3*m^2-t*m^2)/2"); ex in2 = reader("-(m^(-2)*(-3+t)^(-1)*t^2/2)"); sometimes we get the output: in1-in2 = 0 diff = 0 while, for some other times, we get the output: in1-in2 = 0 diff = 96*log(1/48) it seems that the sign of the log term has been changed. Best regards! Feng
Dear Feng, Thanks for reporting this (rather severe) issue. I am attaching a patch to fix it. It also includes additional GiNaC self-check. Best wishes, Vladimir PS. The previous not yet committed bugfix is attached as well. -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks ________________________________________ From: GiNaC-list <ginac-list-bounces@ginac.de> on behalf of Feng Feng <f.feng@outlook.com> Sent: 27 July 2020 02:23 To: ginac-list@ginac.de Subject: [GiNaC-list] 回复: issue about series involving positive symbol I got a more compact case for this issue, by changing the in1 and in2 to ex in1 = reader("t^2/(3*m^2-t*m^2)/2"); ex in2 = reader("-(m^(-2)*(-3+t)^(-1)*t^2/2)"); sometimes we get the output: in1-in2 = 0 diff = 0 while, for some other times, we get the output: in1-in2 = 0 diff = 96*log(1/48) it seems that the sign of the log term has been changed. Best regards! Feng
Dear Vladimir, Thanks so much for the quick fix, many thanks again. Best regards! Feng ________________________________ 发件人: Vladimir V. Kisil <V.Kisil@leeds.ac.uk> 发送时间: 2020年7月27日 22:22 收件人: ginac-list@ginac.de <ginac-list@ginac.de>; GiNaC-devel List <ginac-devel@ginac.de>; Feng Feng <f.feng@outlook.com> 主题: Re: [GiNaC-list] 回复: issue about series involving positive symbol Dear Feng, Thanks for reporting this (rather severe) issue. I am attaching a patch to fix it. It also includes additional GiNaC self-check. Best wishes, Vladimir PS. The previous not yet committed bugfix is attached as well. -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks ________________________________________ From: GiNaC-list <ginac-list-bounces@ginac.de> on behalf of Feng Feng <f.feng@outlook.com> Sent: 27 July 2020 02:23 To: ginac-list@ginac.de Subject: [GiNaC-list] 回复: issue about series involving positive symbol I got a more compact case for this issue, by changing the in1 and in2 to ex in1 = reader("t^2/(3*m^2-t*m^2)/2"); ex in2 = reader("-(m^(-2)*(-3+t)^(-1)*t^2/2)"); sometimes we get the output: in1-in2 = 0 diff = 0 while, for some other times, we get the output: in1-in2 = 0 diff = 96*log(1/48) it seems that the sign of the log term has been changed. Best regards! Feng
participants (3)
-
Feng Feng
-
Feng Feng
-
Vladimir V. Kisil