1 | initial version |
Be specific on what kind of roots you want to find (rational ones? real ones? complex ones?)
sage: f=x^5-5*x^4-10*x^3-10*x^2-5*x-1
sage: f.roots(ring=RR)
[(6.72502395887258, 1)]
sage: f.roots(ring=CC)
[(6.72502395887258, 1),
(-0.461764344593279 - 0.161600091968187*I, 1),
(-0.461764344593279 + 0.161600091968187*I, 1),
(-0.400747634843009 - 0.678737070411573*I, 1),
(-0.400747634843009 + 0.678737070411573*I, 1)]
sage: f.roots(ring=QQbar)
[(6.725023958872576?, 1),
(-0.4617643445932788? - 0.1616000919681873?*I, 1),
(-0.4617643445932788? + 0.1616000919681873?*I, 1),
(-0.4007476348430091? - 0.6787370704115728?*I, 1),
(-0.4007476348430091? + 0.6787370704115728?*I, 1)]