From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neon Absentius Newsgroups: gmane.emacs.help Subject: Bug in Calc? (was Re: Non-commutative symbolic multiplication in Calc) Date: Tue, 6 Sep 2005 21:33:48 +0000 Message-ID: <20050906213348.GE12694@SDF.LONESTAR.ORG> References: <87hdcydkvh.fsf@vh213602.truman.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126042896 7912 80.91.229.2 (6 Sep 2005 21:41:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2005 21:41:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 06 23:41:28 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EClA7-0000sw-Rk for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Sep 2005 23:39:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EClEd-0001zq-FX for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Sep 2005 17:44:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EClDE-0001VC-CD for help-gnu-emacs@gnu.org; Tue, 06 Sep 2005 17:42:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EClDB-0001TE-8N for help-gnu-emacs@gnu.org; Tue, 06 Sep 2005 17:42:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EClD9-0001RB-2w for help-gnu-emacs@gnu.org; Tue, 06 Sep 2005 17:42:35 -0400 Original-Received: from [192.94.73.21] (helo=sdf.lonestar.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ECl8r-0008MN-Q8 for help-gnu-emacs@gnu.org; Tue, 06 Sep 2005 17:38:10 -0400 Original-Received: from sdf.lonestar.org (IDENT:absent@otaku.freeshell.org [192.94.73.2]) by sdf.lonestar.org (8.13.1/8.12.10) with ESMTP id j86LXmfB011983 for ; Tue, 6 Sep 2005 21:33:48 GMT Original-Received: (from absent@localhost) by sdf.lonestar.org (8.13.1/8.12.8/Submit) id j86LXmE9014495 for help-gnu-emacs@gnu.org; Tue, 6 Sep 2005 21:33:48 GMT Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: Neon Absentius , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87hdcydkvh.fsf@vh213602.truman.edu> User-Agent: Mutt/1.4.2.1i X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29271 Archived-At: On Tue, Sep 06, 2005 at 03:03:30PM -0500, Jay Belanger wrote: > > Neon Absentius writes: > > > Sorry if this is not the right list for this question. > > > > Is there a way to suspend some of the automatic simplifications that > > calc performs? In particular I am interested in suspending the > > assumption that multiplication is commutative. > > Does matrix mode ("m v") do what you want? Yes and no! I mean if it would do what the info describes I would be happy. I don't think that the assumption all variables are matrices really says much more than "distinct variables do not necessarily commute", so that would be exactly what I was looking for. Alas there seems to be a bug: After I give 'm v' if I ask calc to simplify the expression 'a b - b a' it leaves it as is which is as expected. However when I ask it to expand '(a+b)^2' it returns 'a^2 + 2 b a + b^2' which is of course wrong if a and b don't commute. This happens both with emacs-multi-tty (22.0.50) and whith emacs 21.4.1 on a Debian testing/unstable. The bug manifsts itself also for the expansion of '(a+b)^3' however calc expands '(x+y)(x-y)' into 'x^2 + y x - x y + y^2'. Strange! I attach the "Trail buffer" ,---- | Emacs Calculator v2.1 by Dave Gillespie | 1 | alg' (x + y)^2 | simp (x + y)^2 | simp (x + y)^2 | expa x^2 + 2 * y * x + y^2 | derv 2 * x + 2 * y | alg' (a + b)^2 | expa a^2 + 2 * b * a + b^2 | alg' (a + b)^2 | expa a^2 + 2 * b * a + b^2 | alg' (b + a)^2 | expa b^2 + 2 * a * b + a^2 | alg' a | alg' b | alg' b | aprt b | alg' a | * b * a | 3 | alg' a | * b * a | * a * b | - b * a - a * b | simp b * a - a * b | simp b * a - a * b | alg' (b + a)^2 | expa b^2 + 2 * a * b + a^2 | alg' (a + b)^3 | expa a^3 + 3 * b * a^2 + 3 * b^2 * a + b^3 | alg' (x - y) * (x + y) | expa x^2 + x * y - y * x - y^2 | alg' (a - b) * (b + a) | expa a * b + a^2 - b^2 - b * a | alg' a * b | alg' b * a | + a * b + b * a `---- -- Most precious among the relics remaining of Peter's skeleton in the Vatican are 29 fragments of one of his skulls. (St. Peter's other skull is preserved in a reliquary at the Cathedral of St. John Lateran.) -- Frank R. Zindler, "Of Bones and Boners"