Previous Page Next Page Contents

pdivide -- pseudo-division of polynomials

Introduction

pdivide(p, q) computes the pseudo-division of the univariate polynomials p and q.

Call(s)

pdivide(p, q <, mode>)
pdivide(f, g <, [x]> <, mode>)

Parameters

p, q - univariate polynomials of type DOM_POLY.
f, g - arithmetical expressions
x - an identifier or an indexed identifier. Multivariate expressions are regarded as univariate polynomials in the indeterminate x.

Options

mode - either Quo or Rem. With Quo, only the pseudo-quotient is returned; with Rem, only the pseudo-remainder is returned.

Returns

a polynomial, or a polynomial expression, or a sequence of an element of the coefficient ring of the input polynomials and two polynomials/polynomial expressions, or the value FAIL.

Overloadable:

p, q, f, g

Related Functions

content, degree, divide, factor, gcd, gcdex, ground, lcoeff, multcoeffs, poly

Details

Example 1

This example shows the result of the pseudo-division of two polynomials:

>> p:= poly(x^3 + x + 1):  q:= poly(3*x^2 + x + 1):
   [b, s, r] := [pdivide(p, q)]
               [9, poly(3 x - 1, [x]), poly(7 x + 10, [x])]

The result satisfies the following equation:

>> multcoeffs(p, b) = s*q + r
                   3                           3
           poly(9 x  + 9 x + 9, [x]) = poly(9 x  + 9 x + 9, [x])

Pseudo-quotients and pseudo-remainders can be computed separately:

>> pdivide(p, q, Quo), pdivide(p, q, Rem)
                  poly(3 x - 1, [x]), poly(7 x + 10, [x])
>> delete p, q, b, s, r:

Example 2

The coefficient ring can be an arbitrary ring, e.g., the residue class ring of integers modulo 8:

>> pdivide(poly(x^3 + x + 1, IntMod(8)), 
           poly(3*x^2 + x + 1, IntMod(8)))
      1, poly(3 x - 1, [x], IntMod(8)), poly(- x + 2, [x], IntMod(8))

Example 3

Here the input consists of multivariate polynomial expressions which are regarded as univariate polynomials in x:

>> pdivide(x^3 + x + y, a*x^2 + x + 1, [x])
                  2            2
                 a , a x - 1, a  y + x (a (a - 1) + 1) + 1

Example 4

The first argument cannot be converted to a polynomial. The return value is FAIL:

>> pdivide(1/x, x)
                                   FAIL

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000