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

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

[Octave-bug-tracker] [bug #42742] polygcd fails valid test


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #42742] polygcd fails valid test
Date: Sun, 05 Oct 2014 16:48:36 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #7, bug #42742 (project octave):

Attached is a changeset to fix the test.  It a simple change to the test
itself to make it more suitable for the computation, i.e., scaling the
magnitude of the random polynomial roots down by a factor of three or so. 
Scaling by ten (original) puts the coefficients way out of reasonable bounds. 
Ten roots with std of ten puts the largest coefficient somewhere arount 10^8
compared to the lead coefficient of 1.

I changed the scaling factor systematically down and increased the number of
trials to 100,000.  With a scaling factor of 5, the 100,000 tests consistently
failed.  With a scaling factor of 4, the 100,000 tests passed and then a rare
failure occurred in the second attempt.

The track I initially followed with the computation of roots rather than using
deconv (which uses filter) just didn't seem to work.  The existing routine has
much better numerical accuracy than using the roots command, even though it
too might not be the best solution.  I think it is a case of the roots command
(which uses eig) not being very good.  Try some examples, e.g.,


octave:118> roots(poly([3 3 3 3]))
ans =

   3.0005 + 0.0000i
   3.0000 + 0.0005i
   3.0000 - 0.0005i
   2.9995 + 0.0000i


So, I suggest staying with the existing algorithm but add the tweak of the
test.  Also, consider looking into the behavior of roots/eig as a summer
project.


(file #32226)
    _______________________________________________________

Additional Item Attachment:

File name: octave-polygcd-2014oct05.patch Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42742>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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