For real x, tan(x) 3 x x 1 x 1 x atan(------) = atan(tan (-)) - pi floor(-- + -) + pi floor(---- + -) + -, 2 2 pi 2 2 pi 2 2 implying that 3 2 atan(x) 1 x atan(x ) = pi floor(--------- + -) + atan(------) - atan(x), pi 2 2 1 - x and 2 x atan(x) sqrt(x + 1) - 1 3 atan(-) = ------- + atan((----------------) ) 2 2 x I was fiddling with GFee's Fourier query. A while ago I mentioned gene_salamin's observation that you could get rational function nth harmonics to shrink like n^-k, for any positive integer k, by *composing* the approximated function with one that k-smoothly (actually (k-2)-smoothly) stops and resumes at each discontinuity. The catch was large numerical coefficients delaying the onset of the faster convergence with increasing k. E.g., suppose you draw a square with epicyclic rotors. If you jump from corner to corner, you get k=1 convergence (and Gibbs ringing) and need thousands of rotors (harmonics) for screen resolution. If instead you sweep the square at constant speed, you get k=2 and need only dozens. If you come to a smooth stop at each corner, you get k=3, etc., needing fewer and fewer rotors, leading to the absurd limit that eventually you would need only one or zero! But what actually happens when you get too greedy (k too big) is the postponement of the amplitude dropoff as a function of n. So each resolution target (error bound) has its optimal k, which presumably varies with the function being approximated. But GFee didn't mention a speed-smoother option, so we're left with matching k derivatives at 0 and -1 == 1, which, I think, exhibits the same behavior. So I was looking at patch functions like 2/pi*atan(tan(t*pi/2)^(2*k+1)) for sneaking from 0 to 1 with 2k vanishing derivatives at the endpoints. Or even tanh(tan(t*pi/2)), with *all* derivatives vanishing. I don't really have time to investigate this, but the temptation may be overwhelming. Oh, hell, I gave in and tried f(t) := t 2 2 %e ((%e - 1) tanh(cot(%pi t)) + %e + 1) ------------------------------------------ 2 on [-1,0], which matches all derivatives at both ends, and got g(t) = 1.97473445780695d0 - 0.8981270448759d0 cos(pi t) - 0.41753308527721d0 sin(pi t) - 0.1247188401558d0 cos(2 pi t) + 0.23434279646825d0 sin(2 pi t) + 0.00330568635158d0 cos(3 pi t) + 0.03901681282034d0 sin(3 pi t) + 0.00107335808438d0 cos(4 pi t) + 0.04714152469382d0 sin(4 pi t) + 0.02622378383461d0 cos(5 pi t) + 0.00949607729559d0 sin(5 pi t) + 0.00589694508514d0 cos(6 pi t) + 7.34937084126405d-4 sin(6 pi t) + 0.00925330770208d0 cos(7 pi t) + 7.6772973803263d-6 sin(7 pi t) + 0.00221574684403d0 cos(8 pi t) - 0.00414748855076d0 sin(8 pi t) + 0.00175756423966d0 cos(9 pi t) - 0.00109985016356d0 sin(9 pi t) + 4.19777476400997d-4 cos(10 pi t) - 0.00251568862979d0 sin(10 pi t) - 2.97177678883817d-4 cos(11 pi t) - 6.82066527883218d-4 sin(11 pi t) which is rather disappointing: g(0) = 1.0017, g(1) = 2.7175 . Possibly the numerical integration is poor, but Maple 5.4 gave 13 place agreement. Strangely, I couldn't coax more than six places out of Mma 5.2. Maybe an atan(tan^k) hack would be better. --rwg Input forms: atan(tan(x)/2) = atan(tan(x/2)^3)-%pi*floor(x/%pi+1/2)+%pi*floor(x/(2*%pi)+1/2)+x/2 atan(x^3) = %pi*floor(2*atan(x)/%pi+1/2)+atan(x/(1-x^2))-atan(x) atan(x/2) = atan(x)/2+atan(((sqrt(x^2+1)-1)/x)^3) PS: Mathematica knows I from (-I: In[1]:= N[DedekindEta[I]] Out[1]= 0.7682254223260567 - 1.7568472086707517*^-19*I In[2]:= N[DedekindEta[-I]] Out[2]= DedekindEta[0. - 1.*I] (* Undefined. Diverges. :*) Clear thinking is much too hard. Ask any reporter. --------------------------------- Get easy, one-click access to your favorites. Make Yahoo! your homepage.