Bill Allombert on Wed, 12 Mar 2003 20:46:28 +0100

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

Re: subst()

On Wed, Mar 12, 2003 at 02:27:09PM -0500, Walter Neumann wrote:
> subst(p,x^2,x) may be useless, but subst(p,x^2,y) is not.

I think Igor was concerned by allowing this when p is not a
q(x^2) instead of raising an error.

When p(x)=q(x^2) it does make sense, but it make no harm
to have substpol for this case.

Beside there is a technical issue. PARI 2.1 has 
{"subst",26,(void*)gsubst,7,"GnG"} where PARI 2.2 has

The new definition cause GP2C to produce less efficient code
because it cannot know what the second argument is.

> On Wed, 12 Mar 2003, Igor Schein wrote:
> > > What's wrong with this ? [ x^2 - x - 1 --> (x - x) - 1 = -1 ]
> >
> > As far as I'm concerned, the above is a correct but also a useless
> > operations.  I don't see where anyone would use it.  For me an error
> > would be more useful, detecting that I'm doing something wrong by
> > mistake.