polyroot behaviour

tgs77m--- via R-help <[email protected]>
Newsgroups gmane.comp.lang.r.general
Message-ID <[email protected]>
Colleagues,

g <- function(x) ( x^11 + 1000*x^10 + 500 *x^9 + 1 )
coeffs <- c(1, rep(0, 8), 500, 1000, 1)
roots <- polyroot(coeffs)

Output

[1]    0.25770068+3.958197e-01i
 [2]   -0.34615184+3.782848e-01i
 [3]   -0.04089779-4.838134e-01i
 [4]    0.44124314-1.517731e-01i
 [5]   -0.04089779+4.838134e-01i
 [6]   -0.56201931-1.282822e-01i
 [7]   -0.34615184-3.782848e-01i
 [8]    0.44124314+1.517731e-01i
 [9]   -0.56201931+1.282822e-01i
[10]    0.25770068-3.958197e-01i
[11] -999.49974975+1.110223e-16i

[11] -999.49974975+1.110223e-16i  makes  no sense since f>0 for all x

Why does polyroot do this?

Thomas Subia
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.