Mercurial > hg > octave-nkf
diff scripts/polynomial/polygcd.m @ 19416:5d3111977623
Change a polygcd test to one that is more numerically accurate (bug #42742).
* polygcd.m: Decreased the multiplier for the random polynomial coefficient
test and increased number of tests by a factor of ten.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Sun, 05 Oct 2014 11:23:25 -0500 |
parents | d63878346099 |
children | 4197fc428c7d |
line wrap: on
line diff
--- a/scripts/polynomial/polygcd.m +++ b/scripts/polynomial/polygcd.m @@ -91,10 +91,12 @@ %!assert (deconv (poly (1:8), polygcd (poly (1:8), poly (3:12))), poly (1:2), sqrt (eps)) %!test -%! for ii=1:10 -%! p = (unique (randn (10, 1)) * 10).'; +%! for ii=1:100 +%! ## Exhibits numerical problems for multipliers of ~4 and greater. +%! p = (unique (randn (10, 1)) * 3).'; %! p1 = p(3:end); %! p2 = p(1:end-2); -%! assert (polygcd (poly (-p1), poly (-p2)), poly (- intersect (p1, p2)), sqrt (eps)); +%! assert (polygcd (poly (-p1), poly (-p2)), +%! poly (- intersect (p1, p2)), sqrt (eps)); %! endfor