public Polynomial add(Polynomial x) {
        int len = coeff.length > x.coeff.length ? coeff.length : x.coeff.length;
        long[] c = new long[len];
        for (int i = 0; i < c.length; i++) {
            if (i < coeff.length) {
                if (i < x.coeff.length) {
                    c[i] = PF.add(coeff[i], x.coeff[i]);
                } else {
                    c[i] = coeff[i];
                }
             } else {
                c[i] = x.coeff[i];
             }
        }
        return new Polynomial(c);
    }