$SPAD/src/input davenport.input

J. Davenport, Y. Siret, E. Tournier

December 3, 2016

Abstract

Contents

2

— * —

)set break resume
)sys rm -f davenport.output
)spool davenport.output
)set message test on
)set message auto off
)clear all

--S 1 of 12
t1:=UP(x,FRAC INT)
--R
--R
--R   (1)  UnivariatePolynomial(x,Fraction(Integer))
--R                                                                 Type: Domain
--E 1
--S 2 of 12
quotient(p1:t1,p2:t1,n:NNI):Union("failed",t1) ==
  minimumDegree(p1) < minimumDegree(p2) => "failed"
  reste:UP(x,FRAC INT):=p1
  degp2:=minimumDegree(p2)
  coefp2:=coefficient(p2,degp2)
  quot:UP(x,FRAC INT):=0
  while degree(quot) < n repeat
    deg:=minimumDegree(reste)
    mon:=monomial(coefficient(reste,deg)/coefp2,deg-degp2)$UP(x,FRAC INT)
    reste:=reste-(mon*p2)
    quot:=quot+mon
  quot
--R
--R   Function declaration quotient : (UnivariatePolynomial(x,Fraction(
--R      Integer)),UnivariatePolynomial(x,Fraction(Integer)),
--R      NonNegativeInteger) -> Union("failed",UnivariatePolynomial(x,
--R      Fraction(Integer))) has been added to workspace.
--R                                                                   Type: Void
--E 2
--S 3 of 12
quotient(1,1+x,8)
--R
--R   Your expression cannot be fully compiled because it contains an
--R      integer expression (for - ) whose sign cannot be determined (in
--R      general) and so must be specified by you. Perhaps you can try
--R      substituting something like
--R                                  (- :: PI)
--R                                     or
--R                                 (- :: NNI)

--R      into your expression for - .
--R   AXIOM will attempt to step through and interpret the code.
--R   Compiling function quotient with type (UnivariatePolynomial(x,
--R      Fraction(Integer)),UnivariatePolynomial(x,Fraction(Integer)),
--R      NonNegativeInteger) -> Union("failed",UnivariatePolynomial(x,
--R      Fraction(Integer)))
--I   Compiling function G1504 with type Integer -> Boolean
--R
--R         8    7    6    5    4    3    2
--R   (3)  x  - x  + x  - x  + x  - x  + x  - x + 1
--R                   Type: Union(UnivariatePolynomial(x,Fraction(Integer)),...)
--E 3
--S 4 of 12
quotient(x**2-x+1,x**3-x-6/7,8)
--R
--R
--R   (4)
--R     84778967  8   18089477  7   2286095  6   166061  5   8281  4   4459  3
--R     -------- x  - -------- x  + ------- x  - ------ x  - ---- x  + ---- x
--R     10077696       1679616       279936       46656      7776      1296
--R   +
--R       889  2   91     7
--R     - --- x  + -- x - -
--R       216      36     6
--R                   Type: Union(UnivariatePolynomial(x,Fraction(Integer)),...)
--E 4
--S 5 of 12
ext1:=SAE(FRAC INT,UP(a,FRAC INT),a**2+a+1)
--R
--R
--R   (5)
--R  SimpleAlgebraicExtension(Fraction(Integer),UnivariatePolynomial(a,Fraction(In
--R  teger)),a^2+a+1)
--R                                                                 Type: Domain
--E 5
--S 6 of 12
e:ext1:=convert(((3/4)*a**2-a+(7/4))::UP(a,FRAC INT))
--R
--R
--R          7
--R   (6)  - - a + 1
--R          4
--IType: SimpleAlgebraicExtension(Fraction Integer,...
--E 6
--S 7 of 12
recip(e)

--R
--R
--R        28     44
--R   (7)  -- a + --
--R        93     93
--IType: Union(SimpleAlgebraicExtension(Fraction Integer,...
--E 7
--S 8 of 12
e**2
--R
--R
--R          105     33
--R   (8)  - --- a - --
--R           16     16
--IType: SimpleAlgebraicExtension(Fraction Integer,...
--E 8
--S 9 of 12
e:=convert((a**2-1)::UP(a,FRAC INT))
--R
--R
--R   (9)  - a - 2
--IType: SimpleAlgebraicExtension(Fraction Integer,...
--E 9
--S 10 of 12
p1:UP(x,ext1):=x**4+3*x**3+(2*a+1)*x**2+(3*a+3)*x-1
--R
--R
--R          4     3            2
--R   (10)  x  + 3x  + (2a + 1)x  + (3a + 3)x - 1
--IType: UnivariatePolynomial(x,SimpleAlgebraicExtension(...
--E 10
--S 11 of 12
p2:UP(x,ext1):=x**2+a+1
--R
--R
--R          2
--R   (11)  x  + a + 1
--IType: UnivariatePolynomial(x,SimpleAlgebraicExtension(...
--E 11
--S 12 of 12
p2/p1
--R
--R
--R              1
--R   (12)  -----------

--R          2
--R         x  + 3x + a
--IType: Fraction UnivariatePolynomial(x,SimpleAlgebraicExtension(...
--E 12
)spool
)lisp (bye)

———-

References

[DST88] J. H. Davenport, Y. Siret, and E. Tournier. Computer Algebra: Systems and Algorithms for Algebraic Computation. Academic Press, New York, NY, USA, 1988, ISBN 0-12-204230-1