From: SourceForge.net <noreply@so...>  20110822 23:50:42

Bugs item #3396631, was opened at 20110822 22:55 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3396631&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: 9 Private: No Submitted By: Stefan Savolainen (stesavo) Assigned to: Nobody/Anonymous (nobody) Summary: equal terms produce different results Initial Comment: Hi, I hope I haven't made any mistake, but I doublechecked all three terms with WolframAlpha, which always comes up with the first (correct) result. Have a look at this: Maxima 5.25.0 http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version 1.7r14925M (WindowsX8632) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. maximainit.mac loaded (%i1) 5*sqrt(5)+3*sqrt(5)+5*sqrt(3)+3*sqrt(3)+2*sqrt(75)+2*sqrt(45); 5/2 (%o1) 14*sqrt(5) + 2*3 (%i2) 5*sqrt(5)+5*sqrt(3)+3*sqrt(3)+2*sqrt(75)+2*sqrt(45)+3*sqrt(5); 5/2 (%o2) 19*sqrt(5) + 2*3 (%i3) 5*sqrt(5)+5*sqrt(3)+2*sqrt(75)+2*sqrt(45)+3*sqrt(5)+3*sqrt(3); 5/2 (%o3) 34*sqrt(5) + 2*3 (%i4)  >Comment By: Dieter Kaiser (crategus) Date: 20110823 01:50 Message: I have got the error. It is simply a variable which has to be reset to the value 1. The variable is set by a side effect in a predicate and in special situations like the examples of this bug report the variable is not reseted to the value 1 which causes the bug. I will commit the correction. Dieter Kaiser  Comment By: Dieter Kaiser (crategus) Date: 20110823 00:32 Message: Thank you very much for this bug report. This is really a very silly bug. We have an additional simplification of expressions because of another bug in the main simplifier. But thousand of tests in the testsuite had not shown this silly error. This is correct: (%i1) 5*sqrt(5)+6*sqrt(5); (%o1) 11*sqrt(5) This is correct too: (%i2) 5*sqrt(5)+sqrt(3)+6*sqrt(5); (%o2) 11*sqrt(5)+sqrt(3) This is wrong: (%i3) 5*sqrt(5)+2*sqrt(3)+6*sqrt(5); (%o3) 16*sqrt(5)+2*sqrt(3) Again this is correct: (%i4) 5*sqrt(5)+3*sqrt(3)+6*sqrt(5); (%o4) 11*sqrt(5)+3^(3/2) Again this is wrong: (%i5) 5*sqrt(5)+4*sqrt(3)+6*sqrt(5); (%o5) 26*sqrt(5)+4*sqrt(3) It is wrong for a term n*sqrt(3) with n an even integer. I have a look at the algorithm to correct the error as sone as possible. Dieter Kaiser  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3396631&group_id=4933 