octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56884] mean can overflow


From: Michael Godfrey
Subject: [Octave-bug-tracker] [bug #56884] mean can overflow
Date: Mon, 16 Sep 2019 11:04:51 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36

Follow-up Comment #8, bug #56884 (project octave):

Marco,

Your code looks good. But, careful testing would be a
good idea.

There are choices about how to handle the various
algorithms for evaluating mean(x).

First, it would be good to decide on what algorithms should
be implemented, and it should be decided which should be
the default. A suggestion would be to provide at
least your iterative and also Kahan's algorithm which is
given in pseudocode at:
https://en.wikipedia.org/wiki/Kahan_summation_algorithm
and the simple code as is.

The choice of the default deserves some thought and testing.
I would be tempted to suggest the Kahan algorithm based on
its robustness (this would tend to help people who have not
thought much about it and just expect "right" answers no matter
what input values they use). It may be that your iter_mean is
faster, but I do not know.. 

Anyhow, your code (with suitable text for the Manual) should
be installed.

Thanks!



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56884>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]