`sdiv', `sdivm', `srem', `sremm', `sqr', `sqrm'
-----------------------------------------------

sdiv(POLY1,POLY2[,V])
sdivm(POLY1,POLY2,MOD[,V])
     :: Quotient of POLY1 divided by POLY2 provided that the division
     can be performed within polynomial arithmetic over the rationals.

srem(POLY1,POLY2[,V])

sremm(POLY1,POLY2,MOD[,V])
     :: Remainder of POLY1 divided by POLY2 provided that the division
     can be performed within polynomial arithmetic over the rationals.

sqr(POLY1,POLY2[,V])

sqrm(POLY1,POLY2,MOD[,V])
     :: Quotient and remainder of POLY1 divided by POLY2 provided that
     the division can be performed within polynomial arithmetic over
     the rationals.

RETURN
     `sdiv()', `sdivm()', `srem()', `sremm()' : polynomial `sqr()',
     `sqrm()' : a list `[quotient,remainder]'

POLY1 POLY2
     polynomial

V
     indeterminate

MOD
     prime

   * Regarding POLY1 as an uni-variate polynomial in the main variable
     of POLY2, i.e. var(POLY2) (V if specified), `sdiv()' and `srem()'
     compute the polynomial quotient and remainder of POLY1 divided by
     POLY2.

   * `sdivm()', `sremm()', `sqrm()' execute the same operation over
     GF(MOD).

   * Division operation of polynomials is performed by the following
     steps: (1) obtain the quotient of leading coefficients; let it be
     Q; (2) remove the leading term of POLY1 by subtracting, from
     POLY1, the product of Q with some powers of main variable and
     POLY2; obtain a new POLY1; (3) repeat the above step until the
     degree of POLY1 become smaller than that of POLY2.  For
     fulfillment, by operating in polynomials, of this procedure, the
     divisions at step (1) in every repetition must be an exact
     division of polynomials.  This is the true meaning of what we say
     "division can be performed within polynomial arithmetic over the
     rationals."

   * There are typical cases where the division is possible: leading
     coefficient of POLY2 is a rational number; POLY2 is a factor of
     POLY1.

   * Use `sqr()' to get both the quotient and remainder at once.

   * Use `idiv()', `irem()' for integer quotient.

   * For remainder operation on all integer coefficients, use `%'.

     [0] sdiv((x+y+z)^3,x^2+y+a);
     x+3*y+3*z
     [1] srem((x+y+z)^2,x^2+y+a);
     (2*y+2*z)*x+y^2+(2*z-1)*y+z^2-a
     [2] X=(x+y+z)*(x-y-z)^2;
     x^3+(-y-z)*x^2+(-y^2-2*z*y-z^2)*x+y^3+3*z*y^2+3*z^2*y+z^3
     [3] Y=(x+y+z)^2*(x-y-z);
     x^3+(y+z)*x^2+(-y^2-2*z*y-z^2)*x-y^3-3*z*y^2-3*z^2*y-z^3
     [4] G=gcd(X,Y);
     x^2-y^2-2*z*y-z^2
     [5] sqr(X,G);
     [x-y-z,0]
     [6] sqr(Y,G);
     [x+y+z,0]
     [7] sdiv(y*x^3+x+1,y*x+1);
     divsp: cannot happen
     return to toplevel

References
     *Note `idiv irem': idiv irem, *Note `%': %.

