rwg>[Four+ digit accuracy] seems in line with 11^-4 = 1/N^(derivs+1), but tan^5 is worse, and tan^7 worse yet. Presumably, with large enough N, tan^5 will win, ... Seems to be about N=50(!), where accuracy is about 10^-9. This means tan^3 is almost always what we want, especially since atan(tan(%pi*t/2)^3) =atan(tan(%pi*t)/2)+%pi*floor(t+1/2)-%pi*t/2-%pi*floor(t/2+1/2) 3 pi t tan(pi t) 1 pi t atan(tan (----)) = atan(---------) + pi floor(t + -) - ---- 2 2 2 2 t 1 - pi floor(- + -). 2 2 But we can do much better. If we only demand finitely many matching derivatives, we don't need fancy invocations of atan that only integrate numerically. For f(t) on [0,1] we can match six(!) derivatives with g(t) on [-1,0] := f(t) (f(t + 2) - f(t)) (3 cos(5pi t) - 25 cos(3pi t) + 150 cos(pi t) - 128) - ----------------------------------------------------------------------. 256 Then for f = exp, inf ==== t 6 \ k e = 225 sinh(1)pi ( > ((- 1) + e) (k pi / ==== k = 1 6 6 6 2 2 4 2 4 4 4 2 (k pi - 225pi + 7 k pi (37pi + 50pi + 5) - 777pi - 7 k pi (5pi + 3) 2 2 2 4 4 4 2 2 2 - 175pi - 7) sin(k pi t) - (7 k pi (k pi + 111pi - 5 k pi (5pi + 1) 2 2 2 2 + 50pi + 3) - (pi + 1) (9pi + 1) (25pi + 1)) cos(k pi t)) 2 2 2 2 2 2 2 2 2 2 /((k pi + 1) (k pi - 10 k pi + 25pi + 1) (k pi - 6 k pi + 9pi + 1) 2 2 2 2 2 2 2 2 (k pi - 2 k pi +pi + 1) (k pi + 2 k pi +pi + 1) 2 2 2 2 2 2 2 2 (k pi + 6 k pi + 9pi + 1) (k pi + 10 k pi + 25pi + 1)) e + 1 + ------------------------------------) 2 2 2 2 (pi + 1) (9pi + 1) (25pi + 1) Approximating 11 sin and 12 cos terms, (%e)^t ~ 9.89950946692436d-6*sin(11*pi*t)-2.24141986582817d-6*cos(11*pi*t) +4.46390665096906d-5*sin(10*pi*t)-1.14371353488594d-5*cos(10*pi*t)+4.74200179416212d-5 *sin(9*pi*t)-1.40787399330621d-5*cos(9*pi*t)+2.69674929205567d-4*sin(8*pi*t) -9.63830363878749d-5*cos(8*pi*t)+3.9887744385691d-4*sin(7*pi*t)-1.84767667695833d-4 *cos(7*pi*t)+0.00379228989443d0*sin(6*pi*t)-0.00282457989254d0*cos(6*pi*t) -0.00956883953678d0*sin(5*pi*t)-0.02111980808042d0*cos(5*pi*t)-0.07025349499746d0 *sin(4*pi*t)+0.02402343916233d0*cos(4*pi*t)+0.05218583563153d0*sin(3*pi*t) +0.18293572772707d0*cos(3*pi*t)+0.42360609603345d0*sin(2*pi*t)-0.11580061884067d0 *cos(2*pi*t)-0.38558037682327d0*sin(pi*t)-1.02075497561669d0*cos(pi*t) +1.95385367517543d0. Testing: makelist(''%,t,dfloat([0,log(3/2),log(2),1])) [1.0d0 = 1.00000395163528d0, 1.5d0 = 1.49999731997367d0, 2.0d0 = 1.99999386979907d0, 2.71828182845905d0 = 2.71828423923035d0] or ~4ppm. For screen resolution, you could probably neglect all ten "d-" terms, leaving 13. Then, it might even win to use only a 3rd harmonic "slide function" instead of the 5th we used here. Input form: %E^T = 225*%PI^6*SINH(1)*('SUM(((-1)^K+%E)*(%PI*K*(%PI^6*K^6-7*(5*%PI^2+3)*%PI^4*K^4+7*%PI^2*(37*%PI^4+50*%PI^2+5)*K^2-225*%PI^6-777*%PI^4-175*%PI^2-7)*SIN(%PI*K*T)-(7*%PI^2*K^2*(%PI^4*K^4-5*%PI^2*(5*%PI^2+1)*K^2+111*%PI^4+50*%PI^2+3)-(%PI^2+1)*(9*%PI^2+1)*(25*%PI^2+1))*COS(%PI*K*T))/((%PI^2*K^2+1)*(%PI^2*K^2-10*%PI^2*K+25*%PI^2+1)*(%PI^2*K^2-6*%PI^2*K+9*%PI^2+1)*(%PI^2*K^2-2*%PI^2*K+%PI^2+1)*(%PI^2*K^2+2*%PI^2*K+%PI^2+1)*(%PI^2*K^2+6*%PI^2*K+9*%PI^2+1)*(%PI^2*K^2+10*%PI^2*K+25*%PI^2+1)),K,1,INF)+(%E+1)/(2*(%PI^2+1)*(9*%PI^2+1)*(25*%PI^2+1))) --rwg PARASELENIC <-> LINEAR SPACE . --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search.