Ticket #5026: trac-5026.patch

File trac-5026.patch, 1.0 KB (added by craigcitro, 14 years ago)
  • sage/rings/polynomial/complex_roots.py

    # HG changeset patch
    # User Craig Citro <craigcitro@gmail.com>
    # Date 1232716498 28800
    # Node ID daa90769ff1093afc4e69d5331032b7b26d8c10f
    # Parent  f8fb0bf3e547d65a0f90f5b27d543c8cf4ca9da0
    Fix numerical noise in complex_roots (trac #5026).
    
    diff -r f8fb0bf3e547 -r daa90769ff10 sage/rings/polynomial/complex_roots.py
    a b  
    268268        sage: complex_roots(x^5 - x - 1)
    269269        [(1.167303978261419?, 1), (0.181232444469876? + 1.083954101317711?*I, 1), (0.181232444469876? - 1.083954101317711?*I, 1), (-0.764884433600585? + 0.352471546031727?*I, 1), (-0.764884433600585? - 0.352471546031727?*I, 1)]
    270270        sage: complex_roots(x^2 + 27*x + 181)
    271         [(-14.61803398874990?..., 1), (-12.38196601125010? + 0.?e-27*I, 1)]
     271        [(-14.61803398874990?..., 1), (-12.3819660112501...? + 0.?e-27*I, 1)]
    272272
    273273        sage: K.<im> = NumberField(x^2 + 1)
    274274        sage: eps = 1/2^100