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

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

[Octave-bug-tracker] [bug #34266] Four issues with "residue" and residue


From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #34266] Four issues with "residue" and residuez"
Date: Sun, 11 Sep 2011 18:01:23 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20110109 Firebee/3.6.13

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

Thank you. I have rewritten your test to remove extraneous whitespace and
comments, which does exhibit a problem with residue. I think of all the work
you've done, this one is the clearest about showing the problem. It is
difficult for me to read your code with the very long lines of %'s and many
fprintfs.



z1 =  7.0372976777e6;
p1 = -3.1415926536e9;
p2 = -4.9964813512e8;
r1 = -(1 + z1/p1)/(1 - p1/p2)/p2/p1;
r2 = -(1 + z1/p2)/(1 - p2/p1)/p2/p1;
r3 = (1 + (p2 + p1)/p2/p1*z1)/p2/p1;
r4 = z1/p2/p1;
r = [r1; r2; r3; r4];
p = [p1; p2; 0; 0];
k = [];
e = [1; 1; 1; 2];
b = [1, z1];
a = [1, -(p1 + p2), p1*p2, 0, 0];
[br, ar] = residue (r, p, k, e);
assert (br, b, 1e-8);
assert (ar, a, 1e-8);



I have confirmed with Sage that indeed the polynomials returned by residue are
not monic as they should be. While we investigate this problem, I have pushed
the following change on the stable branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/d049192e5d15

While indeed arbitrarily dividing small by 1e3 solves the non-monic polynomial
problem for this test, I am sure that such absolute measures are not correct,
and we should pick small in a smarter way that takes relative size into
account. What do you suggest?

Further, even with that suggested change, your test fails because the
tolerance is too low for br and b. Is this also a bug with residue or should
your test allow for higher tolerance?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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