> restart: > read( > "C:\\cygwin\\home\\erich\\Conferences\\05\\ACA\\Talk\\Maple\\initpkg.m > pl"): > with(protobox); [BM_step_mod, HybridInterp, NewtonInterp_step, bbpoly_mod, check_same, eval_mon_mod, eval_polyseq, eval_tmpprunelist_mod, find_max, find_true, heval_plist_mod, heval_pnt_mod, list_to_poly, prune, raising_pnts_mod, recover, relocate_c, relocate_shift_c, rev, rm_element, slice, spoly_to_slist, tmpprune, tmpprunelist_to_plist, vansolve_kl_mod] > f:=3*x[1]^5*x[2]^3+2*x[1]^5+x[2]^2+5; 5 3 5 2 f := 3 x[1] x[2] + 2 x[1] + x[2] + 5 > bb:=bbpoly_mod(f,[x[1],x[2]]); bb := proc(pntsnf_i, modulusnf_i) local polynf, inf, numvarsnf, varlistnf; polynf := 3*x[1]^5*x[2]^3 + 2*x[1]^5 + x[2]^2 + 5; numvarsnf := 2; varlistnf := [x[1], x[2]]; polynf := `mod`( Eval(polynf, {seq(varlistnf[inf] = pntsnf_i[inf], inf = 1 .. numvarsnf)}), modulusnf_i); RETURN(polynf); end proc; > m:=nextprime(29); num_test:=25; correct:=0: incorrect:=0: err:=0: > bbcnt_all:=0: bbcnt_correct:=0: > for i from 1 to num_test do print(i,'-th'); # > result_poly:=traperror(HybridInterp(bb, > [x[1],x[2],x[3],x[4],x[5]],100,m,'Homogen'=false, > 'print_bbcnt'='num_bbprobe')); > if lasterror='lasterror' then > if 0 = modp(expand(result_poly-f),m) then > correct := correct + 1; > bbcnt_all := bbcnt_all + num_bbprobe; > bbcnt_correct := bbcnt_correct + num_bbprobe; > else > incorrect := incorrect + 1; > bbcnt_all := bbcnt_all + num_bbprobe; > fi; > else > err := err + 1; > fi; > od; print(`correct=`,correct); print(`incorrect=`,incorrect); > print(`error=`,err); > if not expand(err-num_test)=0 then if > not(correct=0) then print(`average bbcnt for correct results=`, > evalf(bbcnt_correct/correct)); fi; print (`overall average bbcnt=`, > evalf(bbcnt_all/(incorrect+correct))); fi; m := 31 num_test := 25 1, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 2, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 3, -th Warning: range of random number generator or the modulus might not be enough result_poly := In Zippel algorithm: different terms map to the same value, 1, times 4, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 5, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 6, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 7, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 8, -th Warning: range of random number generator or the modulus might not be enough result_poly := In Zippel algorithm: different terms map to the same value, 1, times 9, -th Warning: range of random number generator or the modulus might not be enough 2 3 result_poly := 1 + x[2] + 9 x[2] 10, -th Warning: range of random number generator or the modulus might not be enough 7 result_poly := 11 x[2] 11, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 12, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 13, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 14, -th Warning: range of random number generator or the modulus might not be enough result_poly := Interpolation Failure: dropped a non-zero term 15, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 16, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 17, -th Warning: range of random number generator or the modulus might not be enough result_poly := Interpolation Failure: dropped a non-zero term 18, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 19, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 20, -th Warning: range of random number generator or the modulus might not be enough 2 result_poly := -10 - 10 x[2] 21, -th Warning: range of random number generator or the modulus might not be enough result_poly := In Zippel algorithm: different terms map to the same value, 1, times 22, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 23, -th Warning: range of random number generator or the modulus might not be enough 5 3 5 2 result_poly := 3 x[1] x[2] + 2 x[1] + x[2] + 5 24, -th Warning: range of random number generator or the modulus might not be enough 2 3 3 result_poly := -10 - x[2] - 12 x[2] - x[1] + 4 x[1] x[2] 25, -th Warning: range of random number generator or the modulus might not be enough 5 2 result_poly := 3 x[1] - 12 - 11 x[2] correct=, 15 incorrect=, 5 error=, 5 average bbcnt for correct results=, 38. overall average bbcnt=, 35.