Function: hyperellminimalmodel
Section: elliptic_curves
C-Name: hyperellminimalmodel
Prototype: GDG
Help: hyperellminimalmodel(C,{pr}): C being a nonsingular integral
 hyperelliptic model of a curve, return an integral model of C with minimal
 discriminant.  If pr is given, it must be a list of primes and the model is
 then only garanteed minimal at the elements of pr.
 C can be given either by a squarefree polynomial P such that
 C:y^2=P(x) or by a vector [P,Q] such that C:y^2+Q(x)*y=P(x) and Q^2+4P is
 squarefree.
Doc:
 $C$ being a nonsingular integral hyperelliptic model of a curve,
 return an integral model of $C$ with minimal discriminant.
 If $pr$ is given, it must be a list of primes and
 the model is then only garanteed minimal at the elements of $pr$.
 The output is a two-component vector $[W,m]$ where $W$ is the new model and
 $m$ gives the mapping from the original model to the new one.
 $M$ is a three-component vector $[e,[a,b;c,d],H]$ such that
 if $(x,y)$ is a point on $W$, the corresponding point on $C$ is given by
 $$
   x_C = (a*x+b)/(c*x+d)
 $$
 $$
   y_C = (e*y+H(x))/(c*x+d)^{g+1}
 $$
 where $g$ is the genus.
 $C$ can be given either by a squarefree polynomial $P$ such that
 $C: y^2 = P(x)$ or by a vector $[P,Q]$ such that
 $C: y^2 + Q(x)\*y = P(x)$ and $Q^2+4\*P$ is squarefree.
 \bprog
 ? W = [x^6+216*x^3+324,0];
 ? D = hyperelldisc(W)
 %2 = 1828422898924853919744000
 ? M = hyperellminimalmodel(W)
 %3 = [[2*x^6+18*x^3+1,-x^3],[18,[3,0;0,1],-9*x^3]]
 ? hyperelldisc(M[1])
 %4 = 29530050606000
 @eprog
