Actually, I have a numpy question, and since we're on the topic ...
The following is somewhat frustrating:
sage: R = RDF['x']
sage: f = R([4, 4, 1, 4, 2, 0, 1])
sage: f.roots(algorithm='pari')
[(-1.0, 1), (-1.0, 1)]
sage: f.roots() # uses numpy
[]
sage: import numpy
sage: numpy.roots(f.reverse().list())
array([ 0.50000001 +1.32287567e+00j, 0.50000001 -1.32287567e+00j,
0.49999999 +1.32287564e+00j, 0.49999999 -1.32287564e+00j,
-1.00000000 +1.79471980e-08j, -1.00000000 -1.79471980e-08j])
I assume this comes down to the following:
sage: [ numpy.isreal(x) for x in numpy.roots(f.reverse().list()) ]
[False, False, False, False, False, False]
What's the easiest parameter to adjust so that we get those roots?
Note: this polynomial is clearly bad for a certain reason, namely that
it's the square of another polynomial.
-cc
--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---