Charsets
Dan Stanger <[email protected]> Fri, 31 Jul 2026 11:11:52 -0400
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CAFyhtT73RcGH0mvswMwJR4yJesQ9R37+D+g4nLvE5Y-+fYe+HQ@mail.gmail.com> |
--===============6437261674267031858== Content-Type: multipart/alternative; boundary="000000000000caf6f40657e99c58" --000000000000caf6f40657e99c58 Content-Type: text/plain; charset="UTF-8" Hello All, I isolated the issue with Charsets to one line in the code, where the current polynomial is divided by the leading coefficient and the numerator used in the continuing calculation, to eliminate possible fractional coefficients in the polynomials. However Maples and Maximas leading coefficients produce different results. With Viktor's help I produced the following table: Expression Maxima Maple Same print(lcoeff(-x1-2*x1*x2^2+(-x1^2)*x2-x3^2+x1*x2*x3)) -1 -1 Y print(lcoeff(2*x1^2*x2-2*x1*x2^2+(-2)*x1^2*x2^2-x1-x1^2)) -2 -2 Y print(lcoeff(1+3*x2*x3^2+(-x2)*x3+4*x2^2+(-2)*x2^3*x3+4*x2^4)) 3 4 N print(lcoeff(4*x2^3+4*x2^5+x2+(-4)*x4*x2^4+(-4)*x4*x2^2-x4)) -4 4 N print(lcoeff(1+8*x2^6+12*x2^4+6*x2^2)) 8 8 Y print(lcoeff(12*x2^5+12*x2^3+3*x2)) 12 12 Y print(lcoeff(-1-4*x2^4+(-4)*x2^2)) -4 -4 Y print(lcoeff(4*x2^4+4*x2^2+1)) 4 4 Y print(lcoeff(-2*x2^3-x2+x2^2*x3+x2^2)) 1 -2 N print(lcoeff(2*x2^4+x2^2+(-2)*x4*x2^3+(-x4)*x2+x4*x2^2-x2^3)) -2 2 N print(lcoeff(-4*x2^5-5*x2^3+4*x2^4-x2+2*x2^2)) -4 -4 Y print(lcoeff(4*x2^4+2*x2^2+(-2)*x2^3)) 4 4 Y print(lcoeff(-2*x2^3-x2+x2^2)) -2 -2 Y print(lcoeff(2*x2^3+x2-x2^2)) 2 2 Y print(lcoeff(2*x4*x2^2+x2-x2^2)) 2 2 Y print(lcoeff(-1+x3^2)) 1 1 Y print(lcoeff(-x4+x2)) -1 1 N print(lcoeff(-1-2*x2^2+x2)) -2 -2 Y Does anyone have time to take a look at this to try to determine the maple lcoeff algorithm? Dan Stanger --000000000000caf6f40657e99c58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello All,</div><div>I isolated the issue with Charse= ts to one line in the code, where the current polynomial is divided by the = leading coefficient and the numerator used in the continuing calculation, t= o eliminate possible fractional coefficients in the polynomials. However Ma= ples and Maximas leading coefficients produce different results. With Vikto= r's help I produced the following table:</div><div> =09 =09 <span></span> =09 =09 =09 <table cellspacing=3D"0" border=3D"0" style=3D"font-family:"Liberation= Sans";font-size:x-small"> <colgroup width=3D"417"></colgroup> <colgroup span=3D"3" width=3D"85"></colgroup> <tbody style=3D"font-family:"Liberation Sans";font-size:x-small"= ><tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">Expression</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Maxima</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Maple</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Same</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-x1-2*x1*x2^2+(-x1^2)*x2-x3^2+x1*x= 2*x3))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-1</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-1</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(2*x1^2*x2-2*x1*x2^2+(-2)*x1^2*x2^2= -x1-x1^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(1+3*x2*x3^2+(-x2)*x3+4*x2^2+(-2)*x= 2^3*x3+4*x2^4))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">3</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">N</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(4*x2^3+4*x2^5+x2+(-4)*x4*x2^4+(-4)= *x4*x2^2-x4))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-4</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">N</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(1+8*x2^6+12*x2^4+6*x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">8</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">8</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(12*x2^5+12*x2^3+3*x2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">12</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">12</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-1-4*x2^4+(-4)*x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-4</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(4*x2^4+4*x2^2+1))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-2*x2^3-x2+x2^2*x3+x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">1</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">N</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(2*x2^4+x2^2+(-2)*x4*x2^3+(-x4)*x2+= x4*x2^2-x2^3))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">N</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-4*x2^5-5*x2^3+4*x2^4-x2+2*x2^2))<= /td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-4</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(4*x2^4+2*x2^2+(-2)*x2^3))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">4</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-2*x2^3-x2+x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(2*x2^3+x2-x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(2*x4*x2^2+x2-x2^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-1+x3^2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">1</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">1</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-x4+x2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-1</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">1</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">N</td> </tr> <tr style=3D"font-family:"Liberation Sans";font-size:x-small"> <td height=3D"17" align=3D"left" style=3D"font-family:"Liberation Sa= ns";font-size:x-small">print(lcoeff(-1-2*x2^2+x2))</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"right" style=3D"font-family:"Liberation Sans";font= -size:x-small">-2</td> <td align=3D"left" style=3D"font-family:"Liberation Sans";font-= size:x-small">Y</td> </tr> </tbody></table> </div><div><font face=3D"arial,sans-serif">Does anyone have time to take a = look at this to try to determine the maple lcoeff algorithm?</font></div><d= iv><font face=3D"arial,sans-serif">Dan Stanger</font></div></div> --000000000000caf6f40657e99c58-- --===============6437261674267031858== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6437261674267031858== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss --===============6437261674267031858==--