Kevin Ryde on Mon, 18 May 2020 08:55:26 +0200

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

Re: Efficient way to define and evaluate polynomial function

Bill Allombert <> writes:
> my(P=(2*n^6 + 6*n^5 + 5*n^4 - n^2)); sumn_5(n)=subst(P,'n,n)/12

Is an inline polynomial literal like 2*'n^6 + ... recognised by gp as a
constant?  Or usually better P to ensure the object created only once?
Oh, and the same for smallish vectors or matrices?