Open tueda opened 7 years ago
One more example:
Mathematica: echo "Factor[x^385-1] // Print;" | math11.0
real 0m0.648s
user 0m0.379s
sys 0m0.137s
Pari/GP: echo "factor(x^385-1)" |gp -q -f
real 0m0.058s
user 0m0.050s
sys 0m0.008s
This is and example of the fact that for FORM we have only limited manpower for these kind of things. If you have a mathematician in the team who is specialized in these things, that part of the program will be better. If you have enough people you can built in more heuristics. I take it that x^n-1 for large values of n can be categorized as such. In view of the lack of much manpower, the design in FORM was to have it work as good as possible for the things we run into most of the time and not so much extended (semi)artificial benchmarks. Jan Kuipers told me once that the code in mathematica for Groebner basis was longer than the whole of FORM. We were at that time trying to see whether we could program Groebner bases and ran into similar things that on special examples mathematica was much faster. It just meant that they were not just following the regular algorithms, but had programmed lots of ‘shortcuts’.
Of course, if we see a way to improve algorithms, we will. And it would be really nice if somebody has a nice package that could be fit in in the form of a library. (like GMP and zlib). Till then, the factorization is just there to avoid that you have to call external programs with all the mess involved. It works, but unfortunately it is not the best.
I hope this explains the situation.
Jos
On 1 jun. 2017, at 12:02, Andrey Pikelner notifications@github.com wrote:
One more example:
Mathematica: echo "Factor[x^385-1] // Print;" | math11.0
real 0m0.648s user 0m0.379s sys 0m0.137s Pari/GP: echo "factor(x^385-1)" |gp -q -f
real 0m0.058s user 0m0.050s sys 0m0.008s — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/189#issuecomment-305448543, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEmk87sgK9rhH5enI-TVg_JGkWKhjks5r_ow2gaJpZM4NsSHY.
I guess now the problem here is not in heuristics but sounds just Berlekamp vs. Cantor-Zassenhaus, but agree that's the lack of manpower.
I found how to (roughly) factorize x^n - 1
. It's a heuristic.
https://www.math.iupui.edu/~ccowen/OldCoursePages/Math300F07/300F07Quiz4.pdf
Maybe this is just due to differences on algorithms, but it may be interesting to think about the reason why there is a big performance difference on polynomial factorization among programs in the market. Here is a benchmark test to factorize
x^385-1
.FORM
GiNaC
Mathematica
Note that Mathematica takes ~ 0.6s for the startup.
Summary