View Single Post
Old 2021-11-14, 09:28   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

3×29×113 Posts
Default

@Matt - Here's an easy construction for square roots approximations of any arbitrary numbers. No need for matrices.
Use Newton's method for solving f(x)=x2-a=0. You know f'(x). It is 2x.
xnew = x - f(x)/f'(x) = x - (x^2-a)/(2x) = (x^2+a)/2x
...or (x+a/x)/2 as frequently taught in schools

For \(\sqrt 2\): use a=2 and apply this repeatedly:
Code:
a=2; x=1;
x=(x+a/x)/2
3/2
x=(x+a/x)/2
17/12
x=(x+a/x)/2
577/408
x=(x+a/x)/2
665857/470832
x=(x+a/x)/2
886731088897/627013566048
x=(x+a/x)/2
1572584048032918633353217/1111984844349868137938112
For \(\sqrt 10\): use a=10 and apply this repeatedly:
Code:
a=10; x=3;
x=(x+a/x)/2
19/6
x=(x+a/x)/2
721/228
x=(x+a/x)/2
1039681/328776
x=(x+a/x)/2
2161873163521/683644320912
x=(x+a/x)/2
9347391150304592810234881/2955904621546382351702304
...
Now, try the same to get fast approximation of a cubic root of 2:
xnew = x - f(x)/f'(x) = x - (x3-a)/(3x2) = (2x^3+a)/(3x^2)
...
Batalov is offline   Reply With Quote