Polyroots bad answer

Polyroots bad answer - roots of cubic equation gives wrong answer - Сообщения

#1 Опубликовано: 17.07.2012 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 Опубликовано: 17.07.2012 06:55:13
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 18.07.2012 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.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений