octave-maintainers
[Top][All Lists]
Advanced

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

Re: Anyone familiar with polygcd?


From: Daniel J Sebald
Subject: Re: Anyone familiar with polygcd?
Date: Sun, 05 Oct 2014 11:55:49 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 08/05/2014 03:26 PM, Rik wrote:
On 08/05/2014 10:30 AM, John W. Eaton wrote:
On 07/07/2014 01:57 PM, Rik wrote:
All,

I'm getting occasional failures from the test code in polygcd.  It seems to
happen about 10% of the time according to the following code:

for i = 1:100
    bm(i) = test ("polygcd");
endfor
sum (bm)

The test that fails is

%!test
%! for ii=1:10
%!   p  = (unique (randn (10, 1)) * 10).';
%!   p1 = p(3:end);
%!   p2 = p(1:end-2);
%!   assert (polygcd (poly (-p1), poly (-p2)), poly (- intersect (p1, p2)),
sqrt (eps));
%! endfor


[snip]

Michael Godfrey filed a bug report with some more information
(https://savannah.gnu.org/bugs/?42742).

I put a simple changeset with that bug report. It changes the "* 10" multiplier above to "* 3" and I've not seen a failure with 100,000 tests. When the multiplier is 10, there are so many roots significantly greater than 1 that the coefficients of poly(-p) become very large making the polygcd() routine fail. From what I can tell, the underlying algorithm is better than others I've tried.

Dan



reply via email to

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