Polyroots bad answer

Polyroots bad answer - roots of cubic equation gives wrong answer - Messages

#1 Posted: 7/17/2012 2:54:33 AM
litus321pr

litus321pr

0 likes in 5 posts.

Group: User

When calculing roots of x^3-x^2-x+1 using polyroots gives wrong answer.
polyroots bug
#2 Posted: 7/17/2012 6:55:13 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

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!"
#3 Posted: 7/18/2012 3:04:29 AM
litus321pr

litus321pr

0 likes in 5 posts.

Group: User

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.
  • New Posts New Posts
  • No New Posts No New Posts