Re: Arctangent approximation
- To: mathgroup at smc.vnet.net
- Subject: [mg107670] Re: Arctangent approximation
- From: dh <dh at metrohm.com>
- Date: Mon, 22 Feb 2010 08:32:22 -0500 (EST)
- References: <hlglio$l5p$1@smc.vnet.net>
Hi Sidey, this is actually a truncated power series where the last term has been changed a little: ArcTan[x]= x-x^3/3+x^5/5-x^7/7+x^9/9-x^11/11 + ... f1[x]= x-x^3/3+x^5/5-x^7/7+x^9/9 f2[x]= x-x^3/3+x^5/5-x^7/7+x^9 9/48 this is your function f3[x]=x-x^3/3+x^5/5-x^7/7+x^9/9-x^11/11 We create a table with following columns: x, ArcTan[x],f1[x]-ArcTan[x],f2[x]-ArcTan[x],f2[x]-ArcTan[x]: x ArcTan h1 h2 h3 0. 0. 0. 0. 0. 0.16 0.16 1.3*10^(-10) -2.8*10^(-10) -2.7*10^(-12) 0.31 0.3 2.5*10^(-7) 4.*10^(-8) -2.1*10^(-8) 0.47 0.44 0.000019 0.000012 -3.6*10^(-6) 0.63 0.56 0.00041 0.00031 -0.00014 0.79 0.67 0.0042 0.0034 -0.0022 0.94 0.76 0.027 0.023 -0.02 1.1 0.83 0.13 0.11 -0.13 1.3 0.9 0.48 0.43 -0.64 1.4 0.96 1.5 1.4 -2.6 1.6 1. 4.3 3.9 -8.8 Daniel On 17.02.2010 12:57, sidey wrote: > A professor (Herbert Medina) came up with this remarkable > approximation. > > Since I don't have Mathematica, could someone run it for > numberofdigits=9 and 12 please? (and send me the result?) > > here is a short result > h2(x) = x - x^3/3 + x^5/5 - x^7/7 + 5x^9/48.. > > Thank you. > > PS reference is: http://myweb.lmu.edu/hmedina/Papers/Arctan.pdf > > Clear[h, m, a, numberofdigits] > numberofdigits=12; > m=Floor[-(1/5) Log[4,5*0.1^(numberofdigits+1)]]+1; > Do[a[2j]=(-1)^(j+1) Sum[Binomial[4m,2k] (-1)^k, {k,j+1,2m}]; > a[2j-1]=(-1)^(j+1) Sum[Binomial[4m,2k+1] (-1)^k, {k,j,2m-1}], > {j,0,2m-1}]; > h[m,x_]:=Sum[(-1)^(j+1) / (2j-1) x^(2j-1), {j,1,2m}] + > Sum[a[j]/((-1)^(m+1) 4^m (4m+j+1)) x^(4m+j+1), {j,0, 4m-2}]; > Print["h[",m,",x] given below computes ArcTan[x] with ", > numberofdigits," digits of accuracy for x in [0,1]."] > Print["h[m,x] = ", h[m,x]] > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>