faster minpoly computation