#10803: critical bug in real_roots
--------------------------------------+-------------------------------------
       Reporter:  zimmerma            |         Owner:  jason, jkantor
           Type:  defect              |        Status:  needs_review  
       Priority:  critical            |     Milestone:  sage-5.1      
      Component:  numerical           |    Resolution:                
       Keywords:  real roots, sd40.5  |   Work issues:                
Report Upstream:  N/A                 |     Reviewers:                
        Authors:  Paul Zimmermann     |     Merged in:                
   Dependencies:                      |      Stopgaps:                
--------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Paul Zimmermann', 'oldvalue': ''}):

  * keywords:  real roots => real roots, sd40.5
  * status:  new => needs_review
  * author:  => Paul Zimmermann


Comment:

 I found out that reducing the Bernstein coefficients to integers fixes the
 two instances of this bug (the one in the description and the one from
 comment [comment:8]). Maybe it does not solve all instances, but it is
 better than nothing, and it should not hurt to work with integers instead
 of rationals.

 I suggest reviewers try to find other instances, for example with:
 {{{
 from sage.rings.polynomial.real_roots import real_roots
 R.<x> = ZZ[]
 B=10^11
 for i in range(10^6):
    f = R.random_element((i%13)+1,-B,B)
    print f
    sys.stdout.flush()
    n = len(real_roots(f,seed=-1))
    for s in range(1000):
       if len(real_roots(f,seed=s))<>n:
          print f, n, s
          sys.stdout.flush()
          raise ValueError
 }}}

 Paul

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10803#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to