It might be overkill for this use case, but you can also use the
extremely nice real_roots functions that give guaranteed intervals and
multiplicities:
sage: from sage.rings.polynomial.real_roots import *
sage: x = polygen(ZZ)
sage: real_roots((x^2 + 1) * (x^2 - x - 1))
[((-3/4, -1/8), 1), ((1/2, 7/4), 1)]
You can restrict to certain intervals, and go to arbitrary precision:
sage: real_roots((x^2 + 1) * (x^2 - x - 1),max_diameter=1/10^14,
bounds = [0,2])
[((295594915476877884107369019065608127654139919973/182687704666362864775460604089535377456991567872,
605378386896645906651894226927171110065727063886243/374144419156711147060143317175368453031918731001856),
1)]
Or converting the first end of the interval to a numeric value:
sage:[N(q[0][0],200) for q in real_roots((x^2 + 1)*(x^2 - x -
1),max_diameter=1/10^14, bounds = [0,2])]
6180339887498948482045824713181755587457888095347418966031
-Marshall Hampton