Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Gauss–Legendre algorithm
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Algorithm == # Initial value setting: <math display="block">a_0 = 1\qquad b_0 = \frac{1}{\sqrt{2}}\qquad p_0 = 1\qquad t_0 = \frac{1}{4}.</math> # Repeat the following instructions until the difference between <math>a_{n+1}</math> and <math>b_{n+1}</math> is within the desired accuracy: <math display="block"> \begin{align} a_{n+1} & = \frac{a_n + b_n}{2}, \\ \\ b_{n+1} & = \sqrt{a_n b_n}, \\ \\ p_{n+1} & = 2p_n, \\ \\ t_{n+1} & = t_n - p_n(a_{n+1}-a_{n})^2. \\ \end{align} </math> # {{pi}} is then approximated as: <math display="block">\pi \approx \frac{(a_{n+1}+b_{n+1})^2}{4t_{n+1}}.</math> The first three iterations give (approximations given up to and including the first incorrect digit): :<math>3.140\dots</math> :<math>3.14159264\dots</math> :<math>3.1415926535897932382\dots</math> :<math>3.14159265358979323846264338327950288419711\dots</math> :<math>3.141592653589793238462643383279502884197169399375105820974944592307816406286208998625\dots</math> The algorithm has [[quadratic convergence]], which essentially means that the number of correct digits doubles with each [[iteration]] of the algorithm.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Gauss–Legendre algorithm
(section)
Add topic