I have both PPC and Intel installations of Octave. They both give the wrong
answer to this short script.
num = [1 0 1];
den = [1 0 18 0 81];
[a,p,k,e] = residue(num,den)
I did the math ...
(x^2+1)/(x^4+18*x^2+81) = (2/9)/(x-3i) + (2/9)/(x+3i) + (1/54i)/(x-3i)^2 -
(1/54i)/(x+3i)^2
Thus,
a = [1/54i 2/9 -1/54i 2/9]
p = [3i 3i -3i -3i]
k = []
e = [2 1 2 1]
However, my Intel version gives
a =
-3.0108e+06 - 1.9734e+06i
-3.0108e+06 + 1.9734e+06i
3.0108e+06 + 1.9734e+06i
3.0108e+06 - 1.9734e+06i
p =
-0.0000 + 3.0000i
-0.0000 - 3.0000i
0.0000 + 3.0000i
0.0000 - 3.0000i
k = [](0x0)
e =
1
1
1
1
and my PPC version gives
a =
8.4492e+06 - 3.9658e+06i
8.4492e+06 + 3.9658e+06i
-8.4492e+06 + 3.9658e+06i
-8.4492e+06 - 3.9658e+06i
p =
0.0000 + 3.0000i
0.0000 - 3.0000i
-0.0000 + 3.0000i
-0.0000 - 3.0000i
k = [](0x0)
e =
1
1
1
1
For reference, Matlab gives
a =
0 - 0.0926i
0.2222 - 0.0000i
0 + 0.0926i
0.2222 + 0.0000i
p =
0.0000 + 3.0000i
0.0000 + 3.0000i
0.0000 - 3.0000i
0.0000 - 3.0000i
k =
[]
A non-Fink installation for 2.9.14 produces the correct answer as well, see
the link below.
http://www.nabble.com/bug-in-residue.m-tf4475396.html
Can any confirm they get the same result?
p.s. I tried posting to the users list, but forgot to subscribe before doing
that. I'll try to delete that post from Nabble momentarily.
--
View this message in context:
http://www.nabble.com/Trouble-with-Octave-tf4502632.html#a12841449
Sent from the fink-beginners mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-beginners mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-beginners