Size of bitwise OR between vectors represented as polynomials
It holds that $$\begin{align}|A \vee B|&amp;=d-1-|\overline{A \vee B}|\\
&amp;=d-1-|\overline A \wedge \overline B|
\end{align}$$

Define $K(x)$ as the polynomial of degree $d-1$ with all 1 coefficients. $\overline A$ can be represented as the polynomial $K(x)-A(x)$.

Thus the desired $|A \vee B|$ is obtained by subtracting from $d-1$ the coefficient for $x^{d-1}$ of the polynomial $(K(x)-A(x))\cdot(K(x)-\tilde B(x))$, where $\tilde B(x)$ is $B(x)$ with "inversion" of coefficients, that is the coefficient of degree $i$ becomes coefficient of degree $d-1-i$.

We can use polynomial addition rather than subtraction: $d-1$ minus the coefficient for $x^{d-1}$ of the polynomial $(A(x)+L(x))\cdot(\tilde B(x)+L(x))$ also works (where $L(x)$ is the polynomial of degree $d-1$ with all $-1$ coefficients).