#4282: [with patch, positive review] symbolic minpoly
-------------------------+--------------------------------------------------
Reporter: robertwb | Owner: robertwb
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.2.2
Component: calculus | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by ncalexan):
* summary: [with patch, needs review] symbolic minpoly => [with patch,
positive review] symbolic minpoly
Comment:
I do not like that 'algebraic' and 'numerical' are not parallel
constructions -- the parallel construction *WHICH APPEARS IN SOME OF THE
DOCTESTS!* is 'algebraic' and 'numeric'. I have attached a patch which
fixes the doctests but doesn't change it to 'numeric'. The patch does try
to help the user -- instead of testing algorithm='numerical' it tests if
algorithm starts with 'numeric'.
I like the results and the performance:
With patch:
{{{
sage: cos(pi/22).minpoly()
x^10 - 11/4*x^8 + 11/4*x^6 - 77/64*x^4 + 55/256*x^2 - 11/1024
sage: cos(pi/56).minpoly()
x^24 - 6*x^22 + 63/4*x^20 - 95/4*x^18 + 5813/256*x^16 - 917/64*x^14 +
3081/512*x^12 - 847/512*x^10 + 9323/32768*x^8 - 459/16384*x^6 +
175/131072*x^4 - 3/131072*x^2 + 1/16777216
}}}
Without patch:
{{{
sage: cos(pi/22).minpoly()
Traceback (most recent call last):
...
NotImplementedError: Could not prove minimal polynomial x^10 - 11/4*x^8 +
11/4*x^6 - 77/64*x^4 + 55/256*x^2 - 11/1024 (epsilon
3.14321532602626e-100)
sage: cos(pi/56).minpoly()
Traceback (most recent call last):
...
NotImplementedError: Could not prove minimal polynomial x^24 - 6*x^22 +
63/4*x^20 - 95/4*x^18 + 5813/256*x^16 - 917/64*x^14 + 3081/512*x^12 -
847/512*x^10 + 9323/32768*x^8 - 459/16384*x^6 + 175/131072*x^4 -
3/131072*x^2 + 1/16777216 (epsilon 2.29367823690213e-400)
}}}
With patch:
{{{
sage: %timeit sqrt(5).minpoly()
100 loops, best of 3: 14.3 ms per loop
sage: %timeit sqrt(sqrt(5)).minpoly()
10 loops, best of 3: 54 ms per loop
sage: %timeit sqrt(sqrt(5) + sqrt(2)).minpoly()
10 loops, best of 3: 115 ms per loop
}}}
Without patch:
{{{
sage: %timeit sqrt(5).minpoly()
10 loops, best of 3: 150 ms per loop
sage: %timeit sqrt(sqrt(5)).minpoly()
10 loops, best of 3: 174 ms per loop
sage: %timeit sqrt(sqrt(5) + sqrt(2)).minpoly()
10 loops, best of 3: 218 ms per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4282#comment:11>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---