From: SourceForge.net <no...@so...> - 2010-01-17 01:24:33
|
Bugs item #2852992, was opened at 2009-09-06 17:42 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2852992&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 - Simplification Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: sqrt(-1/x)-%i/sqrt(x) not zero Initial Comment: For any real value sqrt(-1/x) should simplify to %i/sqrt(x). We try a positive symbol and get a wrong sign: (%i1) assume(x>0)$ (%i2) sqrt(-1/x); (%o2) -%i/sqrt(x) This should be zero: (%i3) sqrt(-1/x)-%i/sqrt(x); (%o3) -2*%i/sqrt(x) For numbers all is correct. We get the expected answers for positive and negative numbers: (%i15) sqrt(-1/2)-%i/sqrt(2); (%o15) 0 (%i16) sqrt(-1/(-2))-%i/sqrt(-2); (%o16) 0 For a general real value we get a wrong simplification too: (%i18) kill(all)$ (%i1) expr:sqrt(-1/x)-%i/sqrt(x); (%o1) 1/sqrt(-x)-%i/sqrt(x) The expression is wrongly simplified. We should get zero for positive and negative numbers: (%i2) expr,x=2; (%o2) -sqrt(2)*%i (%i3) expr,x=-2; (%o3) 0 This bug is related to the bug ID: 1010768 "sqrt(1/z) - 1/sqrt(z) => 0". Dieter Kaiser ---------------------------------------------------------------------- >Comment By: Dieter Kaiser (crategus) Date: 2010-01-17 02:24 Message: Fixed in simp.lisp revision 1.96. For a real argument Maxima simplifies: (%i1) sqrt(-1/x); (%o1) %i/sqrt(x) The example of this bug report simplifies to zero: (%i2) sqrt(-1/x)-%i/sqrt(x); (%o2) 0 No simplification if the argument is complex: (%i3) declare(z,complex)$ (%i4) sqrt(-1/z); (%o4) sqrt(-1/z) Closing this bug report as fixed. Dieter Kaiser ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2852992&group_id=4933 |