home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / misc / mas / mashelp / sacroot.def < prev    next >
Encoding:
Modula Definition  |  1989-10-11  |  13.6 KB  |  294 lines

  1.  
  2. (* SAC Polynomial Real Root Definition Module. *)
  3.  
  4. DEFINITION MODULE SACROOT;
  5.  
  6.  
  7. FROM MASSTOR IMPORT LIST;
  8.  
  9.  
  10. PROCEDURE IIC(A,AP,I,L: LIST): LIST; 
  11. (*Isolating interval conversion.  A is a squarefree univariate integral
  12. polynomial.  AP is the derivative of A.  I is an left open right closed
  13. interval (a,b) with binary rational endpoints represented by the list
  14. (a,b).  L is a list of isolating intervals with binary rational end-
  15. points for the real roots of A in I.  L=((a(1),b(1)), ...,(a(k),b(k))) 
  16. with a(1) le b(1) le  ... le a(k) le b(k) and (a(i), b(i)) 
  17. represents the open interval (a(i),b(i)) if a(i) lt
  18. b(i), the closed interval (a(i),b(i)) if a(i)=b(i).  LS is a
  19. list ((as(1),bs(1)), ...,(as(k),bs(k))) of isolating intervals for
  20. the same roots and satisfying the same conditions except that each pair
  21. (as(i),bs(i)) represents the left open right closed interval
  22. (as(i),bs(i)).*)
  23.  
  24.  
  25. PROCEDURE IPFSD(RL,A: LIST): LIST; 
  26. (*Integral polynomial factorization, second derivative.  A is a
  27. positive primitive integral polynomial in r variables of positive
  28. degree.  L is a list (a(1), ...,a(k)) where k ge 1, A equal to sum of
  29. a(i) for i=1, ...,k and, for each i, a(i) is a positive primitive
  30. integral polynomial of positive degree with deg(a(i)) le 2 or
  31. gcd(a(i),app(i))=1  where app(i) is the second derivative of a(i).*)
  32.  
  33.  
  34. PROCEDURE IPLRRI(L: LIST): LIST; 
  35. (*Integral polynomial list real root isolation.  L is a non-empty list
  36. (A sub 1 ,  ..., A sub n ) of distinct univariate integral polynomials
  37. which are positive, of positive degree, squarefree, and pairwise
  38. relatively prime.  M is a list (I sub 1 , B sub 1 , ..., I sub m ,
  39. B sub m ), where I sub 1  lt  I sub 2  lt   ...  lt  I sub m are
  40. strongly disjoint isolating intervals for all of the real roots of A eq
  41. prod from (j eq 1) to n (A sub j).  Each I sub i has binary
  42. rational number endpoints, and is either left-open and
  43. right-closed or is a one-point interval.  B sub i is the unique A
  44. sub j which has a root in I sub i.*)
  45.  
  46.  
  47. PROCEDURE IPRCH(A,I,KL: LIST): LIST; 
  48. (*Integral polynomial real root calculation, high precision.  A is a
  49. univariate integral polynomial of positive degree.  I is either the
  50. nulllist () or a standard interval or an interval whose positive and
  51. non-positive parts are standard.  k is a gamma-integer.  L is a
  52. list ((e(1),I(1)), ...,(e(r),I(r))) where the e(j) are
  53. beta-integers,  1 le e(1) le  ... le e(r), and the I(j) are binary
  54. rational isolating intervals, I(j)=(a(j),b(j)), for the r distinct
  55. real roots of A if I=(), or for the r distinct real roots of A in I if
  56. I ne ().  e(j) is the multiplicity of the root alpha(j) in I(j) and
  57. abs(b(j)-a(j))  le 2**k.  I(j) is a left-open and right-closed
  58. interval if a(j) lt b(j), a one-point interval if a(j)=b(j).*)
  59.  
  60.  
  61. PROCEDURE IPRCHS(A,I,KL: LIST): LIST; 
  62. (*Integral polynomial real root calculation, high-precision special.
  63. A is a positive, primitive, squarefree, univariate, integral polynomial
  64. of positive degrre with GCD(A,APP)=1.  I is either the null list () or
  65. a standard interval or an interval whose positive and non-positive parts
  66. are standard.  k is a gamma-integer.  L is a list (I(1), ...,I(r)) of
  67. binary rational isolating intervals I(j)=(a(j),b(j)) for the r
  68. distinct real roots of A if I=(), for the r distinct real roots of A
  69. of I if I ne (), with b(j)-a(j) le 2**kl.  I(j) is a left-open and
  70. right-closed interval if a(j) ne b(j), a one-point interval if
  71. a(j)=b(j).*)
  72.  
  73.  
  74. PROCEDURE IPRCNP(A,I: LIST;  VAR SLP,SLPP,J: LIST); 
  75. (*Integral polynomial real root calculation, newton method preparation.
  76. A is a positive, primitive, squarefree, univariate integral polynomial
  77. of positive degree.  I is an open interval (a1,a2) with binary
  78. rational endpoints containing no roots of AP and APP.  sp and spp,
  79. beta-integers, are the signs of AP and APP on I.  J is a subinterval
  80. (b1,b2) of I with binary rational endpoints, containing alpha and
  81. such that spp*SIGN(AP(b1)+f*AP(b2)) ge 0, where
  82. f=(-3/4)**(sp*spp).  J is a left-open and right-closed interval if
  83. b1 lt b2, the one-point interval if b1=b2.*)
  84.  
  85.  
  86. PROCEDURE IPRCN1(A,I,SL,KL: LIST): LIST; 
  87. (*Integral polynomial real root calcuation, 1 root.  A is a positive
  88. primitive univariate integral polynomial of positive degree. I is an
  89. open interval (a1,a2) with binary rational endpoints containing a
  90. unique root alpha of A and containing no roots of AP or APP.  s, a
  91. beta-integer, is the sign of AP*APP on I.
  92. min(abs(AP(a1)),abs(AP(a2))) le (3/4)*max(abs(AP(a1)),abs(AP(a2))).
  93. k is a beta-integer.  J is a subinterval of I of length 2**k or less
  94. containing alpha and with binary rational endpoints.*)
  95.  
  96.  
  97. PROCEDURE IPRIM(A: LIST): LIST; 
  98. (*Integral polynomial real root isolation, modified uspensky method.
  99. A is a non-zero squarefree univariate integral polynomial.  L is
  100. a list (I sub 1 , ..., I sub r ) of strongly disjoint isolating
  101. intervals for all of the real roots of A with I sub 1  lt  I
  102. sub 2  lt   ...  lt  I sub r.  Each I sub j has binary rational
  103. endpoints and is either left-open and right-closed or a one-point
  104. interval.*)
  105.  
  106.  
  107. PROCEDURE IPRIMO(A,AP,I: LIST): LIST; 
  108. (*Integral polynomial real root isolation, modified uspensky method,
  109. open interval.  A is a univariate integral polynomial without multiple
  110. roots.  AP is the derivative of A.  I is an open interval (a,b) with
  111. binary rational endpoints, represented by the list (a,b), such that
  112. there are integers h and k for which a=h*2**k and b=(h+1)*2**k.
  113. L is a list (I(1), ...,I(r)) of isolating intervals for the real roots
  114. of A in I.  Each I(j) is a left open right closed interval with binary
  115. rational endpoints and I(1) lt I(2) lt  ... lt I(r).*)
  116.  
  117.  
  118. PROCEDURE IPRIMS(A,AP,I: LIST): LIST; 
  119. (*Integral polynomial real root isolation, modified uspensky method,
  120. standard interval.  A is a univariate integral polynomial without
  121. multiple roots.  AP is the derivative of A.  I is a standard interval.
  122. L is a list (I(1), ...,I(r)) of isolating intervals for the real roots
  123. of A in I.  Each interval I(j) is a left open right closed interval
  124. (a(j),b(j)) with binary rational endpoints and I(1) lt I(2) lt  ...
  125. lt I(r).*)
  126.  
  127.  
  128. PROCEDURE IPRIMU(A: LIST): LIST; 
  129. (*Integral polynomial real root isolation, modified uspensky method,
  130. unit interval.  A is a squarefree univariate integral polynomial.  L is
  131. a list (I(1), ...,I(r)) of isolating intervals for all the roots of A
  132. in the left closed right open interval (0,1).  Each I(j) is a pair
  133. (a(j),b(j)) of binary rational numbers, with 0 le a(1) le b(1) le
  134.  ... le a(r) le b(r).  If a(j)=b(j) then (a(j),b(j))
  135. represents the one-point interval (a(j),b(j)).  If a(j) lt b(j)
  136. then the pair  (a(j),b(j)) represents the open interval
  137. (a(j),b(j)).*)
  138.  
  139.  
  140. PROCEDURE IPRIU(A: LIST): LIST; 
  141. (*Integral polynomial real root isolation, uspensky method.  A is a
  142. non-zero squarefree univariate integral polynomial.  L is a list of
  143. pairs  ((a(1),b(1)), ...,(a(k),b(k))) representing isolating
  144. intervals forall of the real roots of A, with a(1) le b(1) le  ... le
  145. a(k) le b(k).  If a(i) lt b(i) then the pair
  146. (a(i),b(i)) represents the open interval (a(i),b(i)), while
  147. if a(i)=b(i) then it represents the closed one-point interval
  148. (a(i),b(i)).  The a(i) and b(i) are rational numbers except
  149. that one may have a(1) equal to negative infinity, represented by
  150. -1/0, that is the pair (-1,0), and one may have b(k) equal to
  151. infinity, represented by 1/0.*)
  152.  
  153.  
  154. PROCEDURE IPRIUP(A: LIST): LIST; 
  155. (*Integral polynomial real root isolation, uspensky method, positive
  156. roots.  A is a non-zero squarefree univariate integral polynomial.  L
  157. is a list of pairs ((a(1),b(1)), ...,(a(k),b(k))) representing iso-
  158. lating intervals for the positive real roots of A, with a(1) le
  159. b(1) le  ... le a(k) le b(k).  If a(i) lt e(i) then the pair
  160. (a(i), b(i)) represents the open interval (a(i),b(i)) while if
  161. a(i)=b(i) then (a(i),b(i)) represents the closed one-point
  162. interval (a(i),b(i)).  The a(i) and b(i) are rational
  163. numbers except thatone may have b(k) equal to infinity, represented
  164. by 1/0, that is, the pair (1,0).*)
  165.  
  166.  
  167. PROCEDURE IPRRLS(A1,A2,L1,L2: LIST;  VAR LS1,LS2: LIST); 
  168. (*Integral polynomial real root list separation.  A1 and A2 are
  169. univariate integral polynomials with no multiple real roots and with
  170. no common real roots.  L1 and L2 are lists of isolating intervals for
  171. some or all of the real roots of A1 and A2, respectively.  The
  172. intervals in L1 and L2 have binary rational endpoints, and are either
  173. left-open and right-closed or one-point intervals. Let
  174. L1 eq (I sub 1,1 , ..., I sub (1,r sub 1) ),
  175. L2 eq (I sub 2,1 , ..., I sub (2,r sub 2) ).
  176. Then I sub 1,1  lt  I sub 1,2  lt   ...  lt  I sub (1,r sub 1)
  177. and  I sub 2,1  lt  I sub 2,2  lt   ...  lt  I sub (2,r sub 2) .
  178. L sub 1 sup *  eq (I sub 1,1 sup * , ..., I sub (1,r sub 1) sup * )
  179. and L sub 2 sup *  eq (I sub 2,1 sup * , ..., I sub (2,r sub 2) sup * ),
  180. where I sub i,j sup * is a binary rational subinterval of
  181. I sub i,j containing the root of A sub i in I sub i,j.
  182. Each I sub 1,j sup * is strongly disjoint from each
  183. I sub 2,j sup *.*)
  184.  
  185.  
  186. PROCEDURE IPRRS(A1,A2,I1,I2: LIST;  VAR IS1,IS2,SL: LIST); 
  187. (*Integral polynomial real root separation.  A1 and A2 are squarefree
  188. univariate integral polynomials of positive degrees.  I1 and I2
  189. are intervals with binary rational number endpoints, each of
  190. which is either left-open and right-closed, or a one-point interval.
  191. I1 contains a unique root alpha sub 1 of A1, and I2 contains a
  192. unique root alpha sub 2 ne alpha sub 1 of A2.  I sub 1 sup *
  193. and I sub 2 sup * are binary rational subintervals of I1 and I2
  194. containing alpha sub 1 and alpha sub 2 respectively, with
  195. I sub 1 sup * and I sub 2 sup * strongly disjoint.  If I1 is
  196. left-open and right-closed then so is I sub 1 sup *, and
  197. similarly for I2 and I sub 2 sup *.  s eq -1
  198. if I sub 1 sup *  lt  I sub 2 sup *, and s eq 1
  199. if I sub 1 sup *  gt  I sub 2 sup *.*)
  200.  
  201.  
  202. PROCEDURE IPSFSD(RL,A: LIST): LIST; 
  203. (*Integral squarefree factorization, second derivative.  A is a
  204. positive integral polynomial in r variables of positive degree L is a
  205. list ((e(1),A(1)), ...,(e(k),A(k))) where primitive part of A
  206. is equal to the sum of A(i)**e(i) for i=1, ...,k.  The a(i) are
  207. pairwise relatively prime squarefree positive polynomials of
  208. positive degrees, with deg(A(i))=1 or GCD(A(i),APP(i))=1 for all
  209. i where APP(i) is the second derivative of A(i) and the e(i) are
  210. positive beta-integers e(1) le e(2) le  ... le e(k).*)
  211.  
  212.  
  213. PROCEDURE IPSRM(A,I: LIST): LIST; 
  214. (*Integral polynomial strong real root isolation, modified uspensky
  215. method.  A is a univariate integral polynomial with multiple roots and
  216. with no real roots in common with APP.  I is either the null list () or
  217. a standard interval or an interval whose positive and non-negative
  218. parts are standard.  L is a list (I(1), ...,I(r)) of isolating intervals
  219. for  all the real roots of A if I=(), or for all the real roots of A in
  220. I if I ne ().  The intervals I(j) contain no roots of AP or APP, are
  221. left-open and right-closed, have binary rational endpoints, and
  222. satisfy I(1) lt I(2) lt  ... lt I(r).*)
  223.  
  224.  
  225. PROCEDURE IPSRMS(A,I: LIST): LIST; 
  226. (*Integral polynomial strong real root isolation, modified uspensky
  227. method, standard interval.  A is a univariate integral polynomial with
  228. no multiple real roots and with no real roots in common with APP.  I is
  229. a standard interval.  L is a list (I(1), ...,I(r)) of isolating
  230. intervals for the roots of A in I.  The intervals I(j) contain no
  231. roots of AP or APP, are left-open and right-closed, have binary rational
  232. endpoints, are subintervals of I, and satisfy I(1) lt I(2) lt  ...
  233. lt I(r).*)
  234.  
  235.  
  236. PROCEDURE IPVCHT(A: LIST): LIST; 
  237. (*Integral polynomial variations after circle to half-plane
  238. transformation.  A is a non-zero univariate integral polynomial.  Let
  239. n=deg(A), AP(x)=(x**n)*A(1/x), B(x)=AP(x+1).  k is the number of
  240. sign variations in the coefficients of B.*)
  241.  
  242.  
  243. PROCEDURE IUPRB(A: LIST): LIST; 
  244. (*Integral univariate polynomial root bound.  A is an integral poly-
  245. nomial of positive degree.  b is a binary rational number which is a
  246. root bound for A.  If A(x) is equal to the sum of a(i)*x(i)**i for
  247. i=0, ...,n, a(n) ne 0, then b is the smallest power of 2 such that
  248. 2*abs(a(n-k)/a(n))**(1/k) le b for 1 le k le n.  If
  249. a(n-k)=0 for 1 le k le n then b=1.*)
  250.  
  251.  
  252. PROCEDURE IUPRLP(A: LIST): LIST; 
  253. (*Integral univariate polynomial, root of a linear polynomial.
  254. A is an integral univariate polynomial of degree one.  r is
  255. the unique rational number such that A(r)=0.*)
  256.  
  257.  
  258. PROCEDURE IUPVAR(A: LIST): LIST; 
  259. (*Integral univariate polynomial variations.  A is a non-zero uni-
  260. variate integral polynomial.  n is the number of sign variations in
  261. the coefficients of A.*)
  262.  
  263.  
  264. PROCEDURE IUPVSI(A,I: LIST): LIST; 
  265. (*Integral univariate polynomial, variations for standard
  266. interval.  A is a non-zero integral univariate polynomial.  I is
  267. a standard open interval.  Let T(z) be the transformation mapping the
  268. right half-plane onto the circle having I as a diameter.
  269. Let B(x)=A(T(x)).  Then v is the number of sign variations in the
  270. coefficients of B.*)
  271.  
  272.  
  273. PROCEDURE RIB(RL,SL: LIST): LIST; 
  274. (*Rational interval bisection.  r and s are binary rational numbers,
  275. r lt s.  t is a binary rational number with r lt t lt s, defined
  276. as follows.  Let h=floor(log2(s-r)) and let c be the least integer
  277. such that c*2**h gt r.  Then t=c*2**h if c*2**h lt s and
  278. t=(2*c-1)*2**(h-1) otherwise.*)
  279.  
  280.  
  281. PROCEDURE RILC(I,KL: LIST): LIST; 
  282. (*Rational interval length comparison.  I is an interval (a,b) with
  283. rational endpoints, a le b.  k is a gamma-integer.  t=1 if b-a le
  284. 2**k and t=0 otherwise.*)
  285.  
  286.  
  287. PROCEDURE RINT(I: LIST): LIST; 
  288. (*Rational interval normalizing transformation.  I is a list (r,s)
  289. with rational endpoints and r lt s.  IS is the list (rs,ss)=
  290. psi(r,s).*)
  291.  
  292.  
  293. END SACROOT.
  294.