 LIB "tropical.lib";
ring r=(0,t),(x,y),lp;
// f is already in Weierstrass form
poly f=y2+yx+3yx32x24x6;
weierstrassForm(f);
// g is not, but wg is
poly g=x+y+x2y+xy2+1/t*xy;
poly wg=weierstrassForm(g);
wg;
// but it is not yet simple, since it still has an xyterm, unlike swg
poly swg=weierstrassForm(g,1);
swg;
// the jinvariants of all three polynomials coincide
jInvariant(g);
jInvariant(wg);
jInvariant(swg);
// the following curve is elliptic as well
poly h=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3;
// its Weierstrass form is
weierstrassForm(h);
