scope.log 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. Sat Jun 29 14:12:16 PDT 1991
  2. REDUCE 3.4, 15-Jul-91 ...
  3. 1: 1:
  4. 2: 2:
  5. 3: 3: % Test SCOPE Package.
  6. % NOTE: The SCOPE, GHORNER, GSTRUCTR and GENTRAN packages must be loaded
  7. % to run these tests.
  8. on priall$
  9. optimize z:=a^2*b^2+10*a^2*m^6+a^2*m^2+2*a*b*m^4+2*b^2*m^6+b^2*m^2
  10. iname s;
  11. Sumscheme :
  12. || EC|Far
  13. ------------
  14. 0|| 1| Z
  15. ------------
  16. Productscheme :
  17. | 0 1 2| EC|Far
  18. ---------------------
  19. 1| 2 2| 1| 0
  20. 2| 6 2| 10| 0
  21. 3| 2 2| 1| 0
  22. 4| 4 1 1| 2| 0
  23. 5| 6 2 | 2| 0
  24. 6| 2 2 | 1| 0
  25. ---------------------
  26. 0 : M
  27. 1 : B
  28. 2 : A
  29. Number of operations in the input is:
  30. Number of (+,-)-operations : 5
  31. Number of (*)-operations : 10
  32. Number of integer exponentiations : 11
  33. Number of other operations : 0
  34. Time: 51 ms
  35. Breuer search :
  36. Time: 85 ms
  37. Removal of different names for identical cse's :
  38. Time: 17 ms
  39. Change Scheme :
  40. Time: 0 ms
  41. Local Factorization :
  42. Time: 0 ms
  43. Breuer search :
  44. Time: 34 ms
  45. Removal of different names for identical cse's :
  46. Time: 0 ms
  47. Change Scheme :
  48. Time: 0 ms
  49. Local Factorization :
  50. Time: 0 ms
  51. Breuer search :
  52. Time: 34 ms
  53. Removal of different names for identical cse's :
  54. Time: 0 ms
  55. Change Scheme :
  56. Time: 0 ms
  57. Local Factorization :
  58. Time: 0 ms
  59. Additional optimization during finishing touch :
  60. Time: 0 ms
  61. S0 := B*A
  62. S4 := M*M
  63. S1 := S4*B*B
  64. S2 := S4*A*A
  65. S3 := S4*S4
  66. Z := S1 + S2 + S0*(2*S3 + S0) + S3*(2*S1 + 10*S2)
  67. Number of operations after optimization is:
  68. Number of (+,-)-operations : 5
  69. Number of (*)-operations : 12
  70. Number of integer exponentiations : 0
  71. Number of other operations : 0
  72. Sumscheme :
  73. | 0 3 4 5| EC|Far
  74. ------------------------
  75. 0| 1 1| 1| Z
  76. 15| 2 10| 1| 14
  77. 17| 2 1 | 1| 16
  78. ------------------------
  79. 0 : S3
  80. 3 : S0
  81. 4 : S1
  82. 5 : S2
  83. Productscheme :
  84. | 8 9 10 11 17 18 19 20| EC|Far
  85. ------------------------------------
  86. 7| 1 1| 1| S0
  87. 8| 1 2 | 1| S1
  88. 9| 1 2| 1| S2
  89. 10| 2 | 1| S3
  90. 11| 2 | 1| S4
  91. 14| 1 | 1| 0
  92. 16| 1 | 1| 0
  93. ------------------------------------
  94. 8 : S4
  95. 9 : S3
  96. 10 : S2
  97. 11 : S1
  98. 17 : S0
  99. 18 : M
  100. 19 : B
  101. 20 : A
  102. Time: 51 ms
  103. off priall$
  104. on primat,acinfo$
  105. optimize
  106. ghorner <<z:=a^2*b^2+10*a^2*m^6+a^2*m^2+2*a*b*m^4+2*b^2*m^6+b^2*m^2>>
  107. vorder m
  108. iname s;
  109. 2 2 2 2 2 2 2 2 2
  110. Z := A *B + M *((A + B ) + M *(2*A*B + M *(10*A + 2*B )))
  111. Sumscheme :
  112. || EC|Far
  113. ------------
  114. 0|| 1| Z
  115. 3|| 1| 2
  116. 7|| 1| 6
  117. 10|| 1| 9
  118. ------------
  119. Productscheme :
  120. | 0 1 2| EC|Far
  121. ---------------------
  122. 1| 2 2| 1| 0
  123. 2| 2 | 1| 0
  124. 4| 2| 1| 3
  125. 5| 2 | 1| 3
  126. 6| 2 | 1| 3
  127. 8| 1 1| 2| 7
  128. 9| 2 | 1| 7
  129. 11| 2| 10| 10
  130. 12| 2 | 2| 10
  131. ---------------------
  132. 0 : M
  133. 1 : B
  134. 2 : A
  135. Number of operations in the input is:
  136. Number of (+,-)-operations : 5
  137. Number of (*)-operations : 8
  138. Number of integer exponentiations : 9
  139. Number of other operations : 0
  140. S0 := B*A
  141. S1 := B*B
  142. S2 := A*A
  143. S3 := M*M
  144. Z := S0*S0 + S3*(S1 + S2 + S3*(2*S0 + S3*(2*S1 + 10*S2)))
  145. Number of operations after optimization is:
  146. Number of (+,-)-operations : 5
  147. Number of (*)-operations : 11
  148. Number of integer exponentiations : 0
  149. Number of other operations : 0
  150. Sumscheme :
  151. | 0 1 2| EC|Far
  152. ---------------------
  153. 0| | 1| Z
  154. 3| 1 1| 1| 2
  155. 7| 2 | 1| 6
  156. 10| 2 10| 1| 9
  157. ---------------------
  158. 0 : S0
  159. 1 : S1
  160. 2 : S2
  161. Productscheme :
  162. | 3 4 5 9 10 11 12| EC|Far
  163. ---------------------------------
  164. 1| 2 | 1| 0
  165. 2| 1 | 1| 0
  166. 6| 1 | 1| 3
  167. 9| 1 | 1| 7
  168. 13| 1 1| 1| S0
  169. 14| 2 | 1| S1
  170. 15| 2| 1| S2
  171. 16| 2 | 1| S3
  172. ---------------------------------
  173. 3 : S3
  174. 4 : S2
  175. 5 : S1
  176. 9 : S0
  177. 10 : M
  178. 11 : B
  179. 12 : A
  180. operator a$
  181. k:=j:=1$
  182. u:=c*x+d$
  183. v:=sin(u)$
  184. optimize {a(k,j):=v*(v^2*cos(u)^2+u),
  185. a(k,j)::=:v*(v^2*cos(u)^2+u)} iname s;
  186. 2 2
  187. A(K,J) := V*(V *COS(U) + U)
  188. A(1,1) :=
  189. 3 2
  190. SIN(C*X + D) *COS(C*X + D) + SIN(C*X + D)*C*X + SIN(C*X + D)*D
  191. Sumscheme :
  192. | 7 8| EC|Far
  193. ------------------
  194. 1| 1 | 1| 0
  195. 3| | 1| S2
  196. 5| 1| 1| S4
  197. ------------------
  198. 7 : U
  199. 8 : D
  200. Productscheme :
  201. | 0 1 2 3 4 5 6| EC|Far
  202. ---------------------------------
  203. 0| 1| 1| S0
  204. 2| 2 2| 1| 1
  205. 4| 2 3 | 1| 3
  206. 6| 1 1 | 1| 5
  207. 7| 1 1 1 | 1| 3
  208. 8| 1 1 | 1| 3
  209. ---------------------------------
  210. 0 : D
  211. 1 : S5=COS(S4)
  212. 2 : S3=SIN(S4)
  213. 3 : X
  214. 4 : C
  215. 5 : S1=COS(U)
  216. 6 : V
  217. Number of operations in the input is:
  218. Number of (+,-)-operations : 7
  219. Number of (*)-operations : 10
  220. Number of integer exponentiations : 4
  221. Number of other operations : 5
  222. S8 := COS(U)*V
  223. A(K,J) := V*(U + S8*S8)
  224. S4 := X*C + D
  225. S3 := SIN(S4)
  226. S9 := COS(S4)*S3
  227. A(1,1) := S3*(S4 + S9*S9)
  228. Number of operations after optimization is:
  229. Number of (+,-)-operations : 3
  230. Number of (*)-operations : 7
  231. Number of integer exponentiations : 0
  232. Number of other operations : 3
  233. Sumscheme :
  234. | 2 3 12 13| EC|Far
  235. ------------------------
  236. 1| 1 | 1| 0
  237. 3| | 1| S2
  238. 5| 1 1| 1| S4
  239. 11| 1 | 1| 10
  240. ------------------------
  241. 2 : S4
  242. 3 : S6
  243. 12 : U
  244. 13 : D
  245. Productscheme :
  246. | 0 1 4 5 6 7 8 9 10 11| EC|Far
  247. ------------------------------------------
  248. 0| 1| 1| S0
  249. 2| 2 | 1| 1
  250. 4| 2 | 1| 11
  251. 9| 1 1 | 1| S6
  252. 10| 1 | 1| 3
  253. 13| 1 1| 1| S8
  254. 14| 1 1 | 1| S9
  255. ------------------------------------------
  256. 0 : S9
  257. 1 : S8
  258. 4 : S6
  259. 5 : D
  260. 6 : S5=COS(S4)
  261. 7 : S3=SIN(S4)
  262. 8 : X
  263. 9 : C
  264. 10 : S1=COS(U)
  265. 11 : V
  266. off exp$
  267. optimize {a(k,j):=v*(v^2*cos(u)^2+u),
  268. a(k,j)::=:v*(v^2*cos(u)^2+u)} iname s;
  269. 2 2
  270. A(K,J) := V*(V *COS(U) + U)
  271. 2 2
  272. A(1,1) := (SIN(C*X + D) *COS(C*X + D) + C*X + D)*SIN(C*X + D)
  273. Sumscheme :
  274. | 6 7| EC|Far
  275. ------------------
  276. 1| 1 | 1| 0
  277. 4| 1| 1| 3
  278. 6| 1| 1| S4
  279. ------------------
  280. 6 : U
  281. 7 : D
  282. Productscheme :
  283. | 0 1 2 3 4 5| EC|Far
  284. ------------------------------
  285. 0| 1| 1| S0
  286. 2| 2 2| 1| 1
  287. 3| 1 | 1| S2
  288. 5| 2 2 | 1| 4
  289. 7| 1 1 | 1| 6
  290. 8| 1 1 | 1| 4
  291. ------------------------------
  292. 0 : S5=COS(S4)
  293. 1 : S3=SIN(S4)
  294. 2 : X
  295. 3 : C
  296. 4 : S1=COS(U)
  297. 5 : V
  298. Number of operations in the input is:
  299. Number of (+,-)-operations : 6
  300. Number of (*)-operations : 8
  301. Number of integer exponentiations : 4
  302. Number of other operations : 4
  303. S8 := COS(U)*V
  304. A(K,J) := V*(U + S8*S8)
  305. S4 := X*C + D
  306. S3 := SIN(S4)
  307. S9 := COS(S4)*S3
  308. A(1,1) := S3*(S4 + S9*S9)
  309. Number of operations after optimization is:
  310. Number of (+,-)-operations : 3
  311. Number of (*)-operations : 7
  312. Number of integer exponentiations : 0
  313. Number of other operations : 3
  314. Sumscheme :
  315. | 2 3 11 12| EC|Far
  316. ------------------------
  317. 1| 1 | 1| 0
  318. 4| 1 | 1| 3
  319. 6| 1 1| 1| S4
  320. ------------------------
  321. 2 : S4
  322. 3 : S6
  323. 11 : U
  324. 12 : D
  325. Productscheme :
  326. | 0 1 4 5 6 7 8 9 10| EC|Far
  327. ---------------------------------------
  328. 0| 1| 1| S0
  329. 2| 2 | 1| 1
  330. 3| 1 | 1| S2
  331. 5| 2 | 1| 4
  332. 9| 1 1 | 1| S6
  333. 11| 1 1| 1| S8
  334. 12| 1 1 | 1| S9
  335. ---------------------------------------
  336. 0 : S9
  337. 1 : S8
  338. 4 : S6
  339. 5 : S5=COS(S4)
  340. 6 : S3=SIN(S4)
  341. 7 : X
  342. 8 : C
  343. 9 : S1=COS(U)
  344. 10 : V
  345. off primat,acinfo,period$
  346. on fort$
  347. optimize z:=(6*a+18*b+9*c+3*d+6*e+18*f+6*g+5*h+5*k+3)^13 iname s;
  348. S0=5.0*(H+K)+3.0*(3.0*C+D+1.0+6.0*(B+F)+2.0*(A+EXP(1.0)+G))
  349. S3=S0*S0*S0
  350. S2=S3*S3
  351. Z=S0*S2*S2
  352. optimize {x:=3*a*p,y:=3*a*q,z:=6*a*r+2*b*p,u:=6*a*d+2*b*q,
  353. v:=9*a*c+4*b*d,w:=4*b} iname s;
  354. S2=3.0*A
  355. X=S2*P
  356. Y=S2*Q
  357. S1=2.0*B
  358. S3=6.0*A
  359. Z=S1*P+S3*R
  360. U=S1*Q+S3*D
  361. S0=4.0*B
  362. V=S0*D+9.0*C*A
  363. W=S0
  364. off fort$
  365. clear a$
  366. matrix a(2,2)$
  367. a(1,1):=x+y+z$
  368. a(1,2):=x*y$
  369. a(2,1):=(x+y)*x*y$
  370. a(2,2):=(x+2*y+3)^3-x$
  371. on acinfo$
  372. optimize gstructr<<a;
  373. aa:=(x+y)^2;b:=(x+y)*(y+z);c:=(x+2*y)*(y+z)*(z+x)^2>>
  374. name v iname s;
  375. A(1,1) := X + Y + Z
  376. A(1,2) := X*Y
  377. V2 := X + Y
  378. A(2,1) := V2*X*Y
  379. 3
  380. A(2,2) := (X + 2*Y + 3) - X
  381. 2
  382. AA := V2
  383. V5 := Y + Z
  384. B := V2*V5
  385. 2
  386. C := (X + 2*Y)*(X + Z) *V5
  387. Number of operations in the input is:
  388. Number of (+,-)-operations : 9
  389. Number of (*)-operations : 8
  390. Number of integer exponentiations : 3
  391. Number of other operations : 0
  392. S5 := X + Z
  393. A(1,1) := S5 + Y
  394. S8 := Y*X
  395. A(1,2) := S8
  396. V2 := X + Y
  397. A(2,1) := S8*V2
  398. S6 := X + 2*Y
  399. S4 := S6 + 3
  400. A(2,2) := S4*S4*S4 - X
  401. AA := V2*V2
  402. V5 := Y + Z
  403. B := V5*V2
  404. C := S6*S5*S5*V5
  405. Number of operations after optimization is:
  406. Number of (+,-)-operations : 7
  407. Number of (*)-operations : 10
  408. Number of integer exponentiations : 0
  409. Number of other operations : 0
  410. clear a$
  411. off fort;
  412. on priall$
  413. optimize z:=:for j:=2:6 sum a^(1/j) iname s;
  414. 1/3 1/4 1/5 1/6
  415. Z := (((A + SQRT(A)) + A ) + A ) + A
  416. Sumscheme :
  417. || EC|Far
  418. ------------
  419. 0|| 1| Z
  420. ------------
  421. Productscheme :
  422. | 0| EC|Far
  423. ---------------
  424. 1| 20| 1| 0
  425. 2| 30| 1| 0
  426. 3| 15| 1| 0
  427. 4| 12| 1| 0
  428. 5| 10| 1| 0
  429. ---------------
  430. 0 : A
  431. Number of operations in the input is:
  432. Number of (+,-)-operations : 4
  433. Number of (*)-operations : 0
  434. Number of integer exponentiations : 0
  435. Number of other operations : 5
  436. Time: 1717 ms
  437. Breuer search :
  438. Time: 102 ms
  439. Removal of different names for identical cse's :
  440. Time: 0 ms
  441. Change Scheme :
  442. Time: 0 ms
  443. Local Factorization :
  444. Time: 0 ms
  445. Breuer search :
  446. Time: 34 ms
  447. Removal of different names for identical cse's :
  448. Time: 17 ms
  449. Change Scheme :
  450. Time: 0 ms
  451. Local Factorization :
  452. Time: 0 ms
  453. Breuer search :
  454. Time: 34 ms
  455. Removal of different names for identical cse's :
  456. Time: 0 ms
  457. Change Scheme :
  458. Time: 0 ms
  459. Local Factorization :
  460. Time: 0 ms
  461. Breuer search :
  462. Time: 17 ms
  463. Removal of different names for identical cse's :
  464. Time: 0 ms
  465. Change Scheme :
  466. Time: 0 ms
  467. Local Factorization :
  468. Time: 0 ms
  469. Additional optimization during finishing touch :
  470. Time: 0 ms
  471. 1/60
  472. A := A
  473. S7 := A*A
  474. S6 := S7*A
  475. S4 := S7*S6
  476. S2 := S4*S4
  477. S1 := S7*S2
  478. S0 := S6*S1
  479. S3 := S4*S0
  480. Z := S2 + S1 + S0 + S3 + S3*S2
  481. Number of operations after optimization is:
  482. Number of (+,-)-operations : 4
  483. Number of (*)-operations : 8
  484. Number of integer exponentiations : 0
  485. Number of other operations : 1
  486. Sumscheme :
  487. | 3 4 5 6| EC|Far
  488. ------------------------
  489. 0| 1 1 1 1| 1| Z
  490. ------------------------
  491. 3 : S2
  492. 4 : S1
  493. 5 : S0
  494. 6 : S3
  495. Productscheme :
  496. | 9 10 12 13 14 15 16 22| EC|Far
  497. ------------------------------------
  498. 2| 1 1 | 1| 0
  499. 6| 1 1 | 1| S0
  500. 7| 1 1 | 1| S1
  501. 8| 2 | 1| S2
  502. 9| 1 1 | 1| S3
  503. 10| 1 1 | 1| S4
  504. 12| 1 1| 1| S6
  505. 13| 2| 1| S7
  506. ------------------------------------
  507. 9 : S7
  508. 10 : S6
  509. 12 : S4
  510. 13 : S3
  511. 14 : S2
  512. 15 : S1
  513. 16 : S0
  514. 22 : A
  515. Time: 34 ms
  516. off acinfo,priall$
  517. on optdecs$
  518. optlang!*:='fortran$
  519. optimize {x(i+1,i-1):=a(i+1,i-1)+b(i),y(i-1):=a(i-1,i+1)-b(i)} iname s
  520. declare <<x(4),a(4,4),y(5):real;b(5):integer>>;
  521. INTEGER B(5),I,S1,S2
  522. REAL A(4,4),S4,X(4),Y(5)
  523. S1=I+1.0
  524. S2=I-1.0
  525. S4=B(I)
  526. X(S1,S2)=A(S1,S2)+S4
  527. Y(S2)=A(S2,S1)-S4
  528. optlang!*:='c$
  529. optimize {x(i+1,i-1):=a(i+1,i-1)+b(i),y(i-1):=a(i-1,i+1)-b(i)} iname s
  530. declare <<x(4),a(4,4),y(5):real;b(5):integer>>;
  531. int B[6],I,S1,S2;
  532. float A[5][5],S4,X[5],Y[6];
  533. {
  534. S1=I+1.0;
  535. S2=I-1.0;
  536. S4=B[I];
  537. X[S1][S2]=A[S1][S2]+S4;
  538. Y[S2]=A[S2][S1]-S4;
  539. }
  540. optlang!*:= 'pascal$
  541. optimize {x(i+1,i-1):=a(i+1,i-1)+b(i),y(i-1):=a(i-1,i+1)-b(i)} iname s
  542. declare <<x(4),a(4,4),y(5):real;b(5):integer>>;
  543. VAR
  544. S2,S1,I: INTEGER;
  545. B: ARRAY[0..5] OF INTEGER;
  546. S4: REAL;
  547. Y: ARRAY[0..5] OF REAL;
  548. X: ARRAY[0..4] OF REAL;
  549. A: ARRAY[0..4,0..4] OF REAL;
  550. BEGIN
  551. S1:=I+1.0;
  552. S2:=I-1.0;
  553. S4:=B[I];
  554. X[S1,S2]:=A[S1,S2]+S4;
  555. Y[S2]:=A[S2,S1]-S4
  556. END;
  557. optlang!*:='ratfor$
  558. optimize {x(i+1,i-1):=a(i+1,i-1)+b(i),y(i-1):=a(i-1,i+1)-b(i)} iname s
  559. declare <<x(4),a(4,4),y(5):real;b(5):integer>>;
  560. INTEGER B(5),I,S1,S2
  561. REAL A(4,4),S4,X(4),Y(5)
  562. {
  563. S1=I+1.0
  564. S2=I-1.0
  565. S4=B(I)
  566. X(S1,S2)=A(S1,S2)+S4
  567. Y(S2)=A(S2,S1)-S4
  568. }
  569. end;
  570. 4: 4:
  571. Quitting
  572. Sat Jun 29 14:12:22 PDT 1991