home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / progs / pari / pari_137 / testin < prev    next >
Text File  |  1992-09-17  |  10KB  |  445 lines

  1. \e
  2. \precision=40
  3. pi
  4. \precision=20
  5. o(x^12)
  6. 5/3+o(127^5)
  7. initrect(0,500,500)
  8. \\ A
  9. abs(-0.01)
  10. acos(0.5)
  11. acosh(3)
  12. acurve=initell([0, 0, 1, -1, 0])
  13. apoint=[2, 2]
  14. isoncurve(acurve, apoint)
  15. addell(acurve, apoint, apoint)
  16. adj([1, 2; 3, 4])
  17. agm(1, 2)
  18. agm(1 + o(7^5), 8 + o(7^5))
  19. algdep(2 * cos(2 * pi / 13), 6)
  20. akell(acurve,1000000007)
  21. anell(acurve, 100)
  22. apell(acurve,10007)
  23. apell2(acurve,10007)
  24. apol=x^3+5*x+1
  25. apprpadic(apol,1+O(7^8))
  26. apprpadic(x^3+5*x+1,mod(x*(1+O(7^8)),x^2+x-1))
  27. 4 * arg(3+3*i)
  28. 3 * asin(sqrt(3)/2)
  29. asinh(0.5)
  30. assmat(x^5-12*x^3+0.0005)
  31. 3 * atan(sqrt(3))
  32. atanh(0.5)
  33. \\ B
  34. base(x^3+4*x+5)
  35. bernreal(12)
  36. bernvec(6)
  37. bezout(123456789,987654321)
  38. bigomega(12345678987654321)
  39. bin(1.1,5)
  40. binary(65537)
  41. bittest(10^100,100)
  42. boundcf(pi,5)
  43. boundfact(40!+1,100000)
  44. box(0,0,0,500,500)
  45. \\buchimag(1-10^15,0.8,20)
  46. \\buchreal(10^15-3,0,0.8,20)
  47. \\ C
  48. ceil(-2.5)
  49. centerlift(mod(456,555))
  50. cf(pi)
  51. cf2([1,3,5,7,9],(exp(1)-1)/(exp(1)+1))
  52. changevar(x + y, [z, t])
  53. char([1, 2; 3, 4], z)
  54. char(mod(x^2+x+1,x^3+5*x+1),z)
  55. char1([1, 2; 3, 4], z)
  56. char2(mod(1,8191)*[1, 2; 3, 4], z)
  57. acurve = chell(acurve, [-1, 1, 2, 3])
  58. chinese(mod(7, 15), mod(13, 21))
  59. apoint = chptell(apoint, [-1, 1, 2, 3])
  60. isoncurve(acurve, apoint)
  61. classno(-12391)
  62. classno(1345)
  63. classno2(-12391)
  64. classno2(1345)
  65. coeff(sin(x),7)
  66. compo(1+o(7^4), 3)
  67. compose(qfi(2, 1, 3), qfi(2, 1, 3))
  68. comprealraw(qfr(5,3,-1,0.),qfr(7,1,-1,0.))
  69. concat([1, 2], [3, 4])
  70. conj(1+i)
  71. %_
  72. content([123, 456, 789, 234])
  73. convol(sin(x), x * cos(x))
  74. cos(1)
  75. cosh(1)
  76. move(0,200,150)
  77. cursor(0)
  78. cvtoi(1.7)
  79. cyclo(105)
  80. \\ D
  81. denom(12345/54321)
  82. deriv((x + y)^5, y)
  83. ((x+y)^5)'
  84. det([1, 2, 3; 1, 5, 6; 9, 8, 7])
  85. det2([1, 2, 3; 1, 5, 6; 9, 8, 7])
  86. detr([1, 2, 3; 1, 5, 6; 9, 8, 7])
  87. dilog(0.5)
  88. disc(x^3+4*x+5)
  89. discf(x^3+4*x+5)
  90. divisors(8!)
  91. divres(345, 123)
  92. divres(x^7 - 1, x^5 + 1)
  93. divsum(8!,x,x)
  94. \\ draw([0,0,0])
  95. postdraw([0,0,0])
  96. \\ E
  97. eigen([1, 2, 3; 4, 5, 6; 7, 8, 9])
  98. eint1(2)
  99. erfc(2)
  100. eta(q)
  101. euler
  102. z = y; y = x; eval(z)
  103. exp(1)
  104. extract([1,2,3,4,5,6,7,8,9,10], 1000)
  105. \\ F
  106. 10!
  107. fact(10)
  108. lift(lift(factfq(x^3+x^2+x-1,3,t^3+t^2+t-1)))
  109. factmod(x^11+1, 7)
  110. factor(17!+1)
  111. p=x^5+3021*x^4-786303*x^3-6826636057*x^2-546603588746*x+3853890514072057
  112. fa=[11699, 6; 2392997, 2; 4987333019653, 2]
  113. factoredbase(p,fa)
  114. factoreddiscf(p,fa)
  115. \precision=40
  116. factoredpolred(p,fa)
  117. factoredpolred2(p,fa)
  118. \precision=20
  119. lift(factornf(y^3+y^2-2*y-1,x^3+x^2-2*x-1))
  120. factorpadic(apol,7,8)
  121. factpol(x^15-1, 3)
  122. factpol(x^15-1, 0)
  123. factpol2(x^15-1, 0)
  124. fibo(100)
  125. floor(-1/2)
  126. floor(-2.5)
  127. for(x=1,5,print(x!))
  128. fordiv(10,x,print(x))
  129. forprime(p=1,30,print(p))
  130. forstep(x=0,pi,pi/12,print(sin(x)))
  131. frac(-2.7)
  132. \\ G
  133. galois(x^6-3*x^2-1)
  134. galoisconj(x^6+108)
  135. gamh(10)
  136. gamma(10.5)
  137. gauss(hilbert(10),[1, 2, 3, 4, 5, 6, 7, 8, 9, 0])
  138. gcd(12345678, 87654321)
  139. globalred(acurve)
  140. k=4;goto(k%2);label(0);print("even");goto(3);label(1);print("odd");label(3);
  141. \\ H
  142. hclassno(2000003)
  143. hell(acurve, apoint)
  144. hell2(acurve, apoint)
  145. hell3(acurve, apoint)
  146. hermite(1/hilbert(7))
  147. hess(hilbert(7))
  148. hilb(2/3, 3/4, 5)
  149. hilbert(5)
  150. hilbp(mod(5,7),mod(6, 7))
  151. hvector(10,x,1/x)
  152. hyperu(1,1,1)
  153. \\ I
  154. i^2
  155. idmat(5)
  156. if(3 < 2, print("bof"), print("ok"));
  157. imag(2+3*i)
  158. image([1,3,5;2,4,6;3,5,7])
  159. incgam(2,1)
  160. incgam1(2,1)
  161. incgam2(2,1)
  162. incgam3(2,1)
  163. incgam4(4,1,6)
  164. indexrank([1,1,1;1,1,1;1,1,2])
  165. indsort([8, 7, 6, 5])
  166. initalg(x^5-5*x^4+8*x^3-4*x^2-1)
  167. initell([0,0,0,-1,0])
  168. initell2([0,0,0,0,-1])
  169. initrect(1,700,700)
  170. integ(sin(x), x)
  171. intersect([1,2;3,4;5,6],[2,3;7,8;8,9])
  172. \precision=9
  173. intgen(x=0,pi,sin(x))
  174. sqr(2*intgen(x=0,4,exp(-x^2)))
  175. 4*intinf(x=1,10000,1/(1+x^2))
  176. intnum(x = -0.999, 0.999, 1/sqrt(1 - x^2))
  177. 2 * intopen(x = 0, 100, sin(x)/x)
  178. \precision=28
  179. inverseimage([1,1;2,3;5,7],[2,2,6]~)
  180. isfund(12345)
  181. isincl(x^2+1,x^4+1)
  182. isisom(x^3+x^2-2*x-1,x^3+x^2-2*x-1)
  183. isprime(12345678901234567)
  184. ispsp(73!+1)
  185. isqrt(10!^2+1)
  186. issqfree(123456789876543219)
  187. issquare(12345678987654321)
  188. \\ J
  189. jacobi(hilbert(6))
  190. jbesselh(1,1)
  191. jell(i)
  192. \\ K
  193. kbessel(1 + i, 1)
  194. kbessel2(1 + i, 1)
  195. x
  196. y
  197. ker(matrix(4,4,x,y,x/y))
  198. keri(matrix(4,4,x,y,x+y))
  199. kerint(matrix(4,4,x,y,x*y))
  200. kerint1(matrix(4,4,x,y,x*y))
  201. kerint2(matrix(4,6,x,y,2520/(x+y)))
  202. kerr(matrix(4,4,x,y,sin(x+y)))
  203. f(u)=u+1;
  204. print(f(5)); kill(f);
  205. f=12
  206. killrect(1)
  207. kro(5,7)
  208. kro(3,18)
  209. \\ L
  210. k=4;goto(k%2);label(0);print("even");goto(3);label(1);print("odd");label(3);
  211. laplace(x*exp(x*y)/(exp(x)-1))
  212. lcm(15,-21)
  213. length(divisors(1000))
  214. legendre(10)
  215. lex([1,3],[1,3,5])
  216. lexsort([[1,5],[2,4],[1,5,1],[1,4,2]])
  217. lift(chinese(mod(7,15),mod(4,21)))
  218. lindep([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)])
  219. lindep2([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)],40)
  220. line(0,0,900,900,0)
  221. lines(0,vector(5,k,50*k),vector(5,k,10*k*k))
  222. m=1/hilbert(7)
  223. mp=concat(m,idmat(7))
  224. lll(m)
  225. lll1(m)
  226. lllgram(m)
  227. lllgram1(m)
  228. lllgramint(m)
  229. lllgramkerim(mp~*mp)
  230. lllint(m)
  231. lllkerim(mp)
  232. lllrat(m)
  233. \precision=100
  234. ln(2)
  235. lngamma(10^50*i)
  236. \precision=2000
  237. log(2)
  238. logagm(2)
  239. \precision=9
  240. bcurve=initell([0,0,0,-3,0])
  241. localred(bcurve,2)
  242. ccurve=initell([0,0,-1,-1,0])
  243. l=lseriesell(ccurve,2,-37,1)
  244. lseriesell(ccurve,2,-37,1.2)-l
  245. \\ M
  246. mat(concat(vector(4,x,x)~,vector(4,x,10+x)~))
  247. matell(initell([0,0,0,-17,0]),[[-1,4],[-4,2]])
  248. matextract(matrix(15,15,x,y,x+y),vector(5,x,3*x),vector(3,y,3*y))
  249. matinvr(1.*hilbert(7))
  250. matsize([1,2;3,4;5,6])
  251. matrix(5,5,x,y,gcd(x,y))
  252. matrixqz([1,3;3,5;5,7],0)
  253. matrixqz2([1/3,1/4,1/6;1/2,1/4,-1/4;1/3,1,0])
  254. matrixqz3([1,3;3,5;5,7])
  255. max(2,3)
  256. min(2,3)
  257. minim([2,1;1,2],4,6)
  258. mod(-12,7)
  259. modp(-12,7)
  260. mod(10873,49649)^-1
  261. modreverse(mod(x^2+1,x^3-x-1))
  262. move(0,243,583);cursor(0)
  263. mu(3*5*7*11*13)
  264. \\ N
  265. newtonpoly(x^4+3*x^3+27*x^2+9*x+81,3)
  266. nextprime(100000000000000000000000)
  267. norm(1+i)
  268. norm(mod(x+5,x^3+x+1))
  269. norml2(vector(10,x,x))
  270. nucomp(qfi(2,1,9),qfi(4,3,5),3)
  271. form=qfi(2,1,9);nucomp(form,form,3)
  272. numdiv(2^99*3^49)
  273. numer((x+1)/(x-1))
  274. nupow(form,111)
  275. \\ O
  276. 1/(1+x)+o(x^20)
  277. omega(100!)
  278. ordell(acurve, 1)
  279. order(mod(33,2^16+1))
  280. ordred(x^3-12*x+45*x-1)
  281. \\ P
  282. pascal(8)
  283. permutation(7,1035)
  284. pf(-44,3)
  285. phi(257^2)
  286. pi
  287. plot(x=-5,5,sin(x))
  288. \\ ploth(x=-5,5,sin(x))
  289. \\ ploth2(t=0,2*pi,[sin(5*t),sin(7*t)])
  290. \\ plothraw(vector(100,k,k),vector(100,k,k*k/100))
  291. pnqn([2,6,10,14,18,22,26])
  292. pnqn([1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1])
  293. point(0,225,334)
  294. points(0,vector(10,k,10*k),vector(10,k,5*k*k))
  295. pointell(acurve,zell(acurve,apoint))
  296. polint([0,2,3],[0,4,9],5)
  297. polred(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
  298. polred2(x^4-28*x^3-458*x^2+9156*x-25321)
  299. polsym(x^17-1,17)
  300. poly(sin(x),x)
  301. polylog(5,0.5)
  302. polylog(-4,t)
  303. polylogd(5,0.5)
  304. polylogdold(5,0.5)
  305. polylogp(5,0.5)
  306. poly([1,2,3,4,5],x)
  307. polyrev([1,2,3,4,5],x)
  308. \\draw([0,20,20])
  309. postdraw([0,20,20])
  310. \\postploth(x=-5,5,sin(x))
  311. \\postploth2(t=0,2*pi,[sin(5*t),sin(7*t)])
  312. postplothraw(vector(100,k,k),vector(100,k,k*k/100))
  313. powell(acurve,10,apoint)
  314. powrealraw(qfr(5,3,-1,0.),3)
  315. pprint((x-12*y)/(y+13*x));
  316. pprint([1,2;3,4])
  317. pprint1(x+y);pprint(x+y);
  318. \precision=100
  319. pi
  320. prec(pi,20)
  321. \precision=20
  322. prime(100)
  323. primes(100)
  324. forprime(p=2,100,print(p, " ", lift(primroot(p))))
  325. print((x-12*y)/(y+13*x));
  326. print([1,2;3,4])
  327. print1(x+y);print1(" egale ");print(x+y);
  328. prod(1,k=1,10,1+1/k!)
  329. prod(1.,k=1,10,1+1/k!)
  330. pi^2/6*prodeuler(p=2,10000,1-p^-2)
  331. prodinf(n=0,(1+2^-n)/(1+2^(-n+1)))
  332. prodinf1(n=0,-2^-n/(1+2^(-n+1)))
  333. psi(1)
  334. \\ Q
  335. quadgen(-11)
  336. quadpoly(-11)
  337. \\ R
  338. smith(matrix(5,5,j,k,random()))
  339. rank(matrix(5,5,x,y,x+y))
  340. move(0,50,50);rbox(0,100,100)
  341. print1("give a value for s? ");s=read();print(1/s)
  342. 37.
  343. real(5-7*i)
  344. recip(3*x^7-5*x^3+6*x-9)
  345. redcomp(qfi(3,10,12))
  346. redreal(qfr(3,10,-20,1.5))
  347. redrealnod(qfr(3,10,-20,1.5),18)
  348. regula(17)
  349. kill(y);print(x+y);reorder([x, y]); print(x+y);
  350. resultant(x^3-1,x^3+1)
  351. resultant2(x^3-1.,x^3+1.)
  352. reverse(tan(x))
  353. rhoreal(qfr(3,10,-20,1.5))
  354. rhorealnod(qfr(3,10,-20,1.5),18)
  355. rline(0,200,150)
  356. cursor(0)
  357. rmove(0,5,5);cursor(0)
  358. rndtoi(prod(1,k=1,17,x-exp(2*i*pi*k/17)))
  359. rootmod(x^16-1,41)
  360. rootpadic(x^4+1,41,6)
  361. roots(x^5-1)
  362. rootslong(x^4-1000000000000000000000)
  363. round(prod(1,k=1,17,x-exp(2*i*pi*k/17)))
  364. rounderror(prod(1,k=1,17,x-exp(2*i*pi*k/17)))
  365. rpoint(0,20,20)
  366. \\ S
  367. q*series(anell(acurve,100),q)
  368. shift(1,50)
  369. shift([3,4,-11,-12],-2)
  370. shiftmul([3,4,-11,-12],-2)
  371. sigma(100)
  372. sigmak(2,100)
  373. sigmak(-3,100)
  374. sign(-1)
  375. sign(0)
  376. sign(0.)
  377. signat(hilbert(5)-0.11*idmat(5))
  378. simplify(((x+i+1)^2-x^2-2*x*(i+1))^2)
  379. sin(pi/6)
  380. sinh(1)
  381. size([1.3*10^5,2*i*pi*exp(4*pi)])
  382. smallbase(x^3+4*x+5)
  383. smalldiscf(x^3+4*x+5)
  384. smallfact(100!+1)
  385. smallinitell([0,0,0,-17,0])
  386. smallpolred(x^4+576)
  387. smallpolred2(x^4+576)
  388. smith(1/hilbert(6))
  389. solve(x=1,4,sin(x))
  390. sort(vector(17,x,5*x%17))
  391. sqr(1+o(2))
  392. sqred(hilbert(5))
  393. sqrt(13+o(127^12))
  394. srgcd(x^10-1,x^15-1)
  395. move(0,100,100);string(0,pi)
  396. move(0,200,200);string(0,"(0,0)")
  397. \\draw([0,10,10])
  398. postdraw([0,10,10])
  399. apol=0.3+legendre(10)
  400. sturm(apol)
  401. sturmpart(apol,0.91,1)
  402. subell(initell([0,0,0,-17,0]),[-1,4],[-4,2])
  403. subst(sin(x),x,y)
  404. subst(sin(x),x,x+x^2)
  405. sum(0,k=1,10,2^-k)
  406. sum(0.,k=1,10,2^-k)
  407. \precision=20
  408. 4*sumalt(n=0,(-1)^n/(2*n+1))
  409. suminf(n=1,2.^-n)
  410. 6/pi^2*sumpos(n=1,n^-2)
  411. supplement([1,3;2,4;3,6])
  412. \\ T
  413. sqr(tan(pi/3))
  414. tanh(1)
  415. taylor(y/(x-y),y)
  416. tchebi(10)
  417. tchirnhausen(x^5-x-1)
  418. teich(7+o(127^12))
  419. texprint((x+y)^3/(x-y)^2)
  420. theta(0.5,3)
  421. thetanullk(0.5,7)
  422. trace(1+i)
  423. trace(mod(x+5,x^3+x+1))
  424. trans(vector(2,x,x))
  425. %*%~
  426. trunc(-2.7)
  427. trunc(sin(x^2))
  428. type(mod(x,x^2+1))
  429. \\ U
  430. unit(17)
  431. n=33;until(n==1,print1(n," ");if(n%2,n=3*n+1,n=n/2));print(1)
  432. \\ V
  433. valuation(6^10000-1,5)
  434. vec(sin(x))
  435. vecsort([[1,8],[2,5],[3,6],[4,1]],2)
  436. \\ W
  437. wf(i)
  438. wf2(i)
  439. m=5; while(m<20, print1(m, " ");m=m+1); print()
  440. \\ Z
  441. zell(acurve, apoint)
  442. zeta(3)
  443. zeta(0.5+14.1347251*i)
  444.  
  445.