From: SourceForge.net <noreply@so...>  20100128 16:36:54

Bugs item #2937182, was opened at 20100122 14:05 Message generated for change (Settings changed) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2937182&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: None Group: None >Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Dmitry Kirzhanov (kirzhanov) Assigned to: Nobody/Anonymous (nobody) Summary: Assume does not always affect ratsimp/fullratsimp result Initial Comment: First, assume that x>=0: assume(x>=0); facts(); // returns x>=0 is(fullratsimp(sqrt(x^2))=x); // returns TRUE Now, forget about x>=0 and assume x<0: forget(x>=0); assume(x<0); facts(); // returns 0>x is(fullratsimp(sqrt(x^2))=x); // returns FALSE Is the expected result here TRUE instead of FALSE? For me this result is unexpected. It was achieved using the SAGE 4.3 system which is shipped with Maxima 5.20. I'm not sure this bug is related to Maxima, but it seems so. The behavior of this Maxima 5.20 built into the SAGE system differs from behavior of Maxima 5.17.1 which was used by me previously. Because of such difference I receive not exactly incorrect, but slightly different results in the newer version of Maxima. Thus it seems to me that the results given by the latest version can be simplified at higher degree. Cheers, Dima  >Comment By: Dieter Kaiser (crategus) Date: 20100128 17:36 Message: Because I have no experience with SAGE I had a look at the online notebook of SAGE. I have switched the notebook in a Maxima mode. This is my session: sage: assume(x<0) [x<0] sage: sqrt(x^2) /*sqrt(x^2) does not simplify */ sqrt(x^2) sage: domain /* domain is complex by default */ complex sage: domain:real /* Change to real */ real sage: sqrt(x^2) /* Maxima simplifies */ x Ok, the point is that SAGE sets the global option variable domain to COMPLEX. The default value of Maxima is REAL. This is the reason for a different simplification behaviour. I had not recognised that SAGE might have different default values. (The reported testsuite results do not show any serious problems.) Closing this bug report. Dieter Kaiser  Comment By: Dmitry Kirzhanov (kirzhanov) Date: 20100124 15:19 Message: Finally, I found out how to read the output of build_info() and bug_report() commands. Here it is: build_info() returns Maxima version: 5.19.1 Maxima build date: 19:14 1/15/2010 host type: i686pclinuxgnu lispimplementationtype: ECL lispimplementationversion: 9.10.2 Previously I could not read the output of the diagnostic tools because it for some reason was not printed by the notebook (HTMLbased) interface to SAGE. The output above and below was copied from the Sage's command line, and not from the notebook interface. Here is the output from run_testsuite(); command. It seems that I did not get a valid Maxima executable after my compilation. This may be the cause of an incompatible LISP implementation: Running tests in rtestnset: 519/519 tests passed. Running tests in rtest1: 106/106 tests passed. Running tests in rtest1a: 24/24 tests passed. Running tests in rtest2: 56/56 tests passed. Running tests in rtest4: 89/89 tests passed. Running tests in rtest5: 52/52 tests passed (not counting 1 expected errors). Running tests in rtest6: 4/4 tests passed. Running tests in rtest6a: 56/56 tests passed. Running tests in rtest6b: 16/16 tests passed. Running tests in rtest7: 44/44 tests passed. Running tests in rtest9: 83/83 tests passed (not counting 1 expected errors). Running tests in rtest9a: 22/22 tests passed. Running tests in rtest10: 46/46 tests passed (not counting 2 expected errors). Running tests in rtest11: 135/135 tests passed. Running tests in rtest13: 24/24 tests passed. Running tests in rtest13s: 17/17 tests passed. Running tests in rtest14: 352/352 tests passed (not counting 2 expected errors). Running tests in rtest15: 250/250 tests passed. Running tests in rtest16: ********************** Problem 173 *************** Input: 60 2  1 float()  1 60 2 Result:  1.110223024625157e16 This differed from the expected result: 0.0 ********************** Problem 174 *************** Input: 1000 2  1 float()  1 1000 2 Result:  1.110223024625157e16 This differed from the expected result: 0.0 229/231 tests passed. The following 2 problems failed: (173 174) Running tests in rtestode: 68/68 tests passed. Running tests in rtestode_zp: 30/30 tests passed. Running tests in rtest3: 131/131 tests passed. Running tests in rtest8: 132/132 tests passed. Running tests in rtest12: 78/78 tests passed (not counting 2 expected errors). Running tests in rexamples: 136/136 tests passed. Running tests in rtesthyp: 258/258 tests passed. Running tests in rtest_hypgeo: 248/248 tests passed (not counting 2 expected errors). Running tests in rtestmt19937: 15/15 tests passed. Running tests in rtest_allnummod: 501/501 tests passed (not counting 4 expected errors). Running tests in rtestconjugate: 133/133 tests passed. Running tests in rtestsum: 300/300 tests passed (not counting 4 expected errors). Running tests in rtest_trig: 136/136 tests passed. Running tests in rtest_zeta: 18/18 tests passed. Running tests in rtest_diff_invtrig: 22/22 tests passed. Running tests in rtest_scalarp: 20/20 tests passed. Running tests in rtest_everysome: 84/84 tests passed. Running tests in rtestint: 192/192 tests passed. Running tests in rtestifactor: 25/25 tests passed. Running tests in rtest_equal: 199/199 tests passed (not counting 2 expected errors). Running tests in rtest_abs: 70/70 tests passed. Running tests in rtest_taylor: 138/138 tests passed (not counting 12 expected errors). Running tests in rtest_dot: 55/55 tests passed. Running tests in rtest_mset: 59/59 tests passed. Running tests in rtest_boolean: 116/116 tests passed (not counting 2 expected errors). Running tests in rtest_round: 99/99 tests passed. Running tests in rtest_map: 99/99 tests passed (not counting 3 expected errors). Running tests in rtest_sign: 254/254 tests passed (not counting 11 expected errors). Running tests in rtest_algebraic: 45/45 tests passed. Running tests in rtest_gamma: 693/693 tests passed. Running tests in rtest_expintegral: 185/185 tests passed. Running tests in rtest_signum: 30/30 tests passed. Running tests in rtest_lambert_w: 34/34 tests passed. Running tests in rtest_elliptic: 74/74 tests passed. Running tests in rtest_integrate: 740/740 tests passed. Running tests in rtest_integrate_special: 50/50 tests passed. Error summary: Errors found in /home/damir/workspace/bin/sage/local/share/maxima/5.19.1/tests/rtest16.mac, problems: (173 174) real time : 588.362 secs run time : 526.572 secs gc count : 3743 times consed : 7162000420988 bytes (%o0) done By the way, none of the tests says that there is a problem with algebraic expression simplification like the discussed one. Will it be reasonable or useful to add this or similar case to any groups of tests?  Comment By: Dmitry Kirzhanov (kirzhanov) Date: 20100124 10:29 Message: Here are some commands to see how variable type and assumptions affect the resulting expression: assume(x<0); # returns [x<0] facts(); # returns [0>x] sqrt(x^2); # returns sqrt(x^2) declare(x,complex); # returns done facts(); # returns [0>x,kind(x,complex)] sqrt(x^2); # returns sqrt(x^2) remove(x,complex); # returns done declare(x,real); # returns done facts(); # returns [0>x,kind(x,real)] sqrt(x^2); # returns sqrt(x^2) forget(x<0); assume(x>=0) facts(); # [kind(x,real),x>=0] sqrt(x^2); # returns x To build my copy of Maxima I downloaded latest source package from this page: http://www.sagemath.org/downloadsource.html and compiled it using the supplied makefile (by issuing ./make). I could not use precompiled binaries since my CPU did not support some flag used compiled binaries from this page: http://www.sagemath.org/downloadlinux.html The compilation was carried out on Ubuntu Linux 9.10 with latest updates. Please tell me if there are any details (e.i. compilers and their versions) that I can mention here. I'm new to Maxima and absolutely new to LISP and thus I don't know what does matter and what does not. The following message is printed when I execute command !maxima in the sage command prompt: ;;; Loading #P"/home/damir/workspace/bin/sage/local/lib/ecl/defsystem.fas" ;;; Loading #P"/home/damir/workspace/bin/sage/local/lib/ecl/cmp.fas" ;;; Loading #P"/home/damir/workspace/bin/sage/local/lib/ecl/sysfun.lsp" Maxima 5.19.1 http://maxima.sourceforge.net Using Lisp ECL 9.10.2 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. but as I mentioned before, neither build_info() nor bug_report() provide any output. A similar case (but not equivalent to the one discussed here) may be discussed here http://trac.sagemath.org/sage_trac/ticket/2095 (But it this ticket the Maxima behavior seems to be adequate.) http://groups.google.com/group/sagesupport/browse_thread/thread/9759a893a56b7148/6d5d0e31353d1ef6 I thought this might be Maxima problem. But since you cannot reproduce it, this might be the cause of compiler/version choice or interaction with Sage. I'm not yet approved to make posts at SAGE group on Google Groups membership [http://groups.google.com/group/sagesupport] but I have applied and I wish to post this case there for discussion soon. By the way, if I terminate Maxima command with dollar sign $, Maxima (and maybe also Sage) hangs.  Comment By: Dieter Kaiser (crategus) Date: 20100123 17:34 Message: Sorry, I have overseen that you already have given the information that you use Maxima with SAGE 4.3. I have never used used Maxima in this enviroment. Therefore, I do not know what is expected for commands like bug_report() or run_testsuite(). Dieter Kaiser  Comment By: Dieter Kaiser (crategus) Date: 20100123 15:23 Message: Thank you very much for your report. It is helpful to find problems in Maxima. First, I had a look at the implementation of the simplification of sqrt(x^2) in Maxima 5.14, 5, 15, ... 5,20post. All versions simplifies sqrt(x^2) > x if x<0, Second, in all versions sqrt(x^2) is not simplified to x if the symbol is declared to be complex in addition. That is the declaration declare(x,complex). This might be a contradiction to the assumption that x is a negative real, but Maxima does not signal a problem. Please, can you have a look if your symbol is declared to be complex. You can use the command facts() to see it. (%i2) declare(x,complex); (%o2) done (%i3) facts(); (%o3) [kind(x, complex)] Furthermore, I do not understand why you do not get information from the commands build_info() and bug_report() and no results from the testsuite. You should get something like the following: (%i1) run_testsuite(); Running tests in rtestnset: 535/535 tests passed. Running tests in rtest1: 106/106 tests passed. Running tests in rtest1a: 24/24 tests passed. Running tests in rtest2: 56/56 tests passed. Running tests in rtest4: 89/89 tests passed. Running tests in rtest5: 51/51 tests passed. Running tests in rtest6: 4/4 tests passed. Running tests in rtest6a: 52/52 tests passed. Running tests in rtest6b: 16/16 tests passed. Running tests in rtest7: 44/44 tests passed. ... Perhaps, there is specific problem with your installation of Maxima. From which place do you have got your Maxima package? What Maxima interface your are using? Dieter Kaiser  Comment By: Dmitry Kirzhanov (kirzhanov) Date: 20100123 14:07 Message: On my compilation command sequence assume(x<0); sqrt(x^2); gives output sqrt(x^2), and *not* x. Command ratsimp also does not affect this expression. Version information: Maxima 5.19.1, Using Lisp ECL 9.10.2. I could not get any output from function bug_report() or build_info(). Command run_testsuite() retuns 'done'.  Comment By: Dieter Kaiser (crategus) Date: 20100122 19:55 Message: For a negative symbol x Maxima simplifies the sqrt function the following way: (%i1) assume(x<0)$ (%i2) sqrt(x^2); (%o2) x The function fullratsimp is not needed and does not change anything for this example. We always get for this example: (%i3) is(sqrt(x^2)=x); (%o3) true The only way I have found to get the reported oberservation is to give the variable x a positive value. (Maxima does not give an error if we assign a positive value to a symbol which is assumed to be negative). (%i6) x:10; (%o6) 10 Now the sqrt function simplifies to a positive value: (%i7) sqrt(x^2); (%o7) 10 We get false for the example from above: (%i9) is(sqrt(x^2)=x); (%o9) false I think there is no real problem. Setting the status to pending and the resoltution to invalid. Dieter Kaiser  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2937182&group_id=4933 