In this code:
sparse_polynom<big_int> pol1 = "2*x^2+x+1";
sparse_polynom<big_int> pol2 = "4*x+1";
std::cout << "\n" << resultant(pol1, pol2);//output: 14
std::cout << "\n" << resultant(pol2, pol1);//output: 3
function resultant() returns different values with different order of arguments.
Revision: Trunk #249.
trunk #325
Discovered another bug with that code sample. If it is compiled in x64 configuration, the execution leads to infinite recursion in Arageli::pow template function.
Update to my previous comment.
The configuration was Test x64. In Test Win32 I saw the same behavior that was mentioned by the originator.
Created a new branch to investigate and fix this: branches/bug_2655678_invalid_resultant #344.
The problem was narrowed down to subresultants_nonmodular function which should compute chain of subresultants for two polynomials. It should have resultant as s[0], where s is a vector with obtained subresultants.
Reassigned to Nikolai Zolotykh to inform about the problem and ask for people who have expertise in the topic and can consult me to fix subresultants_nonmodular function. Please read all comments first.
Implemented workaround in trunk #377: just replaced resultant computation from subresultant chains to Silvester's matrix determinant computation.
Since resultant function works fine now, changed the title for this bug and removed it from group Rlease 2.2.8.