Help:=proc(): print(` DioA(a,eps) , LogRat(n,eps), ZeRat(N,t,eps) `): end: Digits:=20: ###From C23.txt #C23.txt, April 12, 2018, Expmath, Math640, Spring 2018 (Rutgers University) Help23:=proc(): print(`Z(N,t), FindAZ(f,t,T,res),OS(f,t,P),ZI(f,t,P,eps), FindZ(f,t,T,res,eps) `): print(` MMS(f,t,T,res,eps), Ze(N,t) `): end: Digits:=20: #add(1/n,n=1..N) + add(n1^(1/2+I*t)*n2^(1/2-I*t)= ADD(sqrt(n1*n2)* 2(cos(log(n1)-log(n2))*t),1<=n1=0 then FAIL: elif evalf(subs(t=P[1],f)*subs(t=(P[1]+P[2])/2,f))<0 then [P[1],(P[1]+P[2])/2]: else [(P[1]+P[2])/2,P[2]]: fi: end: #ZI(f,t,P,eps): inputs f,t,P, finds an approximation to the zero of f in P ZI:=proc(f,t,P,eps) local P1,N,i: N:=ceil(log[2](abs((P[2]-P[1])/eps))): P1:=P: for i from 1 to N do P1:=OS(f,t,P1): od: evalf((P1[1]+P1[2])/2, trunc(log[10](1/eps))): end: #FindZ(f,t,T,res,eps): inputs a function f of t, a pos. integer T, and a pixel-size res #and an error eps, #and outputs the (hopefully) all the approximate zeros in [0,T] FindZ:=proc(f,t,T,res,eps) local L,i: L:=FindAZ(f,t,T,res): [seq(ZI(f,t,L[i],eps),i=1..nops(L))]: end: # MMS(f,t,T,res,eps): inputs a nice differentiable function f of t and a positive number T and outputs ListMin and ListMax with [location, value] #This version, by Edna Jones, corrects a previous buggy version MMS:=proc(f,t,T,res,eps) local g, L, L1,j,t0: g := diff(f,t); L := FindZ(g,t,T,res,eps); L1 := [seq([t0, evalf(subs(t=t0, f))], t0 in L)]; if L1[1][2] < L1[2][2] then [seq(L1[2*j+1], j=0..(nops(L)-1)/2)], [seq(L1[2*j], j=1..nops(L)/2)]; else [seq(L1[2*j], j=1..nops(L)/2)], [seq(L1[2*j+1], j=0..(nops(L)-1)/2)]; fi: end: #add(1/n,n=1..N) + add(n1^(1/2+I*t)*n2^(1/2-I*t)= ADD(sqrt(n1*n2)* 2(cos(log(n1)-log(n2))*t),1<=n1eps do od: q:=q[i]: if abs(evalf(a)-q)>eps then RETURN(FAIL): else RETURN(q): fi: end: #LogRat(n,eps): The rational appx. of log(n) with error