Z<-ZETA.D4F |class description SQRT2<-#sqrt 2 LOG2 <- #ln 2 \$CS_LUT<-" ", #av 176+i3 | Chaos Cascade. Lookup table \$CS_CNT<-1500 \$PM_GAIN<-60.0 \$NAF8 <-RF_SEARCH"../font/naf8.com" Z<-ADD_ALIAS ZETA.D4S "ZETA.D4S" edzeta|WW.ED"zeta.d4f ",ARGS ldzeta|#copy"zeta.d4f" & ZETA.D4F font8|0 r I10_FONT _2048t #zload \$NAF8 & 0rSZ<-#screen vs_text|VS_TEXT plotzeta|H<-PLOTZETA ARGS zeta_info|3 #sed"X:d;\$zeta.inf" & Z<-WW.FSCR 3 zbars|DS_PLOT 0, (?145), 0.5 7 mzbars|(GEN_MU 600) DS_SCREEN 0, (0.1*?2500), 0.5 5+?3 paz|Z<-P_AZETA ARGS zscan|Z<-SCAN_ZEROS ARGS pz1|DO PROG.ZETA.1 "zeta.inf">>EOF These functions are based on the Zeta function of Number Theory. DS_PLOT Animation of adding terms in a divergent series. SZETA Attempt to calculate zeta on the critical line. Very inaccurate. Use alternating series a-zeta for calculations. plot |a-zeta(0.5+it)| for various intervals as 400x500 xbm image. use Newton-Raphson to seek zeros. track phase changes. clock animation. EOF Z<-DS_PLOT BOX;LN;N;S;T;X;Y;Z0;WW;SI;TXT;EV.ALX |Animate convergence of a dirichlet series in a box |Plot contours of z+=u(x,y,t) EV.ALX<-"10 #wput 0 0,#screen & GO" \$GAIN<-1.0 #ifndef "\$GAIN" CNT<-25000 #ifndef "\$CS_CNT" BOX<-0 0 1 1 #ifndef "BOX" WW<-0 0,SZ<-#screen N<-r\$CS_LUT |Lookup table |Map screen to unit square Z<-yiSZ X<-BOX[1]+BOX[3]* Z[1]%1.0*SZ[1] Y<-BOX[0]+BOX[2]* m Z[0]%1.0*SZ[0] T<-1 & Z0<-SZr0.00 AA: ->(T=CNT)/XX LN<-#ln T S<-(2 o X*LN) * #exp -0.5+Y*LN Z<-Z0<-Z0+S & ->(T>CNT)/XX Z<-"N" #av (\$GAIN*Z) #mod 48.0 TXT<-SZ r \$CS_LUT[Z #mod N] TXT #wput WW SI<-,Z #mod 16 CC: (SZrSI) #wput WW WAIT 1 T++ & ->AA XX: Z<-"" Z<-VEC DS_SCREEN BOX;LN;N;S;T;X;Y;Z0;WW;SI;TXT;VT;EV.ALX |Animate convergence of a dirichlet series in a box |Plot contours of z+=u(x,y,t) EV.ALX<-"10 #wput 0 0,#screen & GO" \$GAIN<-1.0 #ifndef "\$GAIN" VEC<-(25000 r 1) #ifndef "VEC" BOX<-0 0 1 1 #ifndef "BOX" \$CS_LUT<-" ", #av 176+i3 | Chaos Cascade. Lookup table CNT<-rVEC WW<-0 0,SZ<-#screen N<-r\$CS_LUT |Lookup table |Map screen to unit square Z<-yiSZ X<-BOX[1]+BOX[3]* Z[1]%1.0*SZ[1] Y<-BOX[0]+BOX[2]* m Z[0]%1.0*SZ[0] T<-1 & Z0<-SZr0.00 AA: ->(T=CNT)/XX ->(0=VT<-VEC[T])/DD LN<-#ln T S<-(2 o X*LN) * #exp -0.5+Y*LN Z<-Z0<-Z0+VT*S & ->(T>CNT)/XX Z<-"N" #av (\$GAIN*Z) #mod 48.0 TXT<-SZ r \$CS_LUT[Z #mod N] TXT #wput WW SI<-,Z #mod 16 CC: (SZrSI) #wput WW WAIT 1 DD: T++ & ->AA XX: Z<-"" Z<-VEC DS_PHASE STR;AY;C21;LN;XD;N;T;DT |Trace phase of dirichlet series at 1/2+it LN<-2/y #ln N<-1+irVEC XD<-2/y* #sqrt N AY<-2/yVEC C21<-(rVEC)/:2 1 T<-0.0 & DT<-#fi STR Z<-128 DP_PLOT "Z<-4 * +/AY* (C21 o LN*T) %XD & T<-T+DT" Z<-NC DP_PLOT EXP;AZ;CZ;J;M;SZ;YX;WW |Trace trajectory F:T -> [_1 1]x[_1 1] |EXP is a function Z<-f(T) & T<-T+DT NC<-1 #ifndef "NC" WW<-0 0,SZ<-#screen \$PSTR<-"O" #ifndef "\$PSTR" CZ<-SZ%2 & M<-,SZr" " AZ<-iJ<-0 AA: (SZrM) #wput 0 0,SZ 0 r #do EXP 7 #print 10 6 z Z J<-(J+1) #mod NC AZ<-AZ,YX<-SZ b "N" #av CZ+Z M[YX]<-\$PSTR[J #mod r \$PSTR] ->(NC>rAZ)/AA M[1tAZ]<-" " & AZ<-1dAZ & ->AA XX: Z<-ZETA S |Zeta(s=x+iy) |Z(s)= 1/1-2**(1-s) * sum (-1)**(n-1)/n**s Z<-SZETA T;D;T2;X;Y |Zeta (0.5+iT) D<-3-2*2 o T2<-T * LOG2 X<-1-SQRT2* 2 o T2 Y<-SQRT2 * 1 o T2 Z<-25000 ALT_CSUM T Z<-Z C_MULT (X,Y)%D Z<-A C_MULT B;X;Y |Multiply two vectors of complex numbers X<-A*B & Y<-A*mB Z<-(X[:0]-X[:1]),Y[:0]+Y[:1] Z<-CNT ALT_CSUM T;N;XD;XL |Sum (-1)**n-1 * 1/n**0.5+it CNT<-10000 #ifndef "CNT" XL<-#ln N<-1+iCNT XD<-(CNT r 1 _1) * #sqrt N Z<-((CNT,2) r 2 1) o T*2/yXL Z<-+/Z%2/yXD Z<-CNT IZETA T;N;XD;XL;XN | 1%ZETA(0.5+iT) CNT<-10000 #ifndef"CNT" ->(0<#nc"MU_SEQ")/A0 MU_SEQ<-1 d GEN_MU 1+CNT A0: XL<- #ln N<-1+iCNT XD<-#sqrt N XN<-((CNT,2)r 2 1) o T*2/yXL Z<-CNT PLOTZETA STR;A;B;C21;DT;N;T;LN;XD |for T=a step dt to b: print alt_zeta(0.5+iT) : next T N<-rZ<-#fi STR<-"" #ifndef "STR" A<-Z[0] & DT<-(0.01,Z[1])[N>1] & B<-((A+5)*N<3)+Z[2] N<-1+iCNT<-10000 #ifndef "CNT" T<-A & Z<-3 #sed":d" C21<-CNT/:2 1 & LN<-2/y #ln N & XD<-2/y(CNT r 1 _1)* #sqrt N AA: ->(T>B)/XX Z<-+/(C21 o T*LN)%XD STR<-8 4 z T, Z, #sqrt +/Z*Z STR 3 #print STR T<-T+DT & ->AA XX: Z<-3 #sed ":cm" Z<-M PM.PLOT YX;I;J;N |Make ascii plot of points in size M |Join YX[0 1], YX[1 2] ... etc. Z<-(*/M) r " " Z[MbYX]<-"O" N<-1tr:YX & I<-0 AA: ->(I=N-1)/XX T<-#kjvec -/YX[I+1 0] J<-(+\T)+(rT)rYX[I] Z[MbJ]<-"O" I++ & ->AA XX: Z<-MrZ Z<-P_AZETA STR;N;IY;YX |Make .xpm plot from values Z<-PLOTZETA STR IY<-"N" #av \$PM_GAIN * #fi ," ", 0 24 d Z YX<-(yIY),yiN<-rIY Z<-#theta (400,N) PM.PLOT YX Z<-"azeta" PM2XBM Z Z<-FN PM2XBM X;NB;I;M;T |Make .xbm file of an byte matrix FN<-"bitmap" #ifndef "FN" M<-r:X & NB<-(7+M[1])%8 & I<-0 7 #sed":d" #print "#define ",FN, "_width ",zM[1] #print "#define ",FN, "_height ",zM[0] #print "static char ",FN,"_bits[]={" AA: ->(I=1tM)/XX T<-,m(NB,8)r(8*NB)t " " #ne X[I:] T<-1m,((NB,3)r",0x"),(NB,2)r"0123456789abcdef"[(4r2)b(2*NB,2)rT] #print T I++ & ->AA XX: #print "};" Z<-WW.FSCR 7 Z<-CNT NR_AZETA SEED;A;DS;EPS;I;N;LN;SN;SQRTN;FMOD;FS;IFS;DFS |try to get an approximation of a root from a starting point. |Compute x-f(x)/f'(x) with f(x) = Re(azeta(0.5+it)) |x=x+sum(a[n]*cos(t*log n)/sqrt(n))/sum(a[n]*log(n)*sin(t*log n)/sqrt(n)) | a[n] = (-1)^(n-1) CNT<-10000 #ifndef "CNT" EPS<-0.005 SEED<-1.0 * SEED A<-CNTr1 _1 & LN<-#ln N<-1+iCNT & SQRTN<- #sqrt N & I<-0 AA: ->(20=I++)/XX SN<-SEED * LN FS<-+/A*(2 o SN)% SQRTN IFS<-+/A*(1 o SN)% SQRTN DFS<-+/A*LN*(1 o SN)%SQRTN FMOD<-#sqrt +/Z*Z<-FS,IFS DS<-FS % DFS ->(0.0001 > #abs DS)/XX |10 6 z SEED, DS, FS, IFS, DFS, FMOD ->(FMOD<0.01)/XX SEED<-SEED+DS & ->AA XX: Z<-SEED, FMOD Z<-CNT SCAN_ZEROS STR;A;B;DT;T;N;V |Iterate from points in for step to loop N<-rZ<-#fi STR<-"" #ifndef "STR" A<-Z[0] & DT<-(1,Z[1])[N>1] & B<-((A+50)*N<3)+Z[2] N<-1+iCNT<-12500 #ifndef "CNT" T<-A & Z<-3 #sed"X:d;i azeta zeros" AA: ->(T>B)/XX ->(0.01 < 1 d Z<-CNT NR_AZETA T)/CC V<-10 6 z Z & V V #print V CC: T<-T+DT & ->AA XX: Z<-WW.FSCR 3 Z<-VS_TEXT;K;CNT CNT<-1 t #screen AA:Z<-8 #sed"X:s;+1" & WAIT \$T_DELAY & ->(0