<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><p style="font:14px/1.5 Lucida Grande;margin:0;">Dear <span style="white-space: pre-wrap;">Vladimir,</span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;"><br></span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;">Thanks so much for checking this, </span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;">and thanks for the quick update on the git!</span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;"><br></span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;">Best regards!</span></p><p style="font:14px/1.5 Lucida Grande;margin:0;"><span style="white-space: pre-wrap;">Feng</span></p><span style="font: 14px/1.5 'Lucida Grande';color:#333;"><br></span><div class="foxmail_blockquote_fromhere_element" style="font: 12px/1.5 'Lucida Grande';padding:2px 0 2px 0;"> </div><div style="border-left: solid 3px #EAEAEA; padding-left: 10px"><div style="font: 12px/1.5 'PingFangSC-Regular';color:#70727B;">在 2022年1月13日 22:35,Vladimir V. Kisil<V.Kisil@leeds.ac.uk> 写道:</div><br><div class="mail_quote_1377DC68F5204029B65CC2E384970C14" style="font: 14px/1.5 'Lucida Grande';color:#333;"><pre style="white-space:pre-wrap;"> Dear Feng,
Thanks for spotting this typo. Indeed currently the following
lines
symbol x("x");
ex a = pow(x+1/x,2);
cout << a << endl;
exmap mp1, mp2;
ex p = a.to_polynomial(mp1);
cout << " = " << p << "\n with " << mp1 << endl;
p = a.expand().to_polynomial(mp2);
cout << " = " << p << "\n with " << mp2 << endl;
produce the output with not a polynomial in the first instance:
(x^(-1)+x)^2
= (x^(-1)+x)^2
with {}
= 2+symbol3^2+x^2
with {symbol3==x^(-1)}
If to_rational() is replaced by to_polynomial() as you suggested, then
we do have (although slightly different) polynomial outputs in both cases:
(x+x^(-1))^2
= (x+symbol3)^2
with {symbol3==x^(-1)}
= 2+x^2+symbol4^2
with {symbol4==x^(-1)}
I am attaching a one-line patch to fix this and copy the message to
the developer list.
Best wishes,
Vladimir
--
Vladimir V. Kisil <a href="http://www.maths.leeds.ac.uk/~kisilv/" title="http://www.maths.leeds.ac.uk/~kisilv/">http://www.maths.leeds.ac.uk/~kisilv/</a>
Book: Geometry of Mobius Maps <a href="https://doi.org/10.1142/p835" title="https://doi.org/10.1142/p835">https://doi.org/10.1142/p835</a>
Soft: Geometry of cycles <a href="http://moebinv.sourceforge.net/" title="http://moebinv.sourceforge.net/">http://moebinv.sourceforge.net/</a>
Jupyter notebooks: <a href="https://github.com/vvkisil?tab=repositories" title="https://github.com/vvkisil?tab=repositories">https://github.com/vvkisil?tab=repositories</a>
>>>>> On Tue, 11 Jan 2022 07:10:40 +0000, Feng Feng <<a href="mailto:f.feng@outlook.com" title="mailto:f.feng@outlook.com">f.feng@outlook.com</a>> said:
FF> Dear Vladimir V. Kisil,
FF> Thanks very much for suggestion to use expand() method on e3
FF> first.
FF> And I have given a look at the source code at
FF> power::to_polynomial
FF> <a href="https://www.ginac.de/reference/normal_8cpp_source.html#l02688" title="https://www.ginac.de/reference/normal_8cpp_source.html#l02688">https://www.ginac.de/reference/normal_8cpp_source.html#l02688</a>
FF> ...
FF> and I wonfer if there is a typo on line 2691, the
FF> basis.to_rational can be replaced with basis.to_polynomial?
FF> Best regards! Feng
</pre></div></div>