 LIB "tropical.lib";
==> Welcome to polymake version
==> Copyright (c) 19972015
==> Ewgenij Gawrilow, Michael Joswig (TU Darmstadt)
==> http://www.polymake.org
ring r=(0,t),(x,y),lp;
// f is already in Weierstrass form
poly f=y2+yx+3yx32x24x6;
weierstrassForm(f);
==> x32*x2+xy4*x+y2+3*y6
// g is not, but wg is
poly g=x+y+x2y+xy2+1/t*xy;
poly wg=weierstrassForm(g);
wg;
==> x3+2*x2+1/(t)*xyx+y2
// but it is not yet simple, since it still has an xyterm, unlike swg
poly swg=weierstrassForm(g,1);
swg;
==> x3+(8t21)/(4t2)*x2x+y2
// the jinvariants of all three polynomials coincide
jInvariant(g);
==> (4096t12+12288t1013056t8+5632t6816t4+48t21)/(16t10t8)
jInvariant(wg);
==> (4096t12+12288t1013056t8+5632t6816t4+48t21)/(16t10t8)
jInvariant(swg);
==> (4096t12+12288t1013056t8+5632t6816t4+48t21)/(16t10t8)
// the following curve is elliptic as well
poly h=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3;
// its Weierstrass form is
weierstrassForm(h);
==> x3+1728*x+y2+27648
