Karim BELABAS on Tue, 13 Nov 2001 23:16:04 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: pari-2.2.1.alpha released |
On Fri, 26 Oct 2001, Ilya Zakharevich wrote: > If I use > > { subst_poly(pol, from, to) = > local(t='subst_poly_t); > subst(lift(Mod(pol,from-t),t),t,to) > } > > subst_poly(x^3+1, x^2+1,y) > > I get > > Mod((y - 1)*x + 1, x^2 + (-y + 1)) > > instead of (y - 1)*x + 1 which I want. Probably I misunderstand the > intent of the second argument to lift. > > I want to hint it to lift that it should get rid of Mod(*,from-t), and > not of "something else". How to do it? { subst_poly(pol, from, to) = local(t='subst_poly_t, M); M = from - t; subst(lift(Mod(pol,M), variable(M)),t,to) } > P.S. BTW, would the subroutine above work OK if given polynomials > including t? It should. Karim. -- Karim Belabas email: Karim.Belabas@math.u-psud.fr Dep. de Mathematiques, Bat. 425 Universite Paris-Sud Tel: (00 33) 1 69 15 57 48 F-91405 Orsay (France) Fax: (00 33) 1 69 15 60 19 -- PARI/GP Home Page: http://www.parigp-home.de/