Quotient and remainder polynomials for polynomial division

To compute, for two given real polynomials A(x) and B(x), the
quotient polynomial Q(x) and the remainder polynomial R(x) of
A(x) divided by B(x).
The polynomials Q(x) and R(x) satisfy the relationship
A(x) = B(x) * Q(x) + R(x),
where the degree of R(x) is less than the degree of B(x).

DA (input) INTEGER
The degree of the numerator polynomial A(x). DA >= -1.
DB (input/output) INTEGER
On entry, the degree of the denominator polynomial B(x).
DB >= 0.
On exit, if B(DB+1) = 0.0 on entry, then DB contains the
index of the highest power of x for which B(DB+1) <> 0.0.
A (input) DOUBLE PRECISION array, dimension (DA+1)
This array must contain the coefficients of the
numerator polynomial A(x) in increasing powers of x
unless DA = -1 on entry, in which case A(x) is taken
to be the zero polynomial.
B (input) DOUBLE PRECISION array, dimension (DB+1)
This array must contain the coefficients of the
denominator polynomial B(x) in increasing powers of x.
RQ (output) DOUBLE PRECISION array, dimension (DA+1)
If DA < DB on exit, then this array contains the
coefficients of the remainder polynomial R(x) in
increasing powers of x; Q(x) is the zero polynomial.
Otherwise, the leading DB elements of this array contain
the coefficients of R(x) in increasing powers of x, and
the next (DA-DB+1) elements contain the coefficients of
Q(x) in increasing powers of x.

Warning Indicator

IWARN INTEGER
= 0: no warning;
= k: if the degree of the denominator polynomial B(x) has
been reduced to (DB - k) because B(DB+1-j) = 0.0 on
entry for j = 0, 1, ..., k-1 and B(DB+1-k) <> 0.0.