Bill Allombert on Wed, 28 Jul 2021 10:27:12 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Turning a polynomial into a function?


On Wed, Jul 28, 2021 at 04:46:07PM +1000, Alasdair McAndrew wrote:
> I have a polynomial p in x returned by "polinterpolate", so that p is
> of type t_POL..  The only way I've found of turning it into a function is
> with
> 
> > p2(y) = subst(p, 'x,  y)
> 
> Is this the best, or standard way to do it?

Yes, it is fine.

If you do not know the variable of your polynomial, you can use
variable(p):  subst(p, variable(p),  y)

You can also arrange for p2 to be a closure with respect to p.

Cheers,
Bill.