definta.red 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576
  1. %***********************************************************************
  2. %* INTEGRATION *
  3. %***********************************************************************
  4. module definta$
  5. transform_lst := '();
  6. algebraic operator f1$
  7. algebraic operator f2$
  8. fluid '(MELLINCOEF);
  9. fluid '(plotsynerr!*);
  10. %***********************************************************************
  11. %* MAIN PROCEDURES *
  12. %***********************************************************************
  13. symbolic smacro procedure gw u;
  14. caar u$
  15. symbolic smacro procedure gl u;
  16. caadar u$
  17. symbolic smacro procedure gk u;
  18. cdadar u$
  19. symbolic smacro procedure gr u;
  20. cadar u$
  21. symbolic smacro procedure gm u;
  22. caadr u$
  23. symbolic smacro procedure gn u;
  24. cadadr u$
  25. symbolic smacro procedure gp u;
  26. caddr cadr u$
  27. symbolic smacro procedure gq u;
  28. cadddr cadr u$
  29. symbolic smacro procedure ga u;
  30. caddr u$
  31. symbolic smacro procedure gb u;
  32. cadddr u$
  33. symbolic procedure rdwrap f;
  34. if numberp f then float f
  35. else if f='pi then 3.141592653589793238462643
  36. else if f='e then 2.7182818284590452353602987
  37. else if atom f then f
  38. else if eqcar(f, '!:RD!:) then
  39. if atom cdr f then cdr f else bf2flr f
  40. else if eqcar(f, '!:DN!:) then rdwrap2 cdr f
  41. else if eqcar(f, 'MINUS) then
  42. begin scalar x;
  43. x := rdwrap cadr f;
  44. return if numberp x then minus float x else {'MINUS, x}
  45. end
  46. else if get(car f, 'DNAME) then
  47. << plotsynerr!*:=t;
  48. rerror(PLOTPACKAGE, 32, {get(car f, 'DNAME),
  49. "illegal domain for PLOT"})
  50. >>
  51. else if eqcar(f,'expt) then rdwrap!-expt f
  52. else rdwrap car f . rdwrap cdr f;
  53. symbolic procedure rdwrap!-expt f;
  54. % preserve integer second argument.
  55. if fixp caddr f then {'expt!-int,rdwrap cadr f,caddr f}
  56. else {'expt,rdwrap cadr f, rdwrap caddr f};
  57. symbolic procedure rdwrap2 f;
  58. % Convert from domain to LISP evaluable value.
  59. if atom f then f else float car f * 10^cdr f;
  60. symbolic procedure rdwrap!* f;
  61. % convert a domain element to float.
  62. if null f then 0.0 else rdwrap f;
  63. symbolic procedure rdunwrap f;
  64. if f=0.0 then 0 else if f=1.0 then 1 else '!:rd!: . f;
  65. symbolic procedure expt!-int(a,b); expt(a,fix b);
  66. put('intgg,'simpfn,'simpintgg)$
  67. symbolic procedure simpintgg(u);
  68. <<u:=intggg(car u,cadr u,caddr u,cadddr u);
  69. simp prepsq u>>;
  70. symbolic procedure intggg(u1,u2,u3,u4);
  71. begin scalar v,v1,v2,s1,s2,s3,coef,uu1,uu2,test_1,test_1a,test_2,m,n,p,
  72. q,delta,xi,eta,test,temp,temp1,temp2,var,var1,var2;
  73. off allfac;
  74. uu1:= cadr u1; uu1:= prepsq cadr(algebraic uu1);
  75. uu2:= cadr u2; uu2:= prepsq cadr(algebraic uu2);
  76. u1:=if null cddr u1 then list('f1, uu1) else 'f1 . uu1 . cddr u1;
  77. u2:=if null cddr u2 then list('f2, uu2) else 'f2 . uu2 . cddr u2;
  78. % Cases for the integration of a single Meijer G-function
  79. if equal(get('F1,'G),'(1 . 1)) and
  80. equal(get('F2,'G),'(1 . 1)) then
  81. return simp 'UNKNOWN
  82. else if equal(get('F1,'G),'(1 . 1)) then
  83. % Obtain the appropriate Meijer G-function
  84. <<s1:=bastab(car u2,cddr u2);
  85. v:= trpar(car cddddr s1, cadr u2, u4);
  86. on allfac;
  87. if v='FAIL then return simp 'FAIL;
  88. % Substitute in the correct variable value
  89. temp := car cddddr s1;
  90. var := cadr u2;
  91. temp := reval algebraic(sub(x=var,temp));
  92. s1 := {car s1,cadr s1,caddr s1,cadddr s1,temp};
  93. % Ensure by simplification that the variable does not contain a power
  94. s1 := simp_expt(u3,s1);
  95. u3 := car s1;
  96. s1 := cdr s1;
  97. % Test the validity of the following formulae
  98. % 'The Special Functions and their Approximations', Volume 1,
  99. % Y.L.Luke. Chapter 5.6 page 157 (3),(3*) & (4)
  100. test_1 := test_1(nil,u3,s1);
  101. test_1a := test_1('a,u3,s1);
  102. test_2 := test2(u3,cadr s1,caddr s1);
  103. m := caar s1;
  104. n := cadar s1;
  105. p := caddar s1;
  106. q := car cdddar s1;
  107. delta := reval algebraic(m + n - 1/2*(p + q));
  108. xi := reval algebraic(m + n - p);
  109. eta := car cddddr s1;
  110. eta := reval algebraic(eta/u4);
  111. % Test for validity of the integral
  112. test := reval list('test_cases,m,n,p,q,delta,xi,eta,test_1,
  113. test_1a,test_2);
  114. if transform_tst = 't then
  115. test := 't;
  116. if test neq 'T then
  117. return simp 'UNKNOWN;
  118. coef:=simp!* cadddr s1;
  119. s1:=list(v,car s1,listsq cadr s1,
  120. listsq caddr s1,simp!*(subpref(cadr u2,1,u4)));
  121. s3:=addsq(simp!* u3,'(1 . 1));
  122. RETURN intg(s1,s3,coef)
  123. >>
  124. else if equal(get('F2,'G),'(1 . 1)) then
  125. % Obtain the appropriate Meijer G-function
  126. <<s1:=bastab(car u1,cddr u1);
  127. v:= trpar(car cddddr s1, cadr u1, u4);
  128. on allfac;
  129. if v='FAIL then return simp 'FAIL;
  130. % Substitute in the correct variable value
  131. temp := car cddddr s1;
  132. var := cadr u1;
  133. temp := reval algebraic(sub(x=var,temp));
  134. s1 := {car s1,cadr s1,caddr s1,cadddr s1,temp};
  135. % Ensure by simplification that the variable does not contain a power
  136. s1 := simp_expt(u3,s1);
  137. u3 := car s1;
  138. s1 := cdr s1;
  139. % Test the validity of the following formulae
  140. % 'The Special Functions and their Approximations', Volume 1,
  141. % Y.L.Luke. Chapter 5.6 page 157 (3),(3*) & (4)
  142. test_1 := test_1(nil,u3,s1);
  143. test_1a := test_1('a,u3,s1);
  144. test_2 := test2(u3,cadr s1,caddr s1);
  145. m := caar s1;
  146. n := cadar s1;
  147. p := caddar s1;
  148. q := car cdddar s1;
  149. delta := reval algebraic(m + n - 1/2*(p + q));
  150. xi := reval algebraic(m + n - p);
  151. eta := car cddddr s1;
  152. eta := reval algebraic(eta/u4);
  153. % Test for validity of the integral
  154. test := list('test_cases,m,n,p,q,delta,xi,eta,test_1,test_1a,
  155. test_2);
  156. test := reval list('test_cases,m,n,p,q,delta,xi,eta,test_1,
  157. test_1a,test_2);
  158. if transform_tst = 't then
  159. test := 't;
  160. if test neq 'T then
  161. return simp 'UNKNOWN;
  162. coef:=simp!* cadddr s1;
  163. s1:=list(v,car s1,listsq cadr s1,
  164. listsq caddr s1,simp!*(subpref(cadr u1,1,u4)));
  165. s3:=addsq(simp!* u3,'(1 . 1));
  166. RETURN intg(s1,s3,coef)
  167. >>;
  168. % Case for the integration of a product of two Meijer G-functions
  169. % Obtain the correct Meijer G-functions
  170. s1:=bastab(car u1,cddr u1);
  171. s2:=bastab(car u2,cddr u2);
  172. coef:=multsq(simp!* cadddr s1,simp!* cadddr s2);
  173. v1:= trpar(car cddddr s1, cadr u1, u4);
  174. if v1='FAIL then
  175. << on allfac;
  176. return simp 'FAIL >>;
  177. v2:= trpar(car cddddr s2, cadr u2, u4);
  178. if v2='FAIL then
  179. << on allfac;
  180. return simp 'FAIL >>;
  181. on allfac;
  182. % Substitute in the correct variable value
  183. temp1 := car cddddr s1;
  184. var1 := cadr u1;
  185. temp1 := reval algebraic(sub(x=var1,temp1));
  186. s1 := {car s1,cadr s1,caddr s1,cadddr s1,temp1};
  187. temp2 := car cddddr s2;
  188. var2 := cadr u2;
  189. temp2 := reval algebraic(sub(x=var2,temp2));
  190. s2 := {car s2,cadr s2,caddr s2,cadddr s2,temp2};
  191. s1:=list(v1,car s1,listsq cadr s1,
  192. listsq caddr s1,simp!*(subpref(cadr u1,1,u4)));
  193. s2:=list(v2,car s2,listsq cadr s2,
  194. listsq caddr s2,simp!*(subpref(cadr u2,1,u4)));
  195. s3:=addsq(simp!* u3,'(1 . 1));
  196. if not numberp(gl s1) or not numberp(gl s2) then
  197. RETURN simp 'FAIL
  198. else
  199. if gl s1<0 then s1:=cong s1 else
  200. if gl s2<0 then s2:=cong s2 else
  201. if gl s1=gk s1 then GOTO A else % No reduction is necessary if
  202. % it is not a meijer G-function
  203. % of a power of x
  204. if gl s2=gk s2 then
  205. <<v:=s1;s1:=s2;s2:=v;go to a>>;
  206. % No reduction necessary but
  207. % the Meijer G-functions must
  208. % be inverted
  209. coef:=multsq(coef,invsq gr s1);
  210. %premultiply by inverse of power
  211. v:=modintgg(s3,s1,s2);
  212. s3:=car v; s1:=cadr v; s2:=caddr v;
  213. A:
  214. % Test for validity of the integral
  215. test := validity_check(s1,s2,u3);
  216. if test neq 't then
  217. return simp 'UNKNOWN;
  218. coef := multsq(if numberp(mellincoef) then simp(mellincoef)
  219. else cadr mellincoef,
  220. multsq(coef,coefintg(s1,s2,s3)));
  221. v := deltagg(s1,s2,s3);
  222. v := redpargf(list(arggf(s1,s2),indgf(s1,s2),car v,cadr v));
  223. v := ('meijerg . mgretro (cadr v,caddr v,car v));
  224. v := aeval v;
  225. if eqcar(v,'!*sq) then
  226. v := cadr v
  227. else if fixp v then
  228. v := simp v;
  229. if v='FAIL then
  230. return simp 'FAIL
  231. else
  232. return multsq(coef,v);
  233. end$
  234. symbolic procedure mgretro (u,v,w);
  235. begin scalar caru,carv,cdru,cdrv;
  236. caru := car u; cdru := cdr u; carv := car v; cdrv := cdr v;
  237. return
  238. list('list . cons ('list . foreach aa in caru collect prepsq aa,
  239. foreach aa in cdru collect prepsq aa),
  240. 'list . cons ('list . foreach aa in carv collect prepsq aa,
  241. foreach aa in cdrv collect prepsq aa),
  242. prepsq w);
  243. end;
  244. symbolic procedure intg(u1,u2,u3);
  245. begin scalar v;
  246. if numberp(gl(u1)) and gl(u1) < 0 then u1:=cong u1;
  247. v:=modintg(u2,u1);
  248. u1:=cadr v;
  249. v:=
  250. multlist(
  251. list(u3,
  252. expdeg(gw u1,negsq u2),
  253. quotsq(
  254. multgamma(
  255. append(
  256. listplus(car redpar1(gb u1,gm u1),u2),
  257. listplus(
  258. listmin(car redpar1(ga u1,gn u1)),
  259. diff1sq('(1 . 1),u2)))),
  260. multgamma(
  261. append(
  262. listplus(cdr redpar1(ga u1,gn u1),u2),
  263. listplus(
  264. listmin(cdr redpar1(gb u1,gm u1)),
  265. diff1sq('(1 . 1),u2)))))));
  266. return multsq(if numberp(mellincoef) then simp(mellincoef)
  267. else cadr mellincoef,
  268. v);
  269. end$
  270. %***********************************************************************
  271. %* EVALUATION OF THE PARAMETERS FOR THE G-FUNCTION *
  272. %***********************************************************************
  273. symbolic procedure simp_expt(u,v);
  274. % Reduce Meijer G functions of powers of x to x
  275. begin scalar var,m,n,coef,alpha,beta,alpha1,alpha2,expt_flag,k,temp1,
  276. temp2;
  277. var := car cddddr(v);
  278. beta := 1;
  279. % If the Meijer G-function is is a function of a variable which is not
  280. % raised to a power then return initial function
  281. if length var = 0 then
  282. return u . v
  283. else
  284. << k := u;
  285. coef := cadddr v;
  286. for each i in var do
  287. << if listp i then
  288. << if car i = 'expt then
  289. << alpha := caddr i;
  290. expt_flag := 't>>
  291. else if car i = 'sqrt then
  292. << beta := 2;
  293. alpha := 1;
  294. expt_flag := 't>>
  295. else if car i = 'times then
  296. << temp1 := cadr i;
  297. temp2 := caddr i;
  298. if listp temp1 then
  299. << if car temp1 = 'sqrt then
  300. << beta := 2;
  301. alpha1 := 1;
  302. expt_flag := 't>>
  303. else if car temp1 = 'expt and listp caddr temp1 then
  304. << beta := cadr cdaddr temp1;
  305. alpha1 := car cdaddr temp1;
  306. expt_flag := 't>>;
  307. >>;
  308. if listp temp2 and car temp2 = 'expt then
  309. << alpha2 := caddr temp2;
  310. expt_flag := 't>>;
  311. if alpha1 neq 'nil then
  312. alpha := reval algebraic(alpha1 + beta*alpha2)
  313. else alpha := alpha2;
  314. >>;
  315. >>
  316. else
  317. << if i = 'expt then
  318. << alpha := caddr var;
  319. expt_flag := 't>>;
  320. >>;
  321. >>;
  322. % If the Meijer G-function is is a function of a variable which is not
  323. % raised to a power then return initial function
  324. if expt_flag = nil then
  325. return u . v
  326. % Otherwise reduce the power by using the following formula :-
  327. %
  328. % infinity infinity
  329. % / /
  330. % | n |
  331. % |t^alpha*F(t^(m/n))dt = - |z^[((alpha + 1)*n - m)/m]*F(z)dz
  332. % | m |
  333. % / /
  334. % 0 0
  335. else
  336. << if listp alpha then
  337. << m := cadr alpha;
  338. n := caddr alpha;
  339. n := reval algebraic(beta*n)>>
  340. else
  341. << m := alpha;
  342. n := beta>>;
  343. k := reval algebraic(((k + 1)*n - m)/m);
  344. coef := reval algebraic((n/m)*coef);
  345. var := reval algebraic(var^(n/m));
  346. return {k,car v,cadr v, caddr v,coef,var}>>;
  347. >>;
  348. end;
  349. symbolic procedure test_1(aa,u,v);
  350. % Check validity of the following formulae :=
  351. %
  352. % -min Re{bj} < Re{s} < 1 - max Re{ai} i=1..n, j=1..m
  353. % -min Re{bj} < Re{s} < 1 - max Re{ai} i=1..n, j=1..p
  354. %
  355. % 'The Special Functions and their Approximations', Volume 1,
  356. % Y.L.Luke. Chapter 5.6 page 157 (3) & (3*)
  357. begin scalar s,m,n,a,b,ai,bj,a_max,b_min,temp,temp1,
  358. !*rounded,dmode!*;
  359. off rounded;
  360. transform_tst := reval algebraic(transform_tst);
  361. if transform_tst neq 't then
  362. << s := algebraic(repart(1 + u));
  363. s := simp!* s;
  364. m := caar v;
  365. n := cadar v;
  366. a := cadr v;
  367. b := caddr v;
  368. if aa = nil then
  369. << for i := 1 :n do
  370. << if car a = 'nil then
  371. car a := 0;
  372. ai := append(ai,{car a});
  373. a := cdr a>>;
  374. if ai neq 'nil then
  375. << a_max := simpmax list('list . ai);
  376. a_max := simprepart list(list('!*sq,a_max,t))>>;
  377. >>
  378. else if aa = 'a then
  379. << if a neq 'nil then
  380. << a_max := simpmax list('list . a);
  381. a_max := simprepart list(list('!*sq,a_max,t))>>;
  382. >>;
  383. for j := 1 :m do
  384. << if car b = 'nil then
  385. car b := 0;
  386. bj := append(bj,{car b});
  387. b := cdr b>>;
  388. if bj neq 'nil then
  389. << b_min := simpmin list('list . bj);
  390. b_min := simprepart list(list('!*sq,negsq(b_min),t))>>;
  391. if a_max neq nil and b_min neq nil then
  392. << temp := subtrsq(s,diffsq(a_max,1));
  393. temp1 := subtrsq(b_min,s);
  394. if car temp = 'nil or car temp1 = 'nil
  395. or car temp > 0 or car temp1> 0 then
  396. return 'FAIL
  397. else
  398. return test2(s,cadr v,caddr v)>>
  399. else if a_max = nil then
  400. << temp := subtrsq(b_min,s);
  401. if car temp = 'nil or car temp > 0 then
  402. return 'FAIL
  403. else
  404. return 'T>>
  405. else if b_min = nil then
  406. << temp := subtrsq(s,diffsq(a_max,1));
  407. if car temp = 'nil or car temp > 0 then
  408. return 'FAIL
  409. else
  410. return 'T>>;
  411. >>
  412. else
  413. << transform_lst := cons (('tst1 . '(list 'lessp (list 'lessp
  414. (list 'minus
  415. (list 'min (list 'repart 'bj))) (list 'repart 's))
  416. (list 'difference 1
  417. (list 'max(list 'repart 'ai))))),transform_lst);
  418. return 't>>;
  419. end;
  420. symbolic procedure test2(s,a,b);
  421. % Check validity of the following formula :=
  422. %
  423. % Re{Sum(ai) - Sum(bj)} + 1/2 * (q + 1 - p) > (q - p) * Re{s}
  424. % i=1..p, j=1..q
  425. % 'The Special Functions and their Approximations', Volume 1,
  426. % Y.L.Luke. Chapter 5.6 page 157 (4)
  427. begin scalar s,p,q,sum_a,sum_b,diff_sum,temp1,temp2,temp,diff;
  428. transform_tst := reval algebraic(transform_tst);
  429. if transform_tst neq 't then
  430. << s := algebraic(repart(1 + s));
  431. p := length a;
  432. q := length b;
  433. for each i in a do << sum_a := reval algebraic(sum_a + i)>>;
  434. for each j in b do << sum_b := reval algebraic(sum_b + j)>>;
  435. diff_sum := reval algebraic(repart(sum_a - sum_b));
  436. temp := reval algebraic(1/2*(q + 1 - p));
  437. temp1 := reval algebraic(diff_sum + temp);
  438. temp2 := reval algebraic((q-p)*s);
  439. diff := simp!* reval algebraic(temp1 - temp2);
  440. if car diff ='nil then return 'FAIL
  441. else if car diff < 0 then return 'FAIL else return T>>
  442. else
  443. << transform_lst := cons (('tst2 . '(list 'greaterp (list 'plus
  444. (list 'repart (list 'difference (list 'sum 'ai)(list 'sum 'bj)))
  445. (list 'times (list 'quotient 1 2)
  446. (list 'plus 'q (list 'difference 1 'p)))) (list 'times
  447. (list 'difference 'q 'p) (list 'repart 's)))),
  448. transform_lst);
  449. return 't;
  450. >>;
  451. end;
  452. symbolic procedure validity_check(s1,s2,u3);
  453. % Check validity of the following formulae :=
  454. %
  455. % 'Integrals and Series, Volume 3, More Special Functions',
  456. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  457. % page 345 (1) - (15)
  458. begin scalar alpha,m,n,p,q,k,l,u,v,delta,epsilon,sigma,omega,r,a,b,c,d,
  459. b_sum,a_sum,d_sum,c_sum,mu,rho,phi,eta,r1,r2,
  460. test_1a,test_1b,test_2,test_3,test_4,test_5,test_6,test_7,
  461. test_8,test_9,test_10,test_11,test_12,test_13,test_14,test_15,
  462. test;
  463. transform_lst := '();
  464. alpha := reval algebraic(1 + u3);
  465. m := caadr s1;
  466. n := cadadr s1;
  467. p := car cddadr s1;
  468. q := cadr cddadr s1;
  469. epsilon := reval algebraic(m + n - 1/2*(p + q));
  470. k := caadr s2;
  471. l := cadadr s2;
  472. u := car cddadr s2;
  473. v := cadr cddadr s2;
  474. delta := reval algebraic(k + l -1/2*(u + v));
  475. sigma := prepsq caar s1;
  476. omega := prepsq caar s2;
  477. r := prepsq cadar s2;
  478. a := caddr s1;
  479. b := cadddr s1;
  480. c := caddr s2;
  481. d := cadddr s2;
  482. for each i in b do
  483. << i := prepsq i; b_sum := reval algebraic(b_sum + i)>>;
  484. for each j in a do
  485. << j := prepsq j; a_sum := reval algebraic(a_sum + j)>>;
  486. for each i in d do
  487. << i := prepsq i; d_sum := reval algebraic(d_sum + i)>>;
  488. for each j in c do
  489. << j := prepsq j; c_sum := reval algebraic(c_sum + j)>>;
  490. mu := reval algebraic(b_sum - a_sum + 1/2*(p - q) + 1);
  491. rho := reval algebraic(d_sum - c_sum + 1/2(u - v) + 1);
  492. phi := reval algebraic(q - p - r*(v - u));
  493. eta := reval algebraic(1 - alpha*(v - u) - mu - rho);
  494. if listp r then << r1 := symbolic(cadr r); r2 := symbolic(caddr r)>>
  495. else << r1 := r; r2 := 1>>;
  496. test_1a := tst1a(m,n,a,b);
  497. test_1b := tst1b(k,l,c,d);
  498. test_2 := tst2(m,k,b,d,alpha,r);
  499. test_3 := tst3(n,l,a,c,alpha,r);
  500. test_4 := tst4(l,p,q,c,alpha,r,mu);
  501. test_5 := tst5(k,p,q,d,alpha,r,mu);
  502. test_6 := tst6(n,u,v,a,alpha,r,rho);
  503. test_7 := tst7(m,u,v,b,alpha,r,rho);
  504. test_8 := tst8(p,q,u,v,alpha,r,mu,rho,phi);
  505. test_9 := tst9(p,q,u,v,alpha,r,mu,rho,phi);
  506. test_10 := tst10(sigma,delta);
  507. test_11 := tst11(sigma,delta);
  508. test_12 := tst12(omega,epsilon);
  509. test_13 := tst13(omega,epsilon);
  510. test_14 := tst14(u,v,alpha,mu,rho,delta,epsilon,sigma,omega,r,phi,r1,
  511. r2);
  512. if p = q or u = v then test_15 := 'FAIL
  513. else test_15 := tst15(m,n,p,q,k,l,u,v,sigma,omega,eta);
  514. test := {'test_cases2,m,n,p,q,k,l,u,v,delta,epsilon,sigma,omega,rho,
  515. eta,mu,r1,r2,phi,test_1a,test_1b,test_2,test_3,test_4,test_5,test_6,
  516. test_7,test_8,test_9,test_10,test_11,test_12,test_13,test_14,
  517. test_15};
  518. test := reval test;
  519. if transform_tst = t and spec_cond neq nil then test := t;
  520. return test;
  521. end;
  522. symbolic procedure tst1a(m,n,a,b);
  523. % Check validity of the following formula :=
  524. %
  525. % ai - bj neq 1,2,3,.... i=1..n, j=1..m
  526. %
  527. % 'Integrals and Series, Volume 3, More Special Functions',
  528. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  529. % page 345 (1)
  530. begin scalar a_new,b_new,temp,fail_test;
  531. for i := 1 :n do << a_new := append(a_new,{car a}); a := cdr a>>;
  532. for j := 1 :m do << b_new := append(b_new,{car b}); b := cdr b>>;
  533. for each i in a_new do
  534. << for each j in b_new do
  535. << temp := subtrsq(i,j);
  536. if car temp neq 'nil and car temp > 0
  537. and cdr temp = 1 then
  538. fail_test := t>>;
  539. >>;
  540. if fail_test = t then return 'FAIL else return t;
  541. end;
  542. symbolic procedure tst1b(k,l,c,d);
  543. % Check validity of the following formula :=
  544. %
  545. % ci - dj neq 1,2,3,.... i=1..l, j=1..k
  546. %
  547. % 'Integrals and Series, Volume 3, More Special Functions',
  548. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  549. % page 345 (1)
  550. begin scalar c_new,d_new,temp,fail_test;
  551. for i := 1 :l do << c_new := append(c_new,{car c}); c := cdr c>>;
  552. for j := 1 :k do << d_new := append(d_new,{car d}); d := cdr d>>;
  553. for each i in c_new do
  554. << for each j in d_new do
  555. << temp := subtrsq(i,j);
  556. if car temp neq 'nil and car temp > 0
  557. and cdr temp = 1 then
  558. fail_test := t>>;
  559. >>;
  560. if fail_test = t then return 'FAIL else return t;
  561. end;
  562. symbolic procedure tst2(m,k,b,d,alpha,r);
  563. % Check validity of the following formula :=
  564. %
  565. % Re{alpha + r*bi + dj} > 0 i=1..m, j=1..k
  566. %
  567. % 'Integrals and Series, Volume 3, More Special Functions',
  568. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  569. % page 345 (2)
  570. begin scalar b_new,d_new,temp,temp1,temp2,fail_test;
  571. transform_tst := reval algebraic(transform_tst);
  572. if transform_tst neq t then
  573. << for i := 1 :m do
  574. << temp1 := prepsq car b;
  575. b_new := append(b_new,{temp1});
  576. b := cdr b>>;
  577. for j := 1 :k do
  578. << temp2 := prepsq car d;
  579. d_new := append(d_new,{temp2});
  580. d := cdr d>>;
  581. for each k in b_new do
  582. << for each h in d_new do
  583. << temp := simp!* reval algebraic(repart(alpha + r*k + h));
  584. if car temp = 'nil or car temp < 0 then
  585. fail_test := 't>>;
  586. >>;
  587. if fail_test = t then return 'FAIL else return t>>
  588. else
  589. << transform_lst := cons (('test2 . '(list 'greaterp
  590. (list 'repart (list 'plus 'alpha (list 'times 'r 'bi) 'dj))
  591. 0)),transform_lst);
  592. return t>>;
  593. end;
  594. symbolic procedure tst3(n,l,a,c,alpha,r);
  595. % Check validity of the following formula :=
  596. %
  597. % Re{alpha + r*ai + cj} < r + 1 i=1..n, j=1..l
  598. %
  599. % 'Integrals and Series, Volume 3, More Special Functions',
  600. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  601. % page 345 (3)
  602. begin scalar a_new,c_new,temp,temp1,temp2,fail_test;
  603. transform_tst := reval algebraic(transform_tst);
  604. if transform_tst neq 't then
  605. << for i := 1 :n do
  606. << temp1 := prepsq car a;
  607. a_new := append(a_new,{temp1});
  608. a := cdr a>>;
  609. for j := 1 :l do
  610. << temp2 := prepsq car c;
  611. c_new := append(c_new,{temp2});
  612. c := cdr c>>;
  613. for each k in a_new do
  614. << for each h in c_new do
  615. << temp := simp!* reval algebraic(repart(alpha + r*k + h)- r -1);
  616. if car temp = 'nil or car temp > 0 then
  617. fail_test := 't>>;
  618. >>;
  619. if fail_test = 't then return 'FAIL else return t>>
  620. else
  621. << transform_lst := cons (('test3 . '(list 'lessp (list 'repart
  622. (list 'plus 'alpha (list 'times 'r 'ai) 'cj)) (list 'plus 'r 1))),
  623. transform_lst);
  624. return 't>>;
  625. end;
  626. symbolic procedure tst4(l,p,q,c,alpha,r,mu);
  627. % Check validity of the following formula :=
  628. %
  629. % (p - q)*Re{alpha + cj - 1} - r*Re{mu} > -3*r/2 j=1..l
  630. %
  631. % 'Integrals and Series, Volume 3, More Special Functions',
  632. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  633. % page 345 (4)
  634. begin scalar c_new,temp1,temp,fail_test;
  635. transform_tst := reval algebraic(transform_tst);
  636. if transform_tst neq 't then
  637. << for j := 1 :l do
  638. << temp1 := prepsq car c;
  639. c_new := append(c_new,{temp1});
  640. c := cdr c>>;
  641. for each i in c_new do
  642. << temp := simp!* reval algebraic((p - q)*repart(alpha + i - 1)
  643. - r*repart(mu) + 3/2*r);
  644. if car temp = 'nil or car temp < 0 then fail_test := t;
  645. >>;
  646. if fail_test = t then return 'FAIL else return t>>
  647. else
  648. << transform_lst := cons (('test4 . '(list 'greaterp (list 'difference
  649. (list 'times (list 'difference 'p 'q) (list 'repart (list 'plus 'alpha
  650. (list 'difference 'cj 1)))) (list 'times 'r (list 'repart (list 'plus
  651. (list 'difference (list 'sum 'bj) (list 'sum 'ai))
  652. (list 'times (list 'quotient 1 2) (list 'difference 'p 'q)) 1))))
  653. (list 'minus (list 'times 3 (list 'quotient 'r 2))))),transform_lst);
  654. return 't>>;
  655. end;
  656. symbolic procedure tst5(k,p,q,d,alpha,r,mu);
  657. % Check validity of the following formula :=
  658. %
  659. % (p - q)*Re{alpha + dj} - r*Re{mu} > -3*r/2 j=1..k
  660. %
  661. % 'Integrals and Series, Volume 3, More Special Functions',
  662. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  663. % page 345 (5)
  664. begin scalar d_new,temp1,temp,fail_test;
  665. transform_tst := reval algebraic(transform_tst);
  666. if transform_tst neq t then
  667. << for j := 1 :k do
  668. << temp1 := prepsq car d;
  669. d_new := append(d_new,{temp1});
  670. d := cdr d>>;
  671. for each i in d_new do
  672. << temp := simp!* reval algebraic((p - q)*repart(alpha + i)
  673. - r*repart(mu) + 3/2*r);
  674. if car temp = 'nil or car temp < 0 then fail_test := 't;
  675. >>;
  676. if fail_test = t then return 'FAIL else return t>>
  677. else
  678. << transform_lst := cons (('test5 .'(list 'greaterp (list 'difference
  679. (list 'times(list 'difference 'p 'q)
  680. (list 'repart (list 'plus 'alpha 'dj)))
  681. (list 'times 'r (list 'repart (list 'plus (list 'difference
  682. (list 'sum 'bj) (list 'sum 'ai)) (list 'quotient
  683. (list 'difference 'p 'q) 2) 1))))
  684. (list 'minus (list 'times 3 (list 'quotient 'r 2)))) ),
  685. transform_lst);
  686. return t>>;
  687. end;
  688. symbolic procedure tst6(n,u,v,a,alpha,r,rho);
  689. % Check validity of the following formula :=
  690. %
  691. % (u - v)*Re{alpha + r*ai - r} - Re{rho} > -3/2 i=1..n
  692. %
  693. % 'Integrals and Series, Volume 3, More Special Functions',
  694. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  695. % page 345 (6)
  696. begin scalar a_new,temp1,temp,fail_test;
  697. transform_tst := reval algebraic(transform_tst);
  698. if transform_tst neq 't then
  699. << for j := 1 :n do
  700. << temp1 := prepsq car a;
  701. a_new := append(a_new,{temp1});
  702. a := cdr a>>;
  703. for each i in a_new do
  704. << temp := simp!* reval algebraic((u - v)*repart(alpha + r*i - r)
  705. - repart(rho) + 3/2);
  706. if car temp = 'nil or car temp < 0 then fail_test := 't;
  707. >>;
  708. if fail_test = 't then return 'FAIL else return 't>>
  709. else
  710. << transform_lst := cons (('test6 . '(list 'greaterp (list 'difference
  711. (list 'times (list 'difference 'u 'v) (list 'repart
  712. (list 'plus 'alpha (list 'difference (list 'times 'r 'ai) 'r))))
  713. (list 'repart (list 'plus (list 'difference (list 'sum 'dj)
  714. (list 'sum 'ci)) (list 'times (list 'quotient 1 2)
  715. (list 'difference 'u 'v)) 1))) (list 'minus (list 'quotient 3 2)))),
  716. transform_lst);
  717. return 't>>;
  718. end;
  719. symbolic procedure tst7(m,u,v,b,alpha,r,rho);
  720. % Check validity of the following formula :=
  721. %
  722. % (u - v)*Re{alpha + r*bi} - Re{rho} > -3/2 i=1..m
  723. %
  724. % 'Integrals and Series, Volume 3, More Special Functions',
  725. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  726. % page 345 (7)
  727. begin scalar b_new,temp1,temp,fail_test;
  728. transform_tst := reval algebraic(transform_tst);
  729. if transform_tst neq 't then
  730. << for j := 1 :m do
  731. << temp1 := prepsq car b;
  732. b_new := append(b_new,{temp1});
  733. b := cdr b>>;
  734. for each i in b_new do
  735. << temp := simp!* reval algebraic((u - v)*repart(alpha + r*i)
  736. - repart(rho) + 3/2);
  737. if car temp = 'nil or car temp < 0 then fail_test := 't;
  738. >>;
  739. if fail_test = t then return 'FAIL else return t>>
  740. else
  741. << transform_lst := cons (('test7 . '(list 'greaterp (list 'difference
  742. (list 'times (list 'difference 'u 'v)
  743. (list 'repart (list 'plus 'alpha (list 'times 'r 'bi))) )
  744. (list 'repart (list 'plus (list 'difference (list 'sum 'dj)
  745. (list 'sum 'ci)) (list 'quotient (list 'difference 'u 'v) 2)1)))
  746. (list 'minus (list 'quotient 3 2)))),transform_lst);
  747. return 't>>;
  748. end;
  749. symbolic procedure tst8(p,q,u,v,alpha,r,mu,rho,phi);
  750. % Check validity of the following formula :=
  751. %
  752. % abs(phi) + 2*Re{(q - p)*(v - u)*alpha +
  753. % r*(v - u)*(mu - 1) + (q - p)*(rho - 1)} > 0
  754. %
  755. % 'Integrals and Series, Volume 3, More Special Functions',
  756. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  757. % page 345 (8)
  758. begin scalar sum,temp,fail_test;
  759. transform_tst := reval algebraic(transform_tst);
  760. if transform_tst neq 't then
  761. << sum := reval algebraic(2*repart((q - p)*(v - u)*alpha
  762. + r*(v - u)*(mu - 1) + (q - p)*(rho - 1)));
  763. temp := simp!* reval algebraic(abs phi + sum);
  764. if car temp = 'nil or car temp < 0 then fail_test := 't;
  765. if fail_test = t then return 'FAIL else return t>>
  766. else
  767. << transform_lst := cons (('test8 . '(list 'greaterp (list 'plus
  768. (list 'abs (list 'difference (list 'difference 'q 'p)
  769. (list 'times 'r (list 'difference 'v 'u))))
  770. (list 'times 2 (list 'repart (list 'plus
  771. (list 'times (list 'difference 'q 'p) (list 'difference 'v 'u)
  772. 'alpha) (list 'times 'r (list 'difference 'v 'u)
  773. (list 'plus (list 'difference (list 'sum 'bj) (list 'sum 'ai))
  774. (list 'quotient (list 'difference 'p 'q) 2)))
  775. (list 'times (list 'difference 'q 'p) (list 'plus
  776. (list 'difference (list 'sum 'dj) (list 'sum 'ci))
  777. (list 'quotient (list 'difference 'u 'v) 2)))) )))
  778. 0)),transform_lst);
  779. return 't>>;
  780. end;
  781. symbolic procedure tst9(p,q,u,v,alpha,r,mu,rho,phi);
  782. % Check validity of the following formula :=
  783. %
  784. % abs(phi) - 2*Re{(q - p)*(v - u)*alpha +
  785. % r*(v - u)*(mu - 1) + (q - p)*(rho - 1)} > 0
  786. %
  787. % 'Integrals and Series, Volume 3, More Special Functions',
  788. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  789. % page 345 (9)
  790. begin scalar sum,temp,fail_test;
  791. transform_tst := reval algebraic(transform_tst);
  792. if transform_tst neq 't then
  793. << sum := reval algebraic(2*repart((q - p)*(v - u)*alpha
  794. + r*(v - u)*(mu - 1) + (q - p)*(rho - 1)));
  795. temp := simp!* reval algebraic(abs phi - sum);
  796. if car temp = 'nil or car temp < 0 then fail_test := 't;
  797. if fail_test = t then return 'FAIL else return t>>
  798. else
  799. << transform_lst := cons (('test9 . '(list 'greaterp (list 'difference
  800. (list 'abs (list 'difference (list 'difference 'q 'p)
  801. (list 'times 'r (list 'difference 'v 'u))))
  802. (list 'times 2 (list 'repart (list 'plus
  803. (list 'times (list 'difference 'q 'p) (list 'difference 'v 'u)
  804. 'alpha) (list 'times 'r (list 'difference 'v 'u)
  805. (list 'plus (list 'difference (list 'sum 'bj) (list 'sum 'ai))
  806. (list 'quotient (list 'difference 'p 'q) 2)))
  807. (list 'times (list 'difference 'q 'p) (list 'plus
  808. (list 'difference (list 'sum 'dj) (list 'sum 'ci))
  809. (list 'quotient (list 'difference 'u 'v) 2)))) )))
  810. 0)),transform_lst);
  811. return 't>>;
  812. end;
  813. algebraic procedure tst10(sigma,delta);
  814. % Check validity of the following formula :=
  815. %
  816. % abs(arg sigma) < delta*pi
  817. %
  818. % 'Integrals and Series, Volume 3, More Special Functions',
  819. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  820. % page 345 (10)
  821. begin scalar arg_sigma,pro,temp,fail_test,!*rounded,dmode!*;
  822. if transform_tst neq 't then
  823. << on rounded;
  824. arg_sigma := abs(atan(impart sigma/repart sigma));
  825. pro := delta*pi;
  826. temp := pro - arg_sigma;
  827. if numberp temp and temp <= 0 then fail_test := t;
  828. off rounded;
  829. if fail_test = t then return reval 'FAIL else return reval t>>
  830. else
  831. <<symbolic(transform_lst := cons (('test10 .
  832. '(list 'lessp (list 'abs (list 'arg 'sigma))
  833. (list 'times (list 'plus 'k (list 'difference 'l (list 'quotient
  834. (list 'plus 'u 'v) 2))) 'pi))),transform_lst));
  835. return reval 't>>;
  836. end;
  837. algebraic procedure tst11(sigma,delta);
  838. % Check validity of the following formula :=
  839. %
  840. % abs(arg sigma) = delta*pi
  841. %
  842. % 'Integrals and Series, Volume 3, More Special Functions',
  843. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  844. % page 345 (11)
  845. begin scalar arg_sigma,pro,fail_test;
  846. if transform_tst neq 't then
  847. << arg_sigma := abs(atan(impart sigma/repart sigma));
  848. pro := delta*pi;
  849. if arg_sigma neq pro then fail_test := 't;
  850. if fail_test = 't then return reval 'FAIL else return reval 't>>
  851. else
  852. << symbolic(transform_lst := cons (('test11 .
  853. '(list 'equal (list 'abs (list 'arg 'sigma))
  854. (list 'times (list 'plus 'k (list 'difference 'l (list 'quotient
  855. (list 'plus 'u 'v) 2))) 'pi))),transform_lst));
  856. return reval 't>>;
  857. end;
  858. algebraic procedure tst12(omega,epsilon);
  859. % Check validity of the following formula :=
  860. %
  861. % abs(arg omega) < epsilon*pi
  862. %
  863. % 'Integrals and Series, Volume 3, More Special Functions',
  864. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  865. % page 345 (12)
  866. begin scalar arg_omega,pro,temp,fail_test,!*rounded,dmode!*;
  867. if transform_tst neq 't then
  868. << on rounded;
  869. arg_omega := abs(atan(impart omega/repart omega));
  870. pro := epsilon*pi;
  871. temp := pro - arg_omega;
  872. if numberp temp and temp <= 0 then fail_test := 't;
  873. off rounded;
  874. if fail_test = 't then return reval 'FAIL else return reval 't>>
  875. else
  876. << symbolic(transform_lst := cons (('test12 .
  877. '(list 'lessp (list 'abs (list 'arg 'omega))
  878. (list 'times (list 'plus 'm (list 'difference 'n
  879. (list 'times (list 'quotient 1 2) (list 'plus 'p 'q))))
  880. 'pi))),transform_lst));
  881. return reval 't>>;
  882. end;
  883. algebraic procedure tst13(omega,epsilon);
  884. % Check validity of the following formula :=
  885. %
  886. % abs(arg omega) = epsilon*pi
  887. %
  888. % 'Integrals and Series, Volume 3, More Special Functions',
  889. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  890. % page 345 (13)
  891. begin scalar arg_omega,pro,fail_test;
  892. if transform_tst neq 't then
  893. << arg_omega := abs(atan(impart omega/repart omega));
  894. pro := epsilon*pi;
  895. if arg_omega neq pro then fail_test := 't;
  896. if fail_test = t then return reval 'FAIL else return reval 't>>
  897. else
  898. << symbolic(transform_lst := cons (('test13 .
  899. '(list 'equal (list 'abs (list 'arg 'omega))
  900. (list 'times (list 'plus 'm (list 'difference 'n
  901. (list 'times (list 'quotient 1 2) (list 'plus 'p 'q))))
  902. 'pi))),transform_lst));
  903. return reval 't>>;
  904. end;
  905. algebraic procedure tst14(u,v,alpha,mu,rho,delta,epsilon,sigma,omega,
  906. r,phi,r1,r2);
  907. % Check validity of the following formula :=
  908. %
  909. % abs(arg(1 - z*sigma^(-r1)*omega^r2)) < pi
  910. %
  911. % when phi = 0 and epsilon + r*(delta - 1) <= 0
  912. %
  913. % where z = r^[r1*(v - u)]*exp[-(r1*delta + r2*epsilon)*pi*i]
  914. %
  915. % or z = sigma^r1*omega^(-r2)
  916. % when Re{mu + rho + alpha*(v - u)}
  917. %
  918. % 'Integrals and Series, Volume 3, More Special Functions',
  919. % A.P.Prudnikov, Yu.A.Brychkov, O.I.Marichev. Chapter 2.24.1
  920. % page 345 (14)
  921. begin scalar temp,z,arg,arg_test,!*rounded,dmode!*;
  922. if transform_tst neq 't then
  923. << on rounded;
  924. temp := epsilon + r *(delta - 1);
  925. if phi = 0 and temp <= 0 then
  926. z := r^(r2*(v - u))*e^(-(r2*delta+r1*epsilon)*pi*i)
  927. else if numberp (mu + rho + alpha*(v - u)) and
  928. repart(mu + rho + alpha*(v - u)) < 1 then
  929. z := sigma^r2*omega^(-r1)
  930. else return reval 'FAIL; % Wn
  931. arg := 1 - z*sigma^(-r2)*omega^r1;
  932. if arg = 0 then arg_test := 0
  933. else arg_test := abs(atan(impart arg/repart arg));
  934. if numberp arg_test and arg_test < pi then
  935. << off rounded; return reval 't>>
  936. else << off rounded; return reval 'FAIL>>;
  937. >>
  938. else
  939. << symbolic(transform_lst := cons (('test14 .'(list 'or (list 'and
  940. (list 'abs (list 'arg (list 'difference 1 (list 'times
  941. (list 'times (list 'expt 'r (list 'times 'r1
  942. (list 'difference 'v 'u))) (list 'exp (list 'minus
  943. (list 'times (list 'plus (list 'times 'r1 (list 'plus 'k
  944. (list 'difference 'l (list 'times (list 'quotient 1 2)
  945. (list 'plus 'u 'v)))) ) (list 'times 'r2 (list 'plus 'm
  946. (list 'difference 'n (list 'times (list 'quotient 1 2)
  947. (list 'difference 'p 'q)))) )) 'pi 'i))))
  948. (list 'expt 'sigma (list 'minus 'r1)) (list 'expt 'omega 'r2)))) )
  949. (list 'equal 'phi 0) (list 'leq (list 'plus 'k (list 'difference 'l
  950. (list 'times (list 'quotient 1 2) (list 'plus 'u 'v)))
  951. (list 'times 'r (list 'plus 'm (list 'difference (list 'difference 'n
  952. (list 'times (list 'quotient 1 2) (list 'plus 'p 'q))) 1)))) 0))
  953. (list 'and (list 'lessp (list 'repart (list 'plus
  954. (list 'difference (list 'sum 'bj) (list 'sum 'ai))
  955. (list 'times (list 'quotient 1 2) (list 'difference 'p 'q)) 1
  956. (list 'difference (list 'sum 'dj) (list 'sum 'ci))
  957. (list 'times (list 'quotient 1 2) (list 'difference 'u 'v)) 1
  958. (list 'times 'alpha (list 'difference 'v 'u)))) 0)
  959. (list 'equal 'phi 0) (list 'leq (list 'plus 'k (list 'difference 'l
  960. (list 'times (list 'quotient 1 2) (list 'plus 'u 'v)))
  961. (list 'times 'r (list 'plus 'm (list 'difference (list 'difference 'n
  962. (list 'times (list 'quotient 1 2) (list 'plus 'p 'q))) 1)))) 0)))),
  963. transform_lst));
  964. return reval 't>>;
  965. end;
  966. algebraic procedure tst15(m,n,p,q,k,l,u,v,sigma,omega,eta);
  967. begin scalar lc,ls,temp_ls,psi,theta,arg_omega,arg_sigma,
  968. !*rounded,dmode!*;
  969. if transform_tst neq 't then
  970. << arg_omega := atan(impart omega/repart omega);
  971. arg_sigma := atan(impart sigma/repart sigma);
  972. psi := (abs arg_omega + (q - m - n)*pi)/(q - p);
  973. theta := (abs arg_sigma + (v - k - l)*pi)/(v - u);
  974. lc := (q - p)*abs(omega)^(1/(q - p))*cos psi +
  975. (v - u)*abs(sigma)^(1/(v - u))*cos theta;
  976. lc := lc;
  977. temp_ls := (q - p)*abs(omega)^(1/(q - p))*sign(arg_omega)*sin psi +
  978. (v - u)*abs(sigma)^(1/(v - u))*sign(arg_sigma)*sin theta;
  979. if arg_sigma*arg_omega neq 0 then ls := temp_ls
  980. else return reval 'fail;
  981. on rounded;
  982. if (numberp lc and lc > 0) or lc = 0 and ls = 0 and repart eta > -1
  983. or lc = 0 and ls = 0 and repart eta > 0 then
  984. << off rounded; return reval 't>>
  985. else << off rounded; return reval 'fail>>
  986. >>
  987. else
  988. << symbolic(transform_lst := cons (('test15 . '(list 'or
  989. (list 'greaterp 'lambda_c 0) (list 'and (list 'equal 'lambda_c 0)
  990. (list 'neq 'lambda_s 0) (list 'greaterp (list 'repart 'eta)
  991. (list 'minus 1))) (list 'and (list 'equal 'lambda_c 0)
  992. (list 'equal 'lambda_s 0) (list 'greaterp (list 'repart 'eta) 0)))),
  993. transform_lst));
  994. return reval 't>>;
  995. end;
  996. symbolic procedure bastab(u,v);
  997. if u eq 'f1 then subpar(get('f1,'g),v) else
  998. if u eq 'f2 then subpar(get('f2,'g),v)$
  999. symbolic procedure subpar(u,v);
  1000. if null v then list(cadr u,caddr u, cadddr u,car cddddr u,
  1001. cadr cddddr u)
  1002. else list(cadr u,sublist1(caddr u,v,car u),
  1003. sublist1(cadddr u,v,car u),
  1004. subpref1(car cddddr u,v,car u),cadr cddddr u)$
  1005. symbolic procedure sublist1(u,v,z);
  1006. % u,v,z - list PF.
  1007. if null cdr v or null cdr z then sublist(u,car v,car z)
  1008. else
  1009. sublist1(
  1010. sublist(u,car v,car z),
  1011. cdr v,cdr z)$
  1012. symbolic procedure subpref1(u,v,z);
  1013. % u - pf
  1014. % v,z - list pf
  1015. if null cdr v or null cdr z then subpref(u,car v,car z)
  1016. else subpref(subpref1(u,cdr v,cdr z),car v,car z)$
  1017. symbolic procedure subpref(u,v,z);
  1018. % u,v,z - pf
  1019. prepsq subsqnew(simp!* u,simp!* v,z)$
  1020. symbolic procedure sublist(u,v,z);
  1021. % u - list pf
  1022. % v,z - pf
  1023. if null u then nil else
  1024. subpref(car u,v,z) . sublist(cdr u,v,z)$
  1025. symbolic procedure trpar(u1,u2,u3);
  1026. if not numberp u2 and not atom u2 and car(u2)='plus then 'FAIL else
  1027. begin scalar a!3,l!1,v1,v2,v3,v4;
  1028. if (v1:=dubdeg(car simp u1,'x))='FAIL or
  1029. (v2:=dubdeg(cdr simp u1,'x))='FAIL or
  1030. (v3:=dubdeg(car simp u2,u3))='FAIL or
  1031. (v4:=dubdeg(cdr simp u2,u3))='FAIL then return 'FAIL;
  1032. a!3:=multsq(diff1sq(v1,v2), diff1sq(v3,v4));
  1033. l!1:=subpref(u1,u2,'x);
  1034. l!1:=subpref(l!1,1,u3);
  1035. return list(simp!*(l!1),a!3);
  1036. end$
  1037. symbolic procedure modintgg(u1,u2,u3);
  1038. list(
  1039. multsq(u1,invsq gr u2),
  1040. change(u2,list(cons(gw u2,list '(1 . 1))),'(1)),
  1041. change(u3,list(cons(gw u3,list(quotsq(gr u3,gr u2)))),'(1)))$
  1042. symbolic procedure change(u1,u2,u3);
  1043. begin scalar v;integer k;
  1044. while u1 do begin
  1045. if u3 and car u3=(k:=k+1) then
  1046. << v:=append(v,list car u2);
  1047. if u2 then u2:=cdr u2;
  1048. if u3 then u3:=cdr u3
  1049. >>
  1050. else
  1051. v:=append(v,list car u1);
  1052. u1:=cdr u1;
  1053. if null u3 then << v:= append(v,u1); u1:= nil>>; %WN
  1054. end;
  1055. return v;
  1056. end$
  1057. symbolic procedure cong(u);
  1058. list(
  1059. list(invsq gw u,negsq gr u),
  1060. list(gn u,gm u,gq u,gp u),
  1061. difflist(listmin gb u,'(-1 . 1)),
  1062. difflist(listmin ga u,'(-1 . 1)))$
  1063. symbolic procedure modintg(u1,u2);
  1064. list(
  1065. multsq(u1,invsq gr u2),
  1066. change(u2,
  1067. list(
  1068. cons(gw u2,list '(1 . 1))),'(1)))$
  1069. symbolic procedure ccgf(u);
  1070. quotsq(
  1071. simp(2 * gm u + 2 * gn u - gp u - gq u),
  1072. '(2 . 1))$
  1073. symbolic procedure vgg(u1,u2);
  1074. diff1sq(
  1075. simp(gq u2 - gp u2),
  1076. multsq(gr u2,simp(gq u1 - gp u1)))$
  1077. symbolic procedure nugg(u1,u2,u3);
  1078. diff1sq( diff1sq('(1 . 1), multsq(u3, simp(gq u1 - gp u1))),
  1079. addsq(mugf u2,mugf u1))$
  1080. symbolic smacro procedure sumlistsq(u);
  1081. << for each pp in u do <<p := addsq(pp,p)>>; p>> where p = '(nil . 1);
  1082. symbolic procedure mugf(u);
  1083. addsq(
  1084. quotsq(simp(2 + gp u - gq u),'(2 . 1)),
  1085. addsq(sumlistsq gb u,negsq sumlistsq ga u))$
  1086. symbolic procedure coefintg(u1,u2,u3);
  1087. multlist(
  1088. list(
  1089. expdeg(gk u2 . 1,mugf u2),
  1090. expdeg(gl u2 . 1,
  1091. addsq(mugf u1,
  1092. diff1sq(
  1093. multsq(u3,(gq u1-gp u1) . 1),
  1094. '(1 . 1)))),
  1095. expdeg(gw u1,negsq u3),
  1096. expdeg(simp '(times 2 pi),
  1097. addsq(multsq(ccgf u1,(1-gl u2) . 1),
  1098. multsq(ccgf u2,(1-gk u2) . 1)))))$
  1099. symbolic procedure deltagg(u1,u2,u3);
  1100. list(
  1101. append( delta(car redpar1(ga u2,gn u2), gk u2),
  1102. append(
  1103. delta( difflist( listmin gb u1, addsq(u3,'(-1 . 1))), gl u2),
  1104. delta( cdr redpar1(ga u2,gn u2), gk u2))),
  1105. append( delta(car redpar1(gb u2,gm u2), gk u2),
  1106. append(delta( difflist(listmin ga u1,addsq(u3,'(-1 . 1))),gl u2),
  1107. delta( cdr redpar1(gb u2,gm u2), gk u2))))$
  1108. symbolic procedure redpargf(u);
  1109. begin scalar v1,v2;
  1110. v1:=redpar(car redpar1(gb u,gm u), cdr redpar1(ga u,gn u));
  1111. v2:=redpar(cdr redpar1(gb u,gm u), car redpar1(ga u,gn u));
  1112. return
  1113. list(car u, (cadr v2 . cadr v1), (car v1 . car v2));
  1114. end$
  1115. symbolic procedure arggf(u1,u2);
  1116. % Calculate the coefficient of the variable in the combined meijerg
  1117. % function
  1118. multlist(list(
  1119. expdeg(gw u2, gk u2 . 1),
  1120. expdeg(gk u2 . 1, (gk u2 * gp u2 - gk u2 * gq u2) . 1),
  1121. invsq(expdeg(gw u1, gl u2 . 1)),
  1122. expdeg(gl u2 . 1,(gl u2 * gq u1 - gl u2 * gp u1) . 1)))$
  1123. symbolic procedure indgf(u1,u2);
  1124. % Calculate the values of m,n,p,q of the combined meijerg function
  1125. list(gk u2 * gm u2 + gl u2 * gn u1,
  1126. gk u2 * gn u2 + gl u2 * gm u1,
  1127. gk u2 * gp u2 + gl u2 * gq u1,
  1128. gk u2 * gq u2 + gl u2 * gp u1)$
  1129. symbolic procedure dubdeg(x,y);
  1130. % x -- SF.
  1131. % y -- atom.
  1132. begin scalar c,b,a1,a3;
  1133. if numberp x or null x then return '(nil . 1);
  1134. if not null cdr(x) then return 'FAIL;
  1135. lb1: a1:=caar x;a3:=car a1;
  1136. if atom a3 and a3=y then b:=cdr a1 . 1 ;
  1137. if not atom a3 then
  1138. if cadr a3=y then
  1139. if null cddr(a3) then return 'FAIL else
  1140. if not nump(simp caddr a3) then return simp(caddr a3)
  1141. else
  1142. c:=times(cdr a1,cadr caddr a3).caddr caddr a3;
  1143. if atom cdar x then
  1144. if null b then
  1145. if null c then return '(nil . 1)
  1146. else return c
  1147. else
  1148. if null c then return b
  1149. else return plus(times(car b,cdr c),car c).cdr c;
  1150. x:=cdar x;go to lb1;
  1151. end$
  1152. symbolic procedure delta(u,n);
  1153. % u -- list of sq.
  1154. % n -- number.
  1155. if null u then nil else
  1156. append(if n=1 then list car u else
  1157. delta0(quotsq(car u,simp!* n),n,n)
  1158. ,delta(cdr u,n))$
  1159. symbolic procedure delta0(u,n,k);
  1160. % u -- SQ.
  1161. % n,k -- numbers.
  1162. if k=0 then nil else
  1163. u . delta0(addsq(u,invsq(simp!* n)),n,k-1)$
  1164. symbolic procedure nump(x);
  1165. or(null car x,and(numberp car x,numberp cdr x))$
  1166. endmodule;
  1167. end;