# [Maxima] RFC: extracting coefficients of a multivariate polynomial

Richard Fateman fateman at cs.berkeley.edu
Mon Apr 28 09:28:33 CDT 2008

```There is a command "horner"  which you might consider, especially if you
take the
result and convert it to a string, which could be used as C code.

This works for univariate polynomials; not sure what it means to have a
multivariate
horner's rule.

Good luck.

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of andre maute
> Sent: Monday, April 28, 2008 1:14 AM
> To: maxima at math.utexas.edu
> Subject: Re: [Maxima] RFC: extracting coefficients of a
> multivariate polynomial
>
> >>Well, this is quite a different problem.  If you need all
> the coefficients,
> >>why did you provide a list of the exponent vectors?
> >>You computed a huge list that was not necessary.
>
> the degrees in exps are also the appearing monomials in the
> polynomial,
>
> >>Could you tell us what is it that you are doing with the
> coefficients?
>
> I use maxima to generate polynomial shape functions
> for my finite element code (C++).
>
> I need the coefficients for generating a horner scheme (C++ Code),
>
> >>I am guessing that what you are doing could be done directly on the
> >>polynomial, and the
> >>extraction of the coefficients is unnecessary.
>
> The C++ Code has to evaluate the polynomials,
> so I have to teach my C++ Code how the polynomials are to be
> evaluated.
>
> And as I pointed out earlier this is done *once*,
> e.g when I add new polynomial shape function systems.
>
> This is only a maintainment optimization for me.
> At the moment I don't want to investigate this further.
>
> I only thought there could be a drop-in replacement
> for my function 'my_coeff' in maxima.
>
> Andre
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
```