Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline litus321pr  
#1 Posted : 17 July 2012 09:54:33(UTC)
litus321pr

Rank: Newbie

Groups: Registered
Joined: 01/09/2011(UTC)
Posts: 5
Location: Puerto Rico

When calculing roots of x^3-x^2-x+1 using polyroots gives wrong answer.
polyroots bug

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 17 July 2012 13:55:13(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

Why do you consider the result obtained by polyroots() to be wrong?

As we all know, cubic polynomial has three roots. You get them [-1,1,1] using polyroots(), although by ignoring the imaginary parts which are quite small and you could ignore them. The small imaginary parts might be due to the numerical procedure used to obtain the roots.

If we are in doubt about real or complex roots then Descartes' rule of signs could help us out.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline litus321pr  
#3 Posted : 18 July 2012 10:04:29(UTC)
litus321pr

Rank: Newbie

Groups: Registered
Joined: 01/09/2011(UTC)
Posts: 5
Location: Puerto Rico

Thank you for your quick comment, but I think that when you see complex numbers in the roots of the polynomial it may mislead you in the correctness of the solution. Honestly when I counter check with ti-89 it gave me complex roots too, but in a friend Hp 50g gave me correct roots {1,1,-1}. You are correct the algorithm used appears to be companion matrix.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.