Function: hyperellred
Section: elliptic_curves
C-Name: hyperellred
Prototype: GD&
Help: hyperellred(C,{&m}): C being a nonsingular integral hyperelliptic model
 of a curve, return an integral model of C with the same discriminant but small
 coefficients. 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:
 Let $C$ be a nonsingular integral hyperelliptic model of a curve of positive
 genus $g > 0$. Return an integral model of $C$ with the same discriminant
 but small coefficients, using Cremona-Stoll reduction.

 The optional argument $m$ is set to the mapping from the original model to
 the new one, given by a three-component vector \kbd{[1,[a,b;c,d],H]}
 such that $a*d-b*c=1$ and if $(x,y)$ is a point on $W$, the corresponding
 point $(X,Y)$ on $C$ is given by
 $$
   X = (ax + b) / (cx + d), \quad
   Y = (y + H(x)) / (cx + d)^{g+1}.
 $$
 $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
 ? P = 1001*x^4 + 3704*x^3 + 5136*x^2 + 3163*x + 730;
 ? hyperellred(P, &m)
 %2 = [x^3 + 1, 0]
 ? hyperellchangecurve(P, m)
 %3 = [x^3 + 1, 0]
 @eprog

Variant:
 Also available is
 \fun{GEN}{ZX_hyperellred}{GEN P, GEN *M} where $C: y^{2} = P(x)$ and *M is
 set to \kbd{[a,b;c,d]}
