factor.log 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. Sat Jun 29 13:38:59 PDT 1991
  2. REDUCE 3.4, 15-Jul-91 ...
  3. 1: 1:
  4. 2: 2:
  5. 3: 3: comment factorizer test file;
  6. array a(20);
  7. factorize(x**2-1);
  8. {X - 1,X + 1}
  9. %To make sure factorizer is loaded;
  10. % If you want deterministic behavior, set randomseed* before each test.
  11. % global '(randomseed!*);
  12. % symbolic(randomseed!* := 300000);
  13. algebraic procedure test(prob,nfac);
  14. begin
  15. scalar basetime;
  16. p := for i:=1:nfac product a(i);
  17. Write "Problem number ",prob;
  18. symbolic (basetime := time());
  19. symbolic prin2t list("The random seed is",randomseed!*);
  20. m := factorize p;
  21. symbolic (basetime := time() - basetime);
  22. symbolic lpri list("Time =",basetime);
  23. symbolic terpri();
  24. q := for each j in m product j;
  25. if (length m=nfac) and (p=q) then return ok;
  26. write "This example failed:";
  27. write m;
  28. return failed
  29. end;
  30. TEST
  31. % Wang test case 1;
  32. a(1) := x*y+z+10$
  33. a(2) := x*z+y+30$
  34. a(3) := x+y*z+20$
  35. test(1,3);
  36. Problem number 1
  37. (The random seed is 300000)
  38. Time = 289
  39. OK
  40. % Wang test case 2;
  41. a(1) := x**3*z+x**3*y+z-11$
  42. a(2) := x**2*z**2+x**2*y**2+y+90$
  43. test(2,2);
  44. Problem number 2
  45. (The random seed is 242633)
  46. Time = 561
  47. OK
  48. % Wang test case 3;
  49. a(1) := x**3*y**2+x*z**4+x+z$
  50. a(2) := x**3+x*y*z+y**2+y*z**3$
  51. test(3,2);
  52. Problem number 3
  53. (The random seed is 283219)
  54. Time = 527
  55. OK
  56. % Wang test case 4;
  57. a(1) := x**2*z+y**4*z**2+5$
  58. a(2) := x*y**3+z**2$
  59. a(3) := -x**3*y+z**2+3$
  60. a(4) := x**3*y**4+z**2$
  61. test(4,4);
  62. Problem number 4
  63. (The random seed is 385159)
  64. Time = 1360
  65. OK
  66. % Wang test case 5;
  67. a(1) := 3*u**2*x**3*y**4*z+x*z**2+y**2*z**2+19*y**2$
  68. a(2) := u**2*y**4*z**2+x**2*z+5$
  69. a(3) := u**2+x**3*y**4+z**2$
  70. test(5,3);
  71. Problem number 5
  72. (The random seed is 380938)
  73. Time = 1700
  74. OK
  75. % Wang test case 6;
  76. a(1) := w**4*x**5*y**6-w**4*z**3+w**2*x**3*y+x*y**2*z**2$
  77. a(2) := w**4*z**6-w**3*x**3*y-w**2*x**2*y**2*z**2+x**5*z
  78. -x**4*y**2+y**2*z**3$
  79. a(3) := -x**5*z**3+x**2*y**3+y*z$
  80. test(6,3);
  81. Problem number 6
  82. (The random seed is 178753)
  83. Time = 4930
  84. OK
  85. % Wang test case 7;
  86. a(1) := x+y+z-2$
  87. a(2) := x+y+z-2$
  88. a(3) := x+y+z-3$
  89. a(4) := x+y+z-3$
  90. a(5) := x+y+z-3$
  91. test(7,5);
  92. Problem number 7
  93. (The random seed is 182507)
  94. Time = 884
  95. OK
  96. % Wang test case 8;
  97. a(1) := -z**31-w**12*z**20+y**18-y**14+x**2*y**2+x**21+w**2$
  98. a(2) := -15*y**2*z**16+29*w**4*x**12*z**3+21*x**3*z**2+3*w**15*y**20$
  99. % Commented out, since it can take a long time.
  100. % TEST(8,2);
  101. % Wang test case 9;
  102. a(1) := 18*u**2*w**3*x*z**2+10*u**2*w*x*y**3+15*u*z**2+6*w**2*y**3*z**2$
  103. a(2) := x$
  104. a(3) := 25*u**2*w**3*y*z**4+32*u**2*w**4*y**4*z**3-
  105. 48*u**2*x**2*y**3*z**3-2*u**2*w*x**2*y**2+44*u*w*x*y**4*z**4-
  106. 8*u*w*x**3*z**4+4*w**2*x+11*w**2*x**3*y+12*y**3*z**2$
  107. a(4) := z$
  108. a(5) := z$
  109. a(6) := u$
  110. a(7) := u$
  111. a(8) := u$
  112. a(9) := u$
  113. test(9,9);
  114. Problem number 9
  115. (The random seed is 123858)
  116. Time = 4624
  117. OK
  118. % Wang test case 10;
  119. a(1) := 31*u**2*x*z+35*w**2*y**2+40*w*x**2+6*x*y$
  120. a(2) := 42*u**2*w**2*y**2+47*u**2*w**2*z+22*u**2*w**2+9*u**2*w*x**2+21
  121. *u**2*w*x*y*z+37*u**2*y**2*z+u**2*w**2*x*y**2*z**2+8*u**2*w**2
  122. *z**2+24*u**2*w*x*y**2*z**2+24*u**2*x**2*y*z**2+12*u**2*x*y**2
  123. *z**2+13*u*w**2*x**2*y**2+27*u*w**2*x**2*y+39*u*w*x*z+43*u*
  124. x**2*y+44*u*w**2* z**2+37*w**2*x*y+29*w**2*y**2+31*w**2*y*z**2
  125. +12*w*x**2*y*z+43*w*x*y*z**2+22*x*y**2+23*x*y*z+24*x*y+41*y**2
  126. *z$
  127. test(10,2);
  128. Problem number 10
  129. (The random seed is 298745)
  130. Time = 3468
  131. OK
  132. % Wang test case 11;
  133. a(1) := -36*u**2*w**3*x*y*z**3-31*u**2*w**3*y**2+20*u**2*w**2*x**2*y**2
  134. *z**2-36*u**2*w*x*y**3*z+46*u**2*w*x+9*u**2*y**2-36*u*w**2*y**3
  135. +9*u*w*y**3-5*u*w*x**2*y**3+48*u*w*x**3*y**2*z+23*u*w*x**3*y**2
  136. -43*u*x**3*y**3*z**3-46*u*x**3*y**2+29*w**3*x*y**3*z**2-
  137. 14*w**3*x**3*y**3*z**2-45*x**3-8*x*y**2$
  138. a(2) := 13*u**3*w**2*x*y*z**3-4*u*x*y**2-w**3*z**3-47*x*y$
  139. a(3) := x$
  140. a(4) := y$
  141. test(11,4);
  142. Problem number 11
  143. (The random seed is 271044)
  144. Time = 5848
  145. OK
  146. % Wang test case 12;
  147. a(1) := x+y+z-3$
  148. a(2) := x+y+z-3$
  149. a(3) := x+y+z-3$
  150. test(12,3);
  151. Problem number 12
  152. (The random seed is 309235)
  153. Time = 153
  154. OK
  155. % Wang test case 13;
  156. a(1) := 2*w*z+45*x**3-9*y**3-y**2+3*z**3$
  157. a(2) := w**2*z**3-w**2+47*x*y$
  158. test(13,2);
  159. Problem number 13
  160. (The random seed is 337962)
  161. Time = 442
  162. OK
  163. % Wang test case 14;
  164. a(1) := 18*x**4*y**5+41*x**4*y**2-37*x**4+26*x**3*y**4+38*x**2*y**4-29*
  165. x**2*y**3-22*y**5$
  166. a(2) := 33*x**5*y**6-22*x**4+35*x**3*y+11*y**2$
  167. test(14,2);
  168. Problem number 14
  169. (The random seed is 255258)
  170. Time = 3553
  171. OK
  172. % Wang test case 15;
  173. a(1) := 12*w**2*x*y*z**3-w**2*z**3+w**2-29*x-3*x*y**2$
  174. a(2) := 14*w**2*y**2+2*w*z+18*x**3*y-8*x*y**2-y**2+3*z**3$
  175. a(3) := z$
  176. a(4) := z$
  177. a(5) := y$
  178. a(6) := y$
  179. a(7) := y$
  180. a(8) := x$
  181. a(9) := x$
  182. a(10) := x$
  183. a(11) := x$
  184. a(12) := x$
  185. a(13) := x$
  186. test(15,13);
  187. Problem number 15
  188. (The random seed is 122339)
  189. Time = 1173
  190. OK
  191. % Test 16 - the 40th degree polynomial that comes from
  192. % SIGSAM problem number 7;
  193. a(1) := 8192*y**10+20480*y**9+58368*y**8-161792*y**7+198656*y**6+
  194. 199680*y**5-414848*y**4-4160*y**3+171816*y**2-48556*y+469$
  195. a(2) := 8192*y**10+12288*y**9+66560*y**8-22528*y**7-138240*y**6+
  196. 572928*y**5-90496*y**4-356032*y**3+113032*y**2+23420*y-8179$
  197. a(3) := 4096*y**10+8192*y**9+1600*y**8-20608*y**7+20032*y**6+87360*y**5-
  198. 105904*y**4+18544*y**3+11888*y**2-3416*y+1$
  199. a(4) := 4096*y**10+8192*y**9-3008*y**8-30848*y**7+21056*y**6+146496*
  200. y**5-221360*y**4+1232*y**3+144464*y**2-78488*y+11993$
  201. test(16,4);
  202. Problem number 16
  203. (The random seed is 93784)
  204. Time = 34884
  205. OK
  206. % Test 17 - taken from Erich Kaltofen's thesis. This polynomial
  207. % splits mod all possible primes p;
  208. a(1) := x**25-25*x**20-3500*x**15-57500*x**10+21875*x**5-3125$
  209. test(17,1);
  210. Problem number 17
  211. (The random seed is 266680)
  212. Time = 5338
  213. OK
  214. % Test 18 - another 'hard-to-factorize' univariate;
  215. a(1) := x**18+9*x**17+45*x**16+126*x**15+189*x**14+27*x**13-
  216. 540*x**12-1215*x**11+1377*x**10+15444*x**9+46899*x**8+
  217. 90153*x**7+133893*x**6+125388*x**5+29160*x**4-
  218. 32076*x**3+26244*x**2-8748*x+2916$
  219. test(18,1);
  220. Problem number 18
  221. (The random seed is 92933)
  222. Time = 4437
  223. OK
  224. % Test 19 - another example chosen to lead to false splits mod p;
  225. a(1) := x**16+4*x**12-16*x**11+80*x**9+2*x**8+160*x**7+
  226. 128*x**6-160*x**5+28*x**4-48*x**3+128*x**2-16*x+1$
  227. a(2) := x**16+4*x**12+16*x**11-80*x**9+2*x**8-160*x**7+
  228. 128*x**6+160*x**5+28*x**4+48*x**3+128*x**2+16*x+1$
  229. test(19,2);
  230. Problem number 19
  231. (The random seed is 379724)
  232. Time = 5814
  233. OK
  234. % End of all tests;
  235. end;
  236. 4: 4:
  237. Quitting
  238. Sat Jun 29 13:40:22 PDT 1991