| Karim BELABAS on Mon, 8 Feb 1999 12:16:27 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: transforming a monic polynomial |
[Igor:]
> Hi, is there a command in gp to quickly convert a non-monic polynomial
> into a monic one? nfinit(pol,2).pol would do, but it becomes
> senseless when poldisc is big and hard to factor. I thought
> poltschirnhaus(pol) would work, but it doesn't always return monic
> polynomials.
There isn't. Use the following (e.g. read from .gprc) :
pol_to_monic(x) = \\ if version < 2.0.13, replace with
{ local(a,v); \\ { pol_to_monic(x, /* locals: */ a,v) =
a = pollead(x);
v = variable(x);
subst(x,v,v/a) * a^(poldegree(x) - 1);
}
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://hasse.mathematik.tu-muenchen.de/ntsw/pari/