next up previous
Next: 3.2 AGM, $BBeI=A* Up: 3 $B2]Bj(B7B$B2r@b(B Previous: 3 $B2]Bj(B7B$B2r@b(B

3.1 $ \arctan$ $B$N(B Taylor $BE83+$rMQ$$$F7W;;$9$k(B

$B4{$K8@$C$F$"$k$h$&$K!"(B http://nalab.mind.meiji.ac.jp/~mk/syori2/jouhousyori2-2010-07/node8.html$B$G>R2p$7$?(B piarctan.BAS $B$,C!$-Bf$K$J$k!#(B $B$3$l$O!"M?$($i$l$?(B $ x$, $ N$ $B$KBP$7$F!"(B $B5i?t(B

(1) $\displaystyle \tan^{-1} x=\sum_{n=1}^\infty\frac{(-1)^{n-1}}{2n-1}x^{2n-1}$

$B$NBh(B $ N$ $BItJ,OB(B $ S_N$ $B$r7W;;$9$k%W%m%0%i%`$G$"$k!#(B
piarctan.BAS ($B:F7G(B)

REM piarctan.BAS --- $B%^!<%@%t%!!&%0%l%4%j!

$ x=1$ $B$N>l9g$N(B

$\displaystyle \frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\cdots
$

$B$OM-L>$G$"$k$,!"<}B+$OHs>o$KCY$$!#

$\displaystyle \pi-4S_N\kinji \frac{1}{N}
$

$B$,@.$jN)$D(B (1$B2/(B($ =10^8$)$B9`B-$7$F!"8m:9(B $ 10^{-8}$ -- $ 10$$B7e$b9g$o$J$$(B)$B!#(B $B$I$s$J$K%3%s%T%e!<%?!<$,B.$/$F$b!"(B $ 100$$B7e$N@:EY$NCM$r7W;;$9$k$N$OL5M}$G$"$k!#(B

$B$7$+$7!"$3$l$O(B $ x$ $B$NCM$H$7$F!"<}B+%.%j%.%j$N(B $ x=1$ $B$rBeF~$9$k$+$i$G$"$k(B ($B1) $B$N<}B+H>7B$O(B $ 1$ $B$G$"$k(B)$B!#(B $ \vert x\vert<1$ $B$J$k(B $ x$ $B$KBP$7$F$O!"(B (1) $B$N<}B+$O$0$C$HB.$/$J$k!#(B

$B0lHV4JC1$J$N$O!"9b9;@8$bCN$C$F$$$k(B $ \tan\dfrac{\pi}{6}=\dfrac{1}{\sqrt{3}}$ $B$K4p$E$/!"(B $ \pi=6\tan^{-1}\dfrac{1}{\sqrt{3}}$ $B$rMQ$$$k$3$H$G$"$k!#(B

INPUT X $B$r(B X=1/SQR(3) $B$KJQ$(!"(B $ 4$ $B$r$+$1$k$H$3$m$r(B $ 6$ $B$r$+$1$k$h$&$KJQ$($?$b$N$,OPTION ARITHMETIC DECIMAL_HIGH $B$K$bJQ$($?(B)$B!#(B

kadai7b1.BAS

REM kadai7b1.BAS --- $B%^!<%@%t%!!&%0%l%4%j!

$B:G8e$K(B PI $B$HHf3S$7$F$$$k$N$O!"(B $B%+%s%K%s%0$G$"$k$,(B ($B6l>P(B)$B!"(B $B$=$N7k2L$O $B$/$i$$$G(B $ 100$ $B7e@:EY$rkadai7b1.TXT ($ N=210$ $B$N>l9g(B)

? 210
6*arctan(x)$B"b(B 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798175415515142074668914143478172519579252999001468666117910963800249473594922589558451149412426597243798192135258779349163444188419002776980473968671998254815310845772183661993477117122206330295980300468265032425044971769581966122368923975830190359265260280452439469056239411353322600285365354079198623561329837112540037802583883742612430308012431266108485579200748300447615517051621776071743812297241593061362796460193924590409288715907812776745710640173447366147858476628929330128224069043383756471261001339104089689573643179485746003276589222538648739794448220503879861605852796470434461563725003377966770398821962936563887508996436649003257909678486654464777327912490175223366294675627953729664047127912971230253567836505483256602936448002590856734658997052628800136082809703995747012631975584920533663300884564944271834022542189687366731857503436221868148525708031224234008111518938525225632668655196746 
$B&P$H$N:9(B=-3.939E-0103


$ N$ $B$,A}2C$9$k$K$D$l$F!"@:EY$,$I$N$h$&$K>e$,$C$F$$$/$+8+$k$?$a$K!"(B INPUT N $B$r$d$a$F!"(B $BA4BN$r(B
FOR N=10 TO 210 STEP 10
...
NEXT N
$B$H(B FOR NEXT $B%k!<%W$K$7$F!"7 $B$N7k2L$rF@$k!#(B

$B?^(B 7: $B9`?t(B $ N$ $B$H8m:9(B
$ N$ $B8m:9(B
$ 10$ $ -2.143\times 10^{-6} $
$ 20$ $ -1.839\times 10^{-11}$
$ 30$ $ -2.085\times 10^{-16}$
$ 40$ $ -2.654\times 10^{-21}$
$ 50$ $ -3.601\times 10^{-26}$
$ 60$ $ -5.086\times 10^{-31}$
$ 70$ $ -7.387\times 10^{-36}$
$ 80$ $ -1.095\times 10^{-40}$
$ 90$ $ -1.649\times 10^{-45}$
$ 100$ $ -2.514\times 10^{-50}$
$ 110$ $ -3.872\times 10^{-55}$
$ 120$ $ -6.011\times 10^{-60}$
$ 130$ $ -9.399\times 10^{-65}$
$ 140$ $ -1.478\times 10^{-69}$
$ 150$ $ -2.337\times 10^{-74}$
$ 160$ $ -3.710\times 10^{-79}$
$ 170$ $ -5.915\times 10^{-84}$
$ 180$ $ -9.461\times 10^{-89}$
$ 190$ $ -1.518\times 10^{-93}$
$ 200$ $ -2.442\times 10^{-98}$
$ 210$ $ -3.939\times 10^{-103}$
$B?^(B 8: $B9`?t(B $ N$ $B$H8m:9(B ($B=D<4BP?tL\@9(B)
\includegraphics[width=10cm]{kadai7b/kadai7b1.eps}


$B8m:9$,BgBNEyHf?tNsE*$K(B ($ N$ $B$K4X$7$F;X?t4X?tE*$K!)(B) 0 $B$K<}B+$7$F$$$kMM;R$,(B $BJ,$+$k(B $BK\Ev$O$3$&$$$&$N$O%0%i%U$K$9$k$N$,NI$$!#(B $B$3$3$G$O(B gnuplot (1$BG/@8$N$H$-$K=,$C$?$O$:(B) $B$r;H$C$F$_$?$,!"(B $B$b$A$m$s==?J(B BASIC $B$GIA$/$N$b4JC1$G$"$k!#(B


\begin{yodan}[$B>/$7?t3X(B]
$B$3$N5i?t$O8rBe5i?t$J$N$G!

$B$=$l$G$O!"MW5a$5$l$F$$$?7k2L$r5a$a$k%W%m%0%i%`$r:n$m$&!#(B $B2]Bj(B5B$B$G$d$C$?$h$&$K!"(BFOR NEXT $B$G(B N $B$rBg$-$/$7$F9T$C$F!"(B $BItJ,OB$r7W;;$9$k%W%m%0%i%`$K$9$k!#(B

kadai7b2.BAS

REM kadai7b2.BAS --- $B%^!<%@%t%!!&%0%l%4%j!.?tE@0J2<(B110$B0L$^$GI=<((B
OPTION ARITHMETIC decimal_high
LET FMT$="N=### -%."&REPEAT$("#",110)
LET N=250
LET X=1/SQR(3)
LET F=-X*X
LET T=X
LET S=0
FOR J=1 TO N
   LET A=T/(2*J-1)
   LET S=S+A
   LET T=F*T
   IF MOD(J , 10) =0 THEN
      PRINT USING fmt$:J,6*S
   END IF
NEXT J
REM $BAH9~$_Dj?t(B PI $B$H$N:9$r7W;;$7$F$_$k(B
PRINT USING "$B&P$H$N:9(B=-%.###^^^^^^":PI-6*S
END


$B7k2L$O

N= 10  3.14159051093808009964275422994425504368823543729459863385301608264097243139275244243408049537664837144194195965
N= 20  3.14159265357140338177371056457791845749708370902558800062450336039110974863967354187227900363909324495379551167
N= 30  3.14159265358979302993126907675698512128890364163387594078160677223250316907504141910094384327780556430672531665
N= 40  3.14159265358979323845998904545815723164682333580898559851810755021711576515774234507828600074005410050567590231
N= 50  3.14159265358979323846264334727215223712766242383933328994947074253583407491260142245980404128750279799354137185
N= 60  3.14159265358979323846264338327899429478611788675967126248193958028428440424653148715465478961463146251880103922
N= 70  3.14159265358979323846264338327950287681011408881114209344980232821142119403271477392517560945005206755050370174
N= 80  3.14159265358979323846264338327950288419705988682105507083891588023987499387955321296887381276928532730590072263
N= 90  3.14159265358979323846264338327950288419716939772598750958858556364736336671762754275139106652717651497248200692
N=100  3.14159265358979323846264338327950288419716939937508067873446993355312916323675359893283010326258393751533470850
N=110  3.14159265358979323846264338327950288419716939937510582058777735023191320405347993715459391151728912750033891584
N=120  3.14159265358979323846264338327950288419716939937510582097493858083854337957828522717360102517299756190923350247
N=130  3.14159265358979323846264338327950288419716939937510582097494459221382757184428319165349115190289161510116917782
N=140  3.14159265358979323846264338327950288419716939937510582097494459230781492806566013451682112808110943615477604646
N=150  3.14159265358979323846264338327950288419716939937510582097494459230781640626284131806763014633707611386690905481
N=160  3.14159265358979323846264338327950288419716939937510582097494459230781640628620862758871391779973144580812870063
N=170  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862212031675396342638517754282
N=180  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803473073620684479093638320
N=190  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534059912106400090011
N=200  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211704355929502943
N=210  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798175415515
N=220  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808014
N=230  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
N=240  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
N=250  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
$B&P$H$N:9(B= 2.722E-0122


$B>/!9;z$,>.$5$/$F8+$E$i$$$,!"(B $ N=230,240,250$ $B$N>l9g$K!"(B $B>.?tE@0J2<(B$ 110$$B0L$^$G$N>.?tI=<($,0lCW$7$F$$$k$3$H$,J,$+$k!#(B $B$3$l$G>.?tE@0J2<(B$ 100$$B0L$^$G$NCM$OF@$i$l$F$$$k$H9M$($FNI$$$@$m$&!#(B

$B1_<~N((B $ \pi$ $B$N>.?tE@0J2<(B $ 110$ $B0L$^$G(B
 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510
   58209 74944 59230 78164 06286 20899 86280 34825 34211 70679
   82148 08651

($BMW5a$5$l$F$$$?$N$O!"(B$ 100$$B0L$^$G$@$C$?$,!"(B$ 101$$B0L$,(B `8' $B$G!"(B $B;M$B0L$^$GI=<($7$F$*$/!#(B)


next up previous
Next: 3.2 AGM, $BBeI=A* Up: 3 $B2]Bj(B7B$B2r@b(B Previous: 3 $B2]Bj(B7B$B2r@b(B
Masashi Katsurada
$BJ?@.(B22$BG/(B6$B7n(B24$BF|(B