가우스-레젠드르 알고리즘 은 π 의 숫자를 계산하는 알고리즘 이다. 25회 반복에 불과해 4500만 correct의 정확한 자릿수를 생성하는 등 급속한 수렴성을 보인 점이 눈에 띈다. 그러나 단점은 컴퓨터 메모리 집약적이어서 마친과 같은 공식 을 대신 사용하는 경우가 있다는 점이다.
이 방법은 칼 프리드리히 가우스 (1777–1855)와 아드리아-마리 레전드르 (1752–1833)의 개별 작업에 바탕을 둔 것으로 현대의 곱셈과 제곱근 알고리즘 을 결합한 것이다. 산술-기하 평균 에 근사치를 위해 두 숫자를 반복적으로 산술 평균과 기하 평균 으로 대체한다.
아래에 제시된 버전은 가우스-울러, 브렌트-살라민( 또는 살라민-브렌트) 알고리즘 으로도 알려져 있으며,[1] 리차드 브렌트 와 유진 살라민 이 1975년에 독자적으로 발견했다. 1999년 9월 18일부터 20일까지 π 의 처음 206,158,430,000개의 소수 자릿수를 계산하는 데 사용되었고, 결과는 보르웨인의 알고리즘 으로 확인되었다.
알고리즘. 초기값 설정: a 0 = 1 b 0 = 1 2 t 0 = 1 4 p 0 = 1. {\displaystyle a_{0}=1\qquad b_{0}={\frac {1}{{\sqrt{2}}:}\qquad t_{0}={\frac {1}{4}\qquad p_{0}=1}1. } n {\ displaystyle a_{n} 과 (와) b {\ displaystyle b_{n} 의 차이가 원하는 정확도에 도달할 때까지 다음 지침을 반복하십시오. a n + 1 = a n + b n 2 , b n + 1 = a n b n , t n + 1 = t n − p n ( a n − a n + 1 ) 2 , p n + 1 = 2 p n . {\displaystyle {\begin{aligned}a_{n+1}&={\frac {a_{n}+b_{n}}{2}},\\\\b_{n+1}&={\sqrt {a_{n}b_{n}}},\\\\t_{n+1}&=t_{n}-p_{n}(a_{n}-a_{n+1})^{2},\\\\p_{n+1}&=2p_{n}. \\end{aigned}} π 은 다음과 같이 근사하게 계산한다. π ≈ ( a n + 1 + b n + 1 ) 2 4 t n + 1 . {\displaystyle \pi \pi \약 {\frac {(a_{n+1}+b_{n+1}^{2}}:{4t_{n+1}. } 처음 세 번의 반복은 다음과 같다(첫 번째 잘못된 자리까지 주어지는 근사치):
3.140 … 3.140\190 } 3.14159264 … {\displaystyle 3.14159264\pair } 3.1415926535897932382 … {\displaystyle 3.1415926535897932382\cHB} 알고리즘은 2차 정합성 을 가지며, 이는 기본적으로 정확한 자릿수가 알고리즘의 각 반복 과 함께 두 배가 된다는 것을 의미한다.
수학적 배경 산술-기하 평균의 한계 a와0 b라는0 두 숫자의 산술-기하 평균 은 시퀀스의 한계를 계산하여 구한다.
a n + 1 = a n + b n 2 , b n + 1 = a n b n , {\displaystyle {\n1}a_{n+1}&={\frac {a_{n}+b_{n}}{n1}:{n2}},\[6pt]b_{n+1}&={\sqrt{a_{n}b_{n}}}}},\end{ned}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} 둘 다 같은 한계로 수렴하는 거지 If a 0 = 1 {\displaystyle a_{0}=1} and b 0 = cos φ {\displaystyle b_{0}=\cos \varphi } then the limit is π 2 K ( sin φ ) {\textstyle {\pi \over 2K(\sin \varphi )}} where K ( k ) {\displaystyle K(k)} is the complete elliptic integral of the first kind
K ( k ) = ∫ 0 π / 2 d θ 1 − k 2 죄를 짓다 2 θ . {\displaystyle K(k)=\int _{0}^{\pi /2}{\frac {d\theta }{1-k^{2}\sin ^{2}\}}. } c 0 = sin φ \ {\displaystyle c_{ 0}=\sin \varphi }, c + 1 = a - i + 1 {\displaystyle c_{i+1}=a_{i}-a_ {i+1}:{i+ 1}:{i+1}:{i+ 1}, 그러면
∑ i = 0 ∞ 2 i − 1 c i 2 = 1 − E ( 죄를 짓다 φ ) K ( 죄를 짓다 φ ) {\displaystyle \sin \sin \varphi )}{{i-1}c_{i}^{2}=1-{E(\sin \varphi )}}}K(\sin \varphi )}}}}} 여기서 E ( k ) {\displaystyle E(k)} 은 두 번째 유형의 완전한 타원 적분 이다.
E ( k ) = ∫ 0 π / 2 1 − k 2 sin 2 θ d θ {\displaystyle E(k)=\int _{0}^{\pi /2}{\sqrt {1-k^{2}\sin ^{2}\theta }}\;d\theta } and K ( k ) = ∫ 0 π / 2 d θ 1 − k 2 sin 2 θ . {\displaystyle K(k)=\int _{0}^{\pi /2}{\frac {d\theta }{\sqrt {1-k^{2}\sin ^{2}\theta }}}. } 가우스는 이 두 가지 결과를 모두 알고 있었다.[2] [3] [4]
레전드레의 정체 φ + = = 1 2 style {\displaystyle \ varphi } 및 θ {\displaystyle \theta}{1 \over 2}\pi } Legendre가 ID를 입증했다.
K ( 죄를 짓다 φ ) E ( 죄를 짓다 θ ) + K ( 죄를 짓다 θ ) E ( 죄를 짓다 φ ) − K ( 죄를 짓다 φ ) K ( 죄를 짓다 θ ) = 1 2 π . {\displaystyle K(\sin \varphi )E(\sin \varphi )+K(\sin \varphi )-K(\sin \varphi )={1 \over 2}\pi .} [2] 동등하게, ∀ φ : K ( 죄를 짓다 φ ) [ E ( cas φ ) − K ( cas φ ) ] + K ( cas φ ) E ( 죄를 짓다 φ ) = π 2 {\displaystyle \frac {\sin \varphi )[E(\cos \varphi )-K(\cos \varphi )]+K(\cos \varphi )E(\sin \varphi )={\frac {\pi{2}}: 적분 미적분이 있는 기초 교정쇄 Gauss-Legendre 알고리즘은 적분 미적분만을 사용하여 증명될 수 있다. 이것은 여기서도[5] 여기서도 끝난다.[6]
참고 항목 참조 ^ Brent, Richard , Old 및 New 알고리즘 for pi , Letters to Editor, Notice of the AMS (1), 페이지 7 ^ a b Brent, Richard (1975), Traub, J F (ed.), "Multiple-precision zero-finding methods and the complexity of elementary function evaluation" , Analytic Computational Complexity , New York: Academic Press, pp. 151–176, archived from the original on 23 July 2008, retrieved 8 September 2007 ^ 살라민, 유진 , 파이 연산 , 찰스 스타크 드레이퍼 연구소 ISS 메모 74–19, 1974년 1월 30일, 매사추세츠 주 캠브리지 ^ Salamin, Eugene (1976), "Computation of pi Using Arithmetic–Geometric Mean", Mathematics of Computation , vol. 30, no. 135, pp. 565–570, doi :10.2307/2005327 , ISSN 0025-5718 , JSTOR 2005327 ^ Lord, Nick (1992), "Recent Calculations of π: The Gauss-Salamin Algorithm", The Mathematical Gazette , 76 (476): 231–242, doi :10.2307/3619132 , JSTOR 3619132 ^ Milla, Lorenz (2019), Easy Proof of Three Recursive π-Algorithms , arXiv :1907.04110