From: SourceForge.net <no...@so...> - 2006-05-17 17:12:32
|
Bugs item #1490397, was opened at 2006-05-17 13:12 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1490397&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Raymond Toy (rtoy) Assigned to: Nobody/Anonymous (nobody) Summary: subres gcd wrong Initial Comment: Here is an example of where subres produces the wrong result but spmod is ok. p:(-x^3+1)/(2*x^5+2); q:(-sqrt(5)+5)/(20*x^2+(-10*sqrt(5)-10)*x+20); gcd:subres; ratsimp(p+q); => -((sqrt(5)+5)*x^3-2*sqrt(5)*x^2-2*sqrt(5)*x+sqrt(5)-15)/(80*x^5+80) But now see what happens with spmod: gcd:spmod; ratsimp(p+q); => -((sqrt(5)+5)*x^5+(-5*sqrt(5)-5)*x^4+10*x^3-10*x^2+(5*sqrt(5)+5)*x +sqrt(5)-15) /(20*x^7+(-10*sqrt(5)-10)*x^6+20*x^5+20*x^2+(-10*sqrt(5)-10)*x+20) factor(%): => -(sqrt(5)*x^5+5*x^5-5*sqrt(5)*x^4-5*x^4+10*x^3-10*x^2+5*sqrt(5)*x+5*x +sqrt(5)-15) /(10*(x+1)*(2*x^2-sqrt(5)*x-x+2)*(x^4-x^3+x^2-x+1)) Maxima doesn't notice but the numerator has the factor 2*x^2-sqrt(5)*x-x+2: divide((sqrt(5)*x^5+5*x^5-5*sqrt(5)*x^4-5*x^4+10*x^3-10*x^2+5*sqrt(5)*x+5*x +sqrt(5)-15), (2*x^2-sqrt(5)*x-x+2)); => [((sqrt(5)+5)*x^3-2*sqrt(5)*x^2-2*sqrt(5)*x+sqrt(5)-15)/2,0] So the final result of ratsimp is ((sqrt(5)+5)*x^3-2*sqrt(5)*x^2-2*sqrt(5)*x+sqrt(5)-15)/2/(10*(x+1)*(x^4-x^3+x^2-x+1)); Notice that the numerator matches the numerator for the subres result, but the denominator is off by a factor of 4! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1490397&group_id=4933 |