From: Wolfgang J. <wje...@us...> - 2003-08-23 11:13:16
|
Update of /cvsroot/maxima/maxima/share/numeric In directory sc8-pr-cvs1:/tmp/cvs-serv31514 Modified Files: bffac.mac Log Message: Cosmetic change: Put newlines between the function definitions. Index: bffac.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/numeric/bffac.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bffac.mac 22 Aug 2003 05:14:37 -0000 1.1 +++ bffac.mac 23 Aug 2003 11:13:13 -0000 1.2 @@ -1,7 +1,7 @@ /* Author: Bill Gosper */ /* - Generated from bffac.lisp with the commands + Initial version generated from bffac.lisp with the commands load("bffac.lisp"); bffac_functions:[OBFAC,AZETB,VONSCHTOONK,DIVRLST,BURN,OBZETA,BZETA, @@ -9,9 +9,11 @@ apply(stringout,cons("bffac.mac",map('fundef,bffac_functions))),grind:true; */ + OBFAC(Z,FPPREC):=BLOCK([PRODHACK:TRUE,Y:Z-ENTIER(Z),X:ENTIER(7*FPPREC/3),M:0], FOR K FROM ENTIER(26*FPPREC/3) STEP -1 THRU 1 DO M:X*(1/(Y+K)-M/K), BFLOAT(M)*X^Y*PRODUCT(Z-I+1,I,1,ENTIER(Z))); + AZETB(S,FPP):=BLOCK([FPPREC:15], IF S > 0 THEN BLOCK([M:0, @@ -28,14 +30,17 @@ ELSE ((2*%PI)^S*SIN(%PI*S/2)*BFAC(-S,FPPREC) *BZETA(1-S,FPPREC) /%PI,BFLOAT(%\%)))); + VONSCHTOONK(P):=APPLY("*", SUBST(["*" = LAMBDA([[L]],1),"^" = LAMBDA([[L]],1)], FACTOR(1+DIVRLST(P)))); + DIVRLST(P):=( ARGS(EXPAND(RATSIMP(SUBST("^" = LAMBDA([A,B], (1-PART(A)^(B/2+1)) /(1-PART(A))),FACTOR(P^2))))), EV(%\%,PART)); + BURN(P):=IF EVENP(P) THEN BLOCK([D:VONSCHTOONK(P)], BLOCK([FPPREC:ENTIER(EV( @@ -47,6 +52,7 @@ ENTIER(2*D*P!*BFZETA(P,FPPREC)/(2^P*PI^P)+1/2) /D))) *(-1)^(P/2-1) ELSE BERN(P); + OBZETA(S,FPPREC):=IF S > 0 THEN BLOCK([M:0, P:ENTIER(EV((LOG(2*%PI)*S+LOG(10)*FPPREC-LOG(%PI*(S-1)!)) @@ -59,6 +65,7 @@ ELSE ?DOLIST((2*%PI)^S*SIN(%PI*S/2)*BFAC(-S,FPPREC) *BZETA(1-S,FPPREC) /%PI,BFLOAT(%\%))); + BZETA(S,FPP):=IF S > 0 THEN BLOCK([FPPREC:7,M:0,T:0.0B0,P, K:2*MAX(1, @@ -79,8 +86,10 @@ ELSE ((2*%PI)^S*SIN(%PI*S/2)*BFAC(-S,FPPREC) *BZETA(1-S,FPPREC) /%PI,BFLOAT(%\%))); + BFPSI(N,Z,FPPREC):=IF EQUAL(N,0) THEN BFPSI0(Z,FPPREC) ELSE BFHZETA(N+1,Z,FPPREC)*(-1)^(N-1)*N!; + BFFAC(Z,FPPREC):=IF Z < 0 THEN BFLOAT(%PI*Z/SIN(%PI*Z))/BFFAC(-Z,FPPREC) ELSE BLOCK([K:2*(ENTIER(0.41*FPPREC)+1)], BLOCK([M:1,Y:(Z+K)^2,X:0.0B0], @@ -90,6 +99,7 @@ BFLOAT(SQRT(2)*SQRT(%PI)*SQRT(Z+K) *%E^((Z+K)*(LOG(Z+K)+X-1))) /M)); + BFHZETA(S,H,FPPREC):=IF S > 0 THEN BLOCK([M:0,P, Q:ENTIER(EV((-LOG(%PI*(S-1)!)+LOG(2*%PI)*S @@ -103,6 +113,7 @@ (M+1/2)/(P-1)^S+SUM(1/(K+H)^S,K,0,ENTIER(P-H-1.9B0)), BFLOAT(%\%)) ELSE (IF S = 0 THEN 1/2-H ELSE FUNMAKE('BFHZETA,[S,H,FPPREC])); + CBFFAC(Z,FPPREC):=RECTFORM( IF REALPART(Z:RECTFORM(Z)) < 0 THEN BFLOAT(%PI*Z/SIN(%PI*Z))/CBFFAC(-Z,FPPREC) @@ -116,6 +127,7 @@ BFLOAT(SQRT(2)*SQRT(%PI)*SQRT(Z+K) *%E^((Z+K)*(LOG(Z+K)+X-1))) /M))); + BFPSI0(Z,FPPREC):=IF Z < 0 THEN BFLOAT(%PI*COT(%PI*Z))+BFPSI0(-Z,FPPREC) ELSE BLOCK([K:2*(ENTIER(0.41*FPPREC)+1)], BLOCK([M:0,Y:(Z+K)^2,X:0.0B0], @@ -123,6 +135,7 @@ (M:1/(Z+2*I-1)+1/(Z+2*I-2)+M, X:(X+BERN(K-2*I+2)/(K-2*I+2))/Y), BFLOAT(LOG(Z+K)-1/(2*(Z+K))-X-M))); + BFZETA(S,FPP):=IF S > 0 THEN BLOCK([FPPREC:7,M:0,T:0.0B0,P, K:2*MAX(1, |