# To expand Li2 in Taylor series about the point -1/2. Li2(z) = sum[k positive integer]z^k/k^2. We differentiate Li2 n times term wise: d^n/(dz)^n = sum[k >= n](k!/(k-n)!)z^(k-n)/k^2 dli2(n, z) below computes (the nth derivitive of li2 at z)/n!. # MODE C = LONG COMPLEX; MODE NC = LONG COMPLEX; PROC sq = (REAL z)REAL: z*z; PROC m2 = (C z)REAL: sq(SHORTEN RE z) + sq(SHORTEN RE z); PROC li2 = (C z) C: IF m2(z) < 1 THEN C s := 0, f := z; FOR n WHILE REAL fn = n; C t = f/(fn*fn); ABS t > 1.e-16 DO s +:= t; f *:= z OD; s ELSE 0 FI; PROC dli2 = (INT n, NC z) NC: (NC s := 0, f := 1; FOR k FROM n WHILE NC t = f/(k*k); ABS t > 1.e-18 DO s +:= t; f *:= z*((k+1)/(k-n+1)) OD; s); NC nc = -0.5 I 0.01; INT ts = 70; [0:ts] NC u; u[0] := li2(nc); FOR n TO ts DO u[n] := dli2(n, nc); print((n, u[n], newline)) OD; (PROC li2h = (C zo)C: (C s := 0, f := 1; C z = zo - nc; FOR n FROM 0 WHILE C t = f*u[n]; ABS t > 1.e-16 DO s +:= t; f *:= z OD; s); PROC s = (STRING m, C z) VOID: print((z, " ", m, newline)); PROC t = (C z)VOID: (s("z", z); s("li2h", li2h(z)); s("li2", li2(z)); print(newline)); t(0); t(-0.5); t(0.1); t(-0.99); t((-0.52) I .452); t(-1); t(long cos(1) I long sin(1)))