From: SourceForge.net <no...@so...> - 2008-06-02 03:40:00
|
Bugs item #1981623, was opened at 2008-06-02 12:39 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=1981623&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: Open Resolution: None Priority: 5 Private: No Submitted By: Satoshi Adachi (satoshi_adachi) Assigned to: Nobody/Anonymous (nobody) Summary: wrong sign of sqrt() Initial Comment: Dear Developers of Maxima, I found that sqrt() returns the incorrect expression that has the sign opposite to the ture expression when some certain argument is given to sqrt(). Namely, sqrt() interprets incorrectly the database that is prepared by assume(). Here is an demonstration program: ------------------------------------------------------------------------------- /* * wrong_sign_of_sqrt.maxima * * S.Adachi 2008/06/01 */ display2d:false; assume(x >= 0, x <= 1); correct_result_1:sqrt((x-1)^2); correct_result_2:sqrt(1/(x-1)^2); correct_result_3:sqrt(a*(x-1)^2); incorrect_result_1:sqrt(a/(x-1)^2); incorrect_result_2:sqrt(a^2/(x-1)^2); incorrect_result_3:sqrt(x^2/(x-1)^2); /* END */ ------------------------------------------------------------------------------- The result of execution is as follows: ------------------------------------------------------------------------------- Maxima 5.14.0cvs http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL) 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. (%i1) batch(wrong_sign_of_sqrt.maxima) batching #p/Volumes/HFS+2/home/adachi/work/299/wrong_sign_of_sqrt.maxima (%i2) display2d : false (%o2) false (%i3) assume(x >= 0,x <= 1) (%o3) [x >= 0,x <= 1] (%i4) correct_result_1:sqrt((x-1)^2) (%o4) 1-x (%i5) correct_result_2:sqrt(1/(x-1)^2) (%o5) 1/(1-x) (%i6) correct_result_3:sqrt(a*(x-1)^2) (%o6) sqrt(a)*(1-x) (%i7) incorrect_result_1:sqrt(a/(x-1)^2) (%o7) sqrt(a)/(x-1) (%i8) incorrect_result_2:sqrt(a^2/(x-1)^2) (%o8) abs(a)/(x-1) (%i9) incorrect_result_3:sqrt(x^2/(x-1)^2) (%o9) x/(x-1) (%o10) "wrong_sign_of_sqrt.maxima" ------------------------------------------------------------------------------- I wonder why sqrt() returns the wrong expression if sqrt((x-1)^2) appears in the denominator of some fraction in the argument that is more complex than some threshold (e.g. the numerator is not a simple number or something like that). I think that this is a very severe bug of sqrt() and the database that is prepared by assume(). This bug puts many user programs to the state producing many wrong results. Please fix this severe bug. Sincerely yours, Satoshi Adachi ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1981623&group_id=4933 |