From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Date: Wed, 16 Sep 2015 16:52:06 +0200 Message-ID: <877fnqs9gp.fsf@fencepost.gnu.org> References: <20150916005352.1277.32898@vcs.savannah.gnu.org> <83k2rq77vv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442415168 6824 80.91.229.3 (16 Sep 2015 14:52:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Sep 2015 14:52:48 +0000 (UTC) Cc: jay.p.belanger@gmail.com, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 16 16:52:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZcE4i-0001xa-PM for ged-emacs-devel@m.gmane.org; Wed, 16 Sep 2015 16:52:44 +0200 Original-Received: from localhost ([::1]:51233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcE4i-0004cs-31 for ged-emacs-devel@m.gmane.org; Wed, 16 Sep 2015 10:52:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcE4D-0004ZE-Fh for emacs-devel@gnu.org; Wed, 16 Sep 2015 10:52:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcE49-0007x3-JG for emacs-devel@gnu.org; Wed, 16 Sep 2015 10:52:13 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:43144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcE47-0007w2-FK; Wed, 16 Sep 2015 10:52:07 -0400 Original-Received: from localhost ([127.0.0.1]:56178 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZcE46-0007zD-Or; Wed, 16 Sep 2015 10:52:07 -0400 Original-Received: by lola (Postfix, from userid 1000) id 23CE7DF4A4; Wed, 16 Sep 2015 16:52:06 +0200 (CEST) In-Reply-To: <83k2rq77vv.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Sep 2015 17:31:48 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190018 Archived-At: Eli Zaretskii writes: >> From: Stefan Monnier >> Date: Wed, 16 Sep 2015 09:21:40 -0400 >> Cc: Jay Belanger >> >> -*- mode: nit-pick -*- >> >> > +Another commonly used mean, the RMS (root-mean-square), can be computed >> > +for a vector of numbers by using the @kbd{u R} >> >> I must admit that I don't use Calc very often, and read its manual even >> less often, so clearly I'm taking this out of context, but in any case: >> >> To me a "vector" has a rather specific meaning, and taking the root mean >> square of a vector doesn't make much sense. Instead, I like to take the >> rms of a *set* of numbers (which may be provided by packaging them in >> a vector, of course). > > As long as we are nit-picking, the result of root-mean-square > generally depends on the order of the values (due to finite precision > of FP calculations). So it's not really an unordered set. Calc generally calculates exact expressions unless you tell it not to. At any rate, the "squares" (for complex numbers, they should just be the sum of squares of real and imaginary part rather than a complex square) are actually all non-negative, so there is not a lot of cancellation going on. The precision of your result will be very slightly better if you do the summation from smallest to large. At any rate, given the amount of nits to be found by mailing list members, it might be prudent to employ the services of a debugger. -- David Kastrup