Generalized method that solves for quenching polynomial coefficients to work on input vectors of arbitrary dimension