
randpoly - creates a random polynomial

Calling sequence:
randpoly([ [ expr ...] ]   [ , ring ]  [ , option ]...)
ring    --->  Expr
ring    --->  IntMod( integer )
ring    --->  domain
option  --->  Terms = integer_1
option  --->  Degree = integer_1
option  --->  Coeffs = func

Parameter:
expr        --  expression
integer     --  integer larger than 1
domain      --  domain
integer_1   --  positive integer
func        --  function or procedure

Summary:

randpoly returns a random polynomialwith variables given by the list [expr...]
and coefficient domain ring. See poly for a detailed description of possible
variables and coefficient domains.

If the argument ring is missing Expr is used as default. If the list of variables
is missing [x] is used as default.

The polynomial is created by adding a given number of terms, where the
degrees of the variables and the coefficients are in a given range:

  o  With the option Terms = n the number of terms added may be defined.
     The default value is 6.

  o  With the option Degree = n the maximal degree of the variables may
     be defined. The default value ist 5.

  o  With the option Coeffs = f a function may be defined which is used
     to create random coefficients. The function will be called without any
     arguments, the result must be a valid coefficient.

     If this option is missing and ring is Expr, the coefficients will be random
     integers in the range -999 ...  999.  If ring is a user-defined domain it
     must have a method "random" to create the coefficients if no function
     is given.

>>  randpoly([z], Expr);

      poly(z^2*902 + z^3*470 + z^5*(-494) + 26, [z])

See also:  poly

