patches.rlg 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. Tue Mar 6 13:52:20 PST 2001
  2. Loading image file :/home/hearn/reddist/reduce3.7/lisp/psl/linux/red/reduce.img
  3. REDUCE 3.7, 15-Apr-1999, patched to 6-Mar-2001 ...
  4. 1:
  5. 2: 2: 2: 2: 2: 2: 2:
  6. 3: 3: % This file tests some of the patches included in the patches.red file.
  7. % If the latter file has been correctly installed, none of these should
  8. % give an error.
  9. % 7 Aug 99.
  10. % This did not terminate.
  11. df(tan((sqrt(1-x^2)*asin acos x + 2*sqrt(1-x^2)*x)/x),x);
  12. 4
  13. ( - acos(x) *asin(acos(x))
  14. 2 2
  15. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2
  16. *tan(-----------------------------------------------------)
  17. x
  18. 4
  19. - acos(x) *asin(acos(x))
  20. 2 2
  21. 4 sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2 3
  22. - 2*acos(x) *tan(-----------------------------------------------------) *x
  23. x
  24. 4 3 2
  25. - 2*acos(x) *x + 2*acos(x) *asin(acos(x))
  26. 2 2
  27. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2
  28. *tan(-----------------------------------------------------)
  29. x
  30. 2 2 2 2
  31. + 2*acos(x) *asin(acos(x)) + sqrt( - x + 1)*sqrt( - acos(x) + 1)*acos(x)
  32. 2 2
  33. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2
  34. *tan(-----------------------------------------------------) *x
  35. x
  36. 2 2 2
  37. + sqrt( - x + 1)*sqrt( - acos(x) + 1)*acos(x) *x
  38. 2 2
  39. 2 sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2 3
  40. + 4*acos(x) *tan(-----------------------------------------------------) *x
  41. x
  42. 2 3
  43. + 4*acos(x) *x
  44. 2 2
  45. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2
  46. - asin(acos(x))*tan(-----------------------------------------------------)
  47. x
  48. 2 2
  49. - asin(acos(x)) - sqrt( - x + 1)*sqrt( - acos(x) + 1)
  50. 2 2
  51. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2
  52. *tan(-----------------------------------------------------) *x
  53. x
  54. 2 2
  55. - sqrt( - x + 1)*sqrt( - acos(x) + 1)*x
  56. 2 2
  57. sqrt( - x + 1)*asin(acos(x)) + 2*sqrt( - x + 1)*x 2 3 3
  58. - 2*tan(-----------------------------------------------------) *x - 2*x )/(
  59. x
  60. 2 2 4 2
  61. sqrt( - x + 1)*x *(acos(x) - 2*acos(x) + 1))
  62. % 20 Oct 99.
  63. % This gave a wrong answer.
  64. a1:=12x^2-16x+3;
  65. 2
  66. a1 := 12*x - 16*x + 3
  67. a2:=3x-4;
  68. a2 := 3*x - 4
  69. off mcd;
  70. on combineexpt;
  71. e^(a1/a2);
  72. -1 2 -1 -1
  73. 12*(3*x - 4) *x - 16*(3*x - 4) *x + 3*(3*x - 4)
  74. e
  75. on mcd;
  76. off combineexpt;
  77. clear a1,a2;
  78. % 8 Nov 99.
  79. % This gave a catastrophic error.
  80. factorize(2*c*s*u^3*v^5-2*c*s*u^3*v +2*c*s*u*v^5-2*c*s*u*v
  81. -s^2*u^4*v^4+s^2*u^4+s^2*u^2*v^6-s^2*u^2*v^4-s^2*u^2*v^2
  82. +s^2*u^2 +s^2*v^6-s^2*v^2+u^4*v^4-u^4*v^2 -v^4+v^2);
  83. 3 2 2 2 2 2 2 4 2 2 2 2 2
  84. {{2*c*s*u*v + 2*c*s*u*v - s *u *v - s *u + s *v + s *v + u *v - v ,
  85. 1},
  86. 2
  87. {u + 1,1},
  88. {v + 1,1},
  89. {v - 1,1}}
  90. % 18 Dec 99.
  91. % The following integration generated a catastrophic error.
  92. load_package numeric;
  93. on rounded;
  94. f := exp(10*exp(-x)*(x+1-0.1))$
  95. num_int(f,x=(0 .. 300));
  96. 5615.56420985
  97. off rounded;
  98. clear f;
  99. % 31 Jan 00.
  100. % This gave an error that x was invalid as a kernel.
  101. weight x=1,y=1;
  102. {}
  103. wtlevel 10;
  104. 1
  105. factor x;
  106. symbolic(wtl!* := asymplis!* := nil);
  107. remfac x;
  108. % 5 Feb 00.
  109. % This gave a spurious error.
  110. matx := mat((1,2));
  111. matx := [1 2]
  112. sign sqrt 42;
  113. 1
  114. % 6 Feb 00.
  115. % This gave a wrong answer.
  116. on complex;
  117. sqrt(i*sqrt(3)-1);
  118. sqrt(2)*(i*sqrt(3) + 1)
  119. -------------------------
  120. 2
  121. off complex;
  122. % 10 Feb 00.
  123. % This gave the error that "***** x= - 2.61803398875 invalid as scalar."
  124. on rounded,fullroots;
  125. solve(x^3+4*x^2+4*x+1,x);
  126. {x= - 2.61803398875,x= - 0.38196601125,x=-1}
  127. off rounded,fullroots;
  128. % 18 Feb 00.
  129. % This used to cause a type mismatch error.
  130. m := mat((a,b),(c,d));
  131. [a b]
  132. m := [ ]
  133. [c d]
  134. det sub(a=1,m);
  135. - b*c + d
  136. % 18 Apr 00.
  137. % matchlength!* can now be set to match more products.
  138. for all a let opr(a*v) = a*opr(v);
  139. *** opr declared operator
  140. opr(a1*a2*a3*a4*a5*v);
  141. opr(a1*a2*a3*a4*a5*v)
  142. matchlength!* := 6;
  143. matchlength* := 6
  144. opr(a1*a2*a3*a4*a5*v);
  145. opr(v)*a1*a2*a3*a4*a5
  146. % 22 Apr 00;
  147. % This example created a long list in oldrules!*.
  148. procedure hu (x); wq(x) := x^2;
  149. hu
  150. wq(2) := 20;
  151. *** wq declared operator
  152. wq(2) := 20
  153. for i:=1:1000 do hu i;
  154. for i:=1:1000 do hu i;
  155. lisp length oldrules!*;
  156. 0
  157. % 28 Jul 00.
  158. % A sum index within a derivative was treated as an identifier.
  159. sum(x^n/factorial n*sub(x=0,df(cos x,x,n)),n,0,5);
  160. 4 2
  161. x - 12*x + 24
  162. -----------------
  163. 24
  164. % 2 Aug 00.
  165. % With complex on, some factorizations seemed to run forever.
  166. on complex;
  167. factorize (400*y^12+400*y^10*z+40*y^9*z^2+100*y^8*z^2
  168. +20*y^7*z^5+120*y^7*z^4+20*y^7*z^3+41*y^6*z^4+60*y^5*z^7
  169. +60*y^5*z^5+20*y^4*z^7+6*y^4*z^6+20*y^4*z^5
  170. +2*y^3*z^6+9*y^2*z^8+6*y*z^8+z^8);
  171. 12 10 9 2 8 2 7 5 7 4 7 3
  172. {{400*y + 400*y *z + 40*y *z + 100*y *z + 20*y *z + 120*y *z + 20*y *z
  173. 6 4 5 7 5 5 4 7 4 6 4 5 3 6
  174. + 41*y *z + 60*y *z + 60*y *z + 20*y *z + 6*y *z + 20*y *z + 2*y *z
  175. 2 8 8 8
  176. + 9*y *z + 6*y*z + z ,
  177. 1}}
  178. off complex;
  179. % 29 Aug 00.
  180. % This caused a segmentation violation or similar error.
  181. load_package gentran,scope;
  182. matrix aaa(10,10);
  183. on gentranopt;
  184. gentran aaa(1,1) ::=: aaa(1,1);
  185. real aaa(n,n)
  186. aaa(1,1)=0.0
  187. t
  188. off gentranopt;
  189. % 19 Sep 00.
  190. % This used to give a spurious "not found" message.
  191. sqrt_:= {sqrt(~x/~y) => sqrt x/sqrt y};
  192. ~x sqrt(x)
  193. sqrt_ := {sqrt(----) => ---------}
  194. ~y sqrt(y)
  195. clearrules sqrt_;
  196. clear sqrt_;
  197. % 20 Sep 00.
  198. % The following caused a catastrophic error.
  199. load_package algint;
  200. int(1/sqrt((2*e^c-y)/(e^c*y)),y);
  201. c
  202. c/2 c c sqrt(2*e - y)
  203. e *( - sqrt(y)*sqrt(2*e - y) + e *int(--------------------------,y))
  204. c
  205. 2*sqrt(y)*e - sqrt(y)*y
  206. % 8 Nov 00.
  207. % The following did not optimize completely.
  208. load_package scope;
  209. dX1 := - sqrt(abs(k_l*mttx1 - k_l*mttx2))*sign(k_l*mttx1 - k_l*mttx2)*f*mttu5 +
  210. sqrt(abs(k_l*mttx1 - k_s*mttx3 - mttu3))*
  211. sign( - k_l*mttx1 + k_s*mttx3 + mttu3)*f*mttu6 +
  212. sqrt(abs(k_l*mttx1 - k_s*mttx4 - mttu4))*
  213. sign( - k_l*mttx1 + k_s*mttx4 + mttu4)*f*mttu7 - mttu2$
  214. dX2 := sqrt(abs(k_l*mttx1 - k_l*mttx2))*sign(k_l*mttx1 - k_l*mttx2)*f*mttu5
  215. - sqrt(abs(k_l*mttx2 - k_s*mttx3))*sign(k_l*mttx2 - k_s*mttx3)*f*mttu8
  216. - sqrt(abs(k_l*mttx2 - k_s*mttx4))*sign(k_l*mttx2 - k_s*mttx4)*f*mttu9 +
  217. mttu1$
  218. dX3 := f*( - sqrt(abs(k_l*mttx1 - k_s*mttx3 - mttu3))*
  219. sign( - k_l*mttx1 + k_s*mttx3 + mttu3)*mttu6 +
  220. sqrt(abs(k_l*mttx2 - k_s*mttx3))*
  221. sign(k_l*mttx2 - k_s*mttx3)*mttu8)$
  222. dX4 := f*( - sqrt(abs(k_l*mttx1 - k_s*mttx4 - mttu4))*
  223. sign( - k_l*mttx1 + k_s*mttx4 + mttu4)*mttu7 +
  224. sqrt(abs(k_l*mttx2 - k_s*mttx4))*
  225. sign(k_l*mttx2 - k_s*mttx4)*mttu9)$
  226. optimize
  227. dX1 :=: dX1,
  228. dX2 :=: dX2,
  229. dX3 :=: dX3,
  230. dX4 :=: dX4
  231. iname s$
  232. s31 := mttx2*k_l
  233. s33 := mttx1*k_l
  234. s3 := s33 - s31
  235. s32 := mttx3*k_s
  236. s7 := s32 - s33 + mttu3
  237. s30 := mttx4*k_s
  238. s11 := s30 - s33 + mttu4
  239. s26 := mttu7*sign(s11)*sqrt(abs( - s11))*f
  240. s28 := mttu6*sign(s7)*sqrt(abs( - s7))*f
  241. s29 := mttu5*f*sign(s3)*sqrt(abs(s3))
  242. dx1 := s26 + s28 - s29 - mttu2
  243. s15 := s31 - s32
  244. s19 := s31 - s30
  245. s25 := mttu9*sign(s19)*sqrt(abs(s19))*f
  246. s27 := mttu8*sign(s15)*sqrt(abs(s15))*f
  247. dx2 := s29 + mttu1 - s25 - s27
  248. dx3 := s27 - s28
  249. dx4 := s25 - s26
  250. remprop('!:rd!:,'intequivfn);
  251. rdintequiv
  252. % 20 Nov 00.
  253. % This used to return results in the wrong order.
  254. noncom u,v;
  255. sum(u(n)*v(1-n),n,0,1);
  256. *** u declared operator
  257. *** v declared operator
  258. u(1)*v(0) + u(0)*v(1)
  259. % 13 Dec 00.
  260. % This used to go into an infinite loop.
  261. on numval,rounded;
  262. y:=x^4+x3*x^3+x2*x^2+x1*x+x0;
  263. 4 3 2
  264. y := x + x *x3 + x *x2 + x*x1 + x0
  265. on fullroots;
  266. % This one takes a long time.
  267. % solve(y,x)$
  268. off numval,rounded,fullroots;
  269. clear y;
  270. % 9 Jan 01.
  271. solve({y=x+t^2,x=y+u^2},{x,y,u,t});
  272. 2
  273. {{x=y - t ,
  274. y=arbcomplex(4),
  275. u=t*i,
  276. t=arbcomplex(3)},
  277. 2
  278. {x=y - t ,
  279. y=arbcomplex(2),
  280. u= - t*i,
  281. t=arbcomplex(1)}}
  282. % 14 Jan 01.
  283. % This caused an error.
  284. resultant(p^3-3p^2-a,3p*(p-2),p);
  285. 27*a*(a + 4)
  286. % 19 Jan 01.
  287. % Some algebraic integrals could produce a catastrophic error.
  288. % Unfortunately, there is no simple example of this problem.
  289. % 22 Jan 01.
  290. % This used to give a spurious zero divisor error.
  291. int((sqrt((-sqrt(a^4*x^2+4)+a^2*x)/(2*x))
  292. *(-sqrt(a^4*x^2+4)*a^2*x-a^4*x^2-4))/(2*(a^4*x^2+4)),x);
  293. 4 2 2
  294. sqrt( - sqrt(a *x + 4) + a *x)
  295. (sqrt(2)*( - 4*int(---------------------------------,x)
  296. 4 2
  297. sqrt(x)*a *x + 4*sqrt(x)
  298. 4 2 2
  299. sqrt(x)*sqrt( - sqrt(a *x + 4) + a *x)*x 4
  300. - int(-------------------------------------------,x)*a
  301. 4 2
  302. a *x + 4
  303. 4 2 4 2 2
  304. sqrt(x)*sqrt(a *x + 4)*sqrt( - sqrt(a *x + 4) + a *x) 2
  305. - int(---------------------------------------------------------,x)*a
  306. 4 2
  307. a *x + 4
  308. ))/4
  309. % This used to return an incorrect result.
  310. noncom q;
  311. 1/mat((1,0,0),(x/p*q 1,1,0),(x*y/(2p*(p-1))*q 1*q 1,y/(p-2)*q 1,1));
  312. *** q declared operator
  313. [ 1 0 0]
  314. [ ]
  315. [ - x*q(1) ]
  316. [ ----------- 1 0]
  317. [ p ]
  318. [ ]
  319. [ 2 ]
  320. [ x*y*q(1) - y*q(1) ]
  321. [------------------ ----------- 1]
  322. [ 2 p - 2 ]
  323. [ 2*(p - 3*p + 2) ]
  324. % 2 Feb 01.
  325. % This used to give a spurious zero divisor error.
  326. solve(sqrt x*sqrt((4x^2*x+1)/x)-1=0,x);
  327. {x=0}
  328. % 9 Feb 01.
  329. % The patched version of combine!-logs included an undefined macro.
  330. % No test is included for this.
  331. % 20 Feb 01.
  332. % Even with combineexpt on, some expressions did not simplify adequately.
  333. on combineexpt;
  334. a*a^x;
  335. x + 1
  336. a
  337. e*e^(2/(2-x));
  338. (x - 4)/(x - 2)
  339. e
  340. e^(x+3)*e^(3/(4-3*x))/e^(5*x-3);
  341. 2
  342. ( - 12*x + 34*x - 27)/(3*x - 4)
  343. e
  344. off combineexpt;
  345. % 6 Mar 01.
  346. % This produced a stream of "***** Unexpected algebraic" messages and
  347. % then aborted.
  348. int((x^(2/3)*sqrt(sqrt(y)*sqrt(pi) + 2*pi*y*x)*sqrt( - sqrt(y)*sqrt(pi)
  349. + 2pi*y*x))/(4pi*y*x^3 - x),x);
  350. sqrt(sqrt(y)*sqrt(pi) + 2*pi*x*y)*sqrt( - sqrt(y)*sqrt(pi) + 2*pi*x*y)
  351. int(------------------------------------------------------------------------,x)
  352. 1/3 2 1/3
  353. 4*x *pi*x *y - x
  354. end;
  355. 4: 4: 4: 4: 4: 4: 4: 4: 4:
  356. Time for test: 30720 ms, plus GC time: 1070 ms
  357. 5: 5:
  358. Quitting
  359. Tue Mar 6 13:52:51 PST 2001