// Apply evaluation homomorphism and calculate GCD |#1 0xb7efcb23 in GiNaC::gcd (a=@0xbfffec40, ex cp, cq; | b=@0xbfffec50, ca=0xbfffebd0, cb=0xbfffebf0, ex gamma = heur_gcd(p.subs(x == xi, subs_options::no_pa| check_args=false) ttern), q.subs(x == xi, subs_options::no_pattern), &cp, &cq| at ../../ginac-1.3.1-orig/ginac/normal.cpp:1462 , var+1).expand(); |#2 0x08049cd2 in main (argc=1, argv=0xbfffed24) if (!is_exactly_a(gamma)) { | at gcd_bugreport.cpp:16 |(gdb) call a.dbgprint() // Reconstruct polynomial from GCD of mapped polynomi|-y^2+x^2 als |(gdb) call b.dbgprint() ex g = interpolate(gamma, xi, x, maxdeg); |-y^4+x^4 |(gdb) call gc.value.debug_print() // Remove integer content |(cl_I) 1 g /= g.integer_content(); |(gdb) call g.dbgprint() |-y^2+x^2 // If the calculated polynomial divides both p and q,|(gdb) call lc.dbgprint() this is the GCD |-1 ex dummy; |(gdb) call ca->dbgprint() if (divide_in_z(p, g, ca ? *ca : dummy, var) && divid|1 e_in_z(q, g, cb ? *cb : dummy, var)) { |(gdb) call cb->dbgprint() g *= gc; |y^2+x^2 // I think one needs just return g; here [-A.S.] |(gdb) ex lc = g.lcoeff(x); | if (is_exactly_a(lc) && ex_to(lc)| .is_negative()) | return -g; |[No File] [RO]------------------------- 0,0-1 ------- All else |int main(int argc, char** argv) return g; |{ } | symbol x("x"); } | symbol y("y"); | ex a = pow(x,2) - pow(y,2); // Next evaluation point | ex b = pow(x,4) - pow(y, 4); xi = iquo(xi * isqrt(isqrt(xi)) * numeric(73794), numer| ex ca, cb; ic(27011)); | cout << "GCD(" << a << ", " << b << ") = "; } | ex ab_gcd = gcd(a, b, &ca, &cb, false); return (new fail())->setflag(status_flags::dynallocated);| cout << ab_gcd << endl; } | cout << "a cofactor: " << ca << endl; | cout << "b cofactor: " << cb << endl; |