Advertisement
xample

Ultimate Thinker

Jan 8th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. ClrAllLists
  2. ClrHome
  3. a+bi
  4. Disp "ENTER COEFF.S AS
  5. Input "A LIST:",L1
  6. dim(L1->D
  7. 0->N
  8. ~1->X
  9. 1->Y
  10. Input "IMAG.FACTRS Y/N?",A
  11. If abs(A
  12. [i]->X
  13. 0->E
  14. For(I,1,D
  15. If real(L1(I)) and imag(L1(I
  16. 1->E
  17. End
  18. If abs(E
  19. [i]->X
  20. If real(L1(1))<0
  21. Then
  22. ~L1->L1
  23. Disp "MINUS
  24. End
  25. L1(1->A
  26. For(I,2,dim(L1
  27. L1(I->B
  28. 0->F
  29. While (real(B) or imag(B)) and F<16
  30. F+1->F
  31. A-Bint(A/B->C
  32. B->A
  33. C->B
  34. End
  35. End
  36. If real(L1(1))>0 and real(A)<0
  37. ~A->A
  38. real(A->B
  39. [i]imag(A->C
  40. If real(L1(1))=0 and abs(B)=0
  41. Then
  42. C->A
  43. If imag(L1(1))<0 and imag(C)>0
  44. ~A->A
  45. End
  46. If imag(L1(1))=0 and abs(B)=abs(C
  47. Then
  48. abs(B->A
  49. If real(L1(1))<0
  50. ~A->A
  51. End
  52. If imag(L1(1))=0 and B=0
  53. Then
  54. abs(C->A
  55. If real(L1(1))<0
  56. ~A->A
  57. End
  58. 0->dim(|LL
  59. If abs(A)>1 or real(A)<0 or imag(A
  60. Then
  61. Disp A,"*
  62. L1/A->L1
  63. If abs(A)>1
  64. {A->|LL
  65. End
  66. While real(L1(D))=0 and imag(L1(D))=0
  67. Disp {1,0
  68. D-1->D
  69. End
  70. D->dim(L1
  71. If D<=1
  72. Goto E
  73. 1->S
  74. 1->U
  75. {0->|LK
  76. Lbl 0
  77. 0->E
  78. For(I,1,D
  79. If real(L1(I)) and imag(L1(I
  80. 1->E
  81. End
  82. L1(1->A
  83. L1(D->B
  84. A->C
  85. 1->J
  86. If real(A) and imag(A)
  87. Then
  88. A->theta
  89. int(sqrt(abs(theta->V
  90. prgmADIVCMPX
  91. L3->L5
  92. If dim(|LL
  93. augment(|LL,L5->L5
  94. 2->J
  95. End
  96. For(J,J,2-(real(B)!=0 and imag(B)!=0)
  97. If J=2
  98. Then
  99. B->A
  100. B->C
  101. End
  102. 0->dim(L2
  103. 0->dim(L3
  104. For(I,1,sqrt(abs(C
  105. If fPart(real(C)/I)=0 and fPart(imag(C)/I)=0
  106. Then
  107. AI/C->L2(1+dim(L2
  108. A/I->L3(1+dim(L3
  109. End
  110. End
  111. If dim(L3
  112. SortA(L3
  113. 0->dim(L4
  114. For(I,1,dim(L2
  115. L2(I->L4(1+dim(L4
  116. L3(I->L4(1+dim(L4
  117. End
  118. If J=1
  119. Then
  120. L4->L5
  121. If dim(|LL
  122. augment(|LL,L5->L5
  123. If real(L1(1))=1 and imag(L1(1))=0
  124. {1->L5
  125. End
  126. End
  127. If real(B) and imag(B
  128. Then
  129. L1(D->theta
  130. int(sqrt(abs(theta->V
  131. prgmADIVCMPX
  132. L3->L4
  133. End
  134. 1->M
  135. max(1,round(dim(L5)/2,0->N
  136. If (abs(L1(2))abs(L1(D-1))!=0 and prod(abs(L1))=0) or prod(abs(L1))!=0
  137. Then
  138. SxrootL4->L4
  139. SxrootL5->L5
  140. End
  141. Lbl 1
  142. 0->T
  143. For(H,1,dim(L4
  144. For(I,M,N
  145. 0->L
  146. Repeat L=2+2(imag(X)!=0
  147. L4(H)/L5(I->Q
  148. {L1(1->L2
  149. L2->L3
  150. For(J,2,dim(L1
  151. If S=1
  152. Then
  153. L1(J)+QL2(J-1->L2(J
  154. Else
  155. If U and imag(X)=0
  156. Then
  157. If abs(L1(J
  158. L1(J)+QL2(dim(L2->L2(1+dim(L2
  159. Else
  160. If fPart((J-1)/S)=0
  161. L1(J)+QL2(dim(L2->L2(1+dim(L2
  162. If fPart((J-1)/S)=0
  163. L1(J)-QL3(dim(L3->L3(1+dim(L3
  164. End
  165. End
  166. End
  167. If abs(L2(dim(L2))) and abs(L3(dim(L3))) or (imag(X) and S>1 and abs(L3(dim(L3)))!=0
  168. Then
  169. L+1->L
  170. XL4(H->L4(H
  171. Else
  172. If abs(L3(dim(L3)))=0
  173. L3->L2
  174. D-S->D
  175. If S=1
  176. Then
  177. round(L2,0->L1
  178. dim(L1)-1->dim(L1
  179. If real(L4(H))=0 and real(L5(I))=0
  180. Then
  181. imag(L4(H->L4(H
  182. imag(L5(I->L5(I
  183. End
  184. If E
  185. Disp {L5(I),~L4(H)}
  186. If E=0
  187. Disp {L5(I),~L4(H)}/gcd(abs(L5(I)),abs(L4(H
  188. Else
  189. 1->R
  190. If fPart(round(abs(L4(H)),5))=0 and fPart(round(abs(L5(I)),5))=0
  191. 0->R
  192. 0->T
  193. Lbl R
  194. {L5(I)^(S^R)->L2
  195. For(W,2,S+T
  196. 0->L2(W
  197. End
  198. L4(H)^(S^R)->L2(W
  199. If real(X) and real(L4(H)L2(W))>0 or imag(L4(H)L2(W))>0
  200. ~L2(W->L2(W
  201. L1->L3
  202. dim(L2->dim(L3
  203. DelVar L61+dim(L1)-dim(L2->E
  204. For(V,1,E
  205. L3(1)/L2(1->L6(V
  206. L3-L2L6(V->L3
  207. If V<E
  208. Then
  209. For(W,2,dim(L3
  210. L3(W->L3(W-1
  211. End
  212. L1(V+dim(L3->L3(dim(L3
  213. End
  214. End
  215. If sum(abs(L3
  216. T+1->T
  217. If T>D
  218. Goto E
  219. If sum(abs(L3
  220. Goto R
  221. Disp L2
  222. round(L6,0->L1
  223. D-T->D
  224. If D<=S+1
  225. Goto K
  226. End
  227. End
  228. End
  229. If D>S+T+1
  230. End
  231. If D>S+T+1
  232. End
  233. M+N->M
  234. dim(L5->N
  235. If M<=dim(L5) and D>S+T+1
  236. Goto 1
  237. L1(1->A
  238. For(I,2,dim(L1
  239. L1(I->B
  240. 0->F
  241. While (real(B) or imag(B)) and F<16
  242. F+1->F
  243. A-Bint(A/B->C
  244. B->A
  245. C->B
  246. End
  247. End
  248. If abs(real(A))=abs(imag(A)) and imag(L1(1))=0 or (imag(A)=0
  249. abs(real(A->A
  250. If real(A)=0
  251. abs(imag(A->A
  252. L1/A->L1
  253. 0->dim(L2
  254. For(I,1,dim(L1
  255. If abs(L1(I
  256. I->L2(1+dim(L2
  257. End
  258. If dim(L2)=3 and L1(1)L1(dim(L1))=L1(int(dim(L1)/2)+1)^^2
  259. Goto K
  260. S->R
  261. 1->U
  262. S+1->S
  263. If dim(L2)=2 and D>=5 and fPart(D/2
  264. DelVar U(D-1)/2->S
  265. If D>S+T+1 and S!=R
  266. Goto 0
  267. If dim(L2)=2 and (fPart(sqrt(abs(L1(1)))) or fPart(sqrt(abs(L1(D
  268. Goto E
  269. Lbl K
  270. 1->Z
  271. Lbl 2
  272. If D>=5
  273. Then
  274. 1->J
  275. {0->|LK
  276. L1(Z+1->A
  277. If real(A) and imag(A
  278. Then
  279. A->theta
  280. int(sqrt(abs(theta->V
  281. prgmADIVCMPX
  282. L3->|LK
  283. 2->J
  284. End
  285. L1(dim(L1)-Z->B
  286. For(J,J,2-(real(B)!=0 and imag(B)!=0)
  287. If J=2
  288. L1(dim(L1)-Z->A
  289. abs(A->B
  290. For(I,1,sqrt(B
  291. If not(fPart(B/I
  292. Then
  293. AI/B->|LK(1+dim(|LK
  294. A/I->|LK(1+dim(|LK
  295. End
  296. End
  297. End
  298. L1(dim(L1)-Z->A
  299. If real(A) and imag(A
  300. Then
  301. A->theta
  302. int(sqrt(abs(theta->V
  303. prgmADIVCMPX
  304. augment(|LK,L3->|LK
  305. End
  306. L1(Z+1->A
  307. L1(dim(L1)-Z->B
  308. If real(A)=real(B) and imag(A)=imag(B) and dim(|LK)>1
  309. int(dim(|LK)/2+1->dim(|LK
  310. If Z+1=dim(L1)-Z and not(fPart(sqrt(abs(L1(Z+1
  311. {sqrt(abs(L1(Z+1))),[i]sqrt(abs(L1(Z+1->|LK
  312. If Z+1=dim(L1)-Z and fPart(Z/2
  313. Goto E
  314. End
  315. Z+1->Z
  316. If sum(abs(|LK))=0 and D>=5
  317. Goto 2
  318. If sum(abs(|LK)) and D>=5
  319. Then
  320. L4->L2
  321. L5->L3
  322. While fPart(sum(abs(round(L4,5)))) or fPart(sum(abs(round(L5,5
  323. L2L4->L4
  324. L3L5->L5
  325. End
  326. round(L4,0->L4
  327. round(L5,0->L5
  328. D->U
  329. int(Z/2->Z
  330. For(H,1,dim(L4
  331. For(K,1,dim(|LK
  332. For(I,1,dim(L5
  333. 0->L
  334. Repeat L=2+2(imag(X)!=0
  335. {L5(I),|LK(K),~L4(H->L2
  336. If dim(|LK)=2 and Z>=2
  337. Then
  338. {L5(I->L2
  339. For(J,2,Z
  340. 0->L2(J
  341. End
  342. |LK(K->L2(J
  343. For(J,J+1,J+Z-1
  344. 0->L2(J
  345. End
  346. XL4(H->L2(J
  347. End
  348. L1->L3
  349. dim(L2->dim(L3
  350. DelVar L61+dim(L1)-dim(L2->E
  351. For(V,1,E
  352. L3(1)/L2(1->L6(V
  353. L3-L2L6(V->L3
  354. If V<E
  355. Then
  356. For(W,2,dim(L3
  357. L3(W->L3(W-1
  358. End
  359. L1(V+dim(L3->L3(dim(L3
  360. End
  361. End
  362. If sum(abs(L3))=0
  363. Then
  364. round(L6,0->L1
  365. Disp L2
  366. dim(L1->D
  367. If dim(L1)=dim(L2) or (L1(int(D/2+1))=0 and fPart(D/2
  368. Goto E
  369. Else
  370. L+1->L
  371. XL4(H->L4(H
  372. End
  373. End
  374. If D>=5
  375. End
  376. If D>=5
  377. End
  378. If D>=5
  379. End
  380. End
  381. If D>=5 and D<U
  382. Goto K
  383. Lbl E
  384. If D>1
  385. L1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement