Polyroots bad answer

Polyroots bad answer - roots of cubic equation gives wrong answer - 消息

#1 已发布: 2012/7/17 02:54:33
litus321pr

litus321pr

0个赞,共5个帖子。

组: User

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

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2012/7/18 03:04:29
litus321pr

litus321pr

0个赞,共5个帖子。

组: 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.
  • 有新帖
  • 无新帖