Post Reply 
Square Root Process Similar to Long Division
09-17-2021, 11:58 PM
Post: #2
RE: Square Root Process Similar to Long Division
(09-17-2021 11:00 PM)jeejohn Wrote:  I saw the thread "Third Order Convergence for Square Roots..."

I thought that I would offer up a process that allows calculations of square roots, similar to how long division is done

Nice. By the way, you can cut/paste table inside code block (like mine)

I just deleted a post about old-school square root from Third Order Convergence thread.
It really should belong here. Here goes.

For sqrt of value very close to 1, it is is even closer to 1. √(1+2ε) ≈ 1+ε
We can even *assume* result is 1, then adjust for it.

Example, √(0.9996)

Here is old school method for square root.
With nice divisor = 1, we do 3-digits at a time.
Numbers are scaled so that we work mostly with integer.

0.9996E6 = 1E3^2 - 400       // X = 1E3

Newtons correction (S-X*X)/2/X, for 2nd 3-digits.

-400E3/2 = -200E3 = -200X + 0

Negative digits OK, we will fix later. It just meant √(0.9996) ≈ 0.999800

Other digits followed below patterns:
1st column = quotient
2nd column = remainder, then corrected (shell-like cross multiply, except center)
Code:
1000
-200    0E3 - (-200)^2/2 = -20E3 = -20X + 0
-20     0E3 - (-20)*(-200) = -4E3 = -4X + 0
-4      0E3 - (-4)*(-200)-(-20)^2/2 = -1E3 = -X + 0
-1      0E3 - (-1)*(-200)-(-4)*(-20) = -280 = -X + 720
-1      720E3 - (-1)*(-200)-(-1)*(-20)-(-4)^2/2 = 719772 = 719X + 772
719     772E3 - 719*(-200)-(-1)*(-20)-(-1)*(-4) = 915776 = 915X + 776
915     776E3 - 915*(-200)-719*(-20)-(-1)*(-4)-(-1)^2/2 = 973375.5 = 973X + 375.5
973     375.5E3 - 973*(-200)-915*(-20)-719*(-4)-(-1)*(-1) = 591275 = 591X + 275
591     275E3 - ...

Normalize base-1000 digits:

√(.9996) = 0.999 799 979 995 998 999 719 915 973 591 ...

Ref: book "Dead Reckoning: Calculating without instruments", chapter on roots
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Square Root Process Similar to Long Division - Albert Chan - 09-17-2021 11:58 PM



User(s) browsing this thread: 1 Guest(s)