SNAP - Maple Programming Help

Home : Support : Online Help : Mathematics : Numerical Computations : SNAP Package : SNAP/Quotient

SNAP

 Quotient
 compute the quotient of polynomial division
 Remainder
 compute the remainder of polynomial division

 Calling Sequence Quotient(a, b, x, 'r') Remainder(a, b, x, 'q')

Parameters

 a, b - univariate numeric polynomials in x x - name; indeterminate for a and b 'r', 'q' - (optional) unevaluated names; assigned remainder and quotient, respectively

Description

 • The Quotient command returns the numeric quotient of a divided by b.
 • The Remainder command returns the numeric remainder of a divided by b.
 • The numeric remainder r and numeric quotient q satisfy: $-bq+a-r$  is small with $\mathrm{degree}\left(r,x\right)<\mathrm{degree}\left(b,x\right)$. Here, small means $\mathrm{O}\left({10}^{-\mathrm{Digits}}\right)$.
 • If a fourth argument is included in the calling sequence for Quotient or Remainder, it is assigned the remainder r or quotient q, respectively.

Examples

 > $\mathrm{with}\left(\mathrm{SNAP}\right):$
 > $a≔-85{x}^{17}-55{x}^{9}-37{x}^{7}-35{x}^{2}+97x+50:$
 > $b≔79{x}^{5}+56{x}^{4}+49{x}^{3}+63{x}^{2}+57x-59:$
 > $r≔\mathrm{Remainder}\left(a,b,x,'q'\right)$
 ${r}{≔}{50.0020132327865}{}{{x}}^{{4}}{-}{19.3198166346738}{}{{x}}^{{3}}{-}{322.237747865981}{}{{x}}^{{2}}{+}{300.078717373004}{}{x}{+}{20.0352085974540}$ (1)
 > $q$
 ${-}{1.07594936708861}{}{{x}}^{{12}}{+}{0.762698285531165}{}{{x}}^{{11}}{+}{0.126714113893627}{}{{x}}^{{10}}{+}{0.295146883006482}{}{{x}}^{{9}}{-}{0.119722722703334}{}{{x}}^{{8}}{-}{1.55310796081941}{}{{x}}^{{7}}{+}{1.41800886004233}{}{{x}}^{{6}}{-}{0.0646951159943625}{}{{x}}^{{5}}{+}{0.0154956351481724}{}{{x}}^{{4}}{-}{0.0704903789877322}{}{{x}}^{{3}}{-}{2.55944186458305}{}{{x}}^{{2}}{+}{2.95135053578343}{}{x}{-}{0.507877820382135}$ (2)
 > $q≔\mathrm{Quotient}\left(a,b,x\right)$
 ${q}{≔}{-}{1.07594936708861}{}{{x}}^{{12}}{+}{0.762698285531165}{}{{x}}^{{11}}{+}{0.126714113893627}{}{{x}}^{{10}}{+}{0.295146883006482}{}{{x}}^{{9}}{-}{0.119722722703334}{}{{x}}^{{8}}{-}{1.55310796081941}{}{{x}}^{{7}}{+}{1.41800886004233}{}{{x}}^{{6}}{-}{0.0646951159943625}{}{{x}}^{{5}}{+}{0.0154956351481724}{}{{x}}^{{4}}{-}{0.0704903789877322}{}{{x}}^{{3}}{-}{2.55944186458305}{}{{x}}^{{2}}{+}{2.95135053578343}{}{x}{-}{0.507877820382135}$ (3)
 > $\mathrm{expand}\left(a-bq-r\right)$
 ${-}{4.26325641456060}{}{{10}}^{{-14}}{}{{x}}^{{17}}{+}{2.84217094304040}{}{{10}}^{{-14}}{}{{x}}^{{12}}{+}{5.68434188608080}{}{{10}}^{{-14}}{}{{x}}^{{11}}{-}{1.86517468137026}{}{{10}}^{{-14}}{}{{x}}^{{10}}{+}{1.50990331349021}{}{{10}}^{{-14}}{}{{x}}^{{8}}{-}{5.68434188608080}{}{{10}}^{{-14}}{}{{x}}^{{6}}{-}{6.39488462184090}{}{{10}}^{{-14}}{}{{x}}^{{5}}{+}{3.55271367880050}{}{{10}}^{{-14}}{}{{x}}^{{9}}{-}{1.42108547152020}{}{{10}}^{{-14}}{}{{x}}^{{16}}{-}{1.24344978758018}{}{{10}}^{{-14}}{}{{x}}^{{15}}{-}{2.13162820728030}{}{{10}}^{{-14}}{}{{x}}^{{14}}{-}{9.41469124882133}{}{{10}}^{{-14}}{}{{x}}^{{13}}{+}{2.84217094304040}{}{{10}}^{{-14}}{}{x}$ (4)