all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: jay.p.belanger@gmail.com,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel@gnu.org
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	[thread overview]
Message-ID: <877fnqs9gp.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <83k2rq77vv.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Sep 2015 17:31:48 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
>> Date: Wed, 16 Sep 2015 09:21:40 -0400
>> Cc: Jay Belanger <jay.p.belanger@gmail.com>
>> 
>> -*- 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



      reply	other threads:[~2015-09-16 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150916005352.1277.32898@vcs.savannah.gnu.org>
     [not found] ` <E1Zc0yu-0000LD-Ah@vcs.savannah.gnu.org>
2015-09-16 13:21   ` [Emacs-diffs] master 2667d5c: Add new functions for the root mean square of a (Calc) vector Stefan Monnier
2015-09-16 13:46     ` David Kastrup
2015-09-16 14:14       ` Stefan Monnier
2015-09-16 13:55     ` Jay Belanger
2015-09-16 14:31     ` Eli Zaretskii
2015-09-16 14:52       ` David Kastrup [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fnqs9gp.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jay.p.belanger@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.