I want to substitute a variable with a number in multivariate polynomials. For example for the polynomial
$ P = (z^2+yz^3)x^2 + zx $
I want to substitute $z$ with $3$.
I have intuition how to do that algorithmatic: I have to regard the coefficients in $F[y,z]$ and make a recursive call of that method to obtain even more coeffcients in $F[z]$, substitute them and return the result to the "lower" recursiv calls. Is that a good idea? I'm not really interested in the formulation a real algorithm but more in the complexity of the substitution operation.
I think that the above sketched algorithm can be bound with $\mathcal{O}(\deg_x(P)\deg_y(P)\deg_z(P))$. Is that correct? The bound is not really strict. Any ideas for a stricter bound?
Our is there a faster algorithm which is used in practice? And what is its complexity?