Disadvantages:
- It converges pretty slowly than Newton-Raphson method.
Advantages:
- It only uses addition and substraction!
- Can be used to find upto 500 digits(fast) or more(slow) after decimal places.
Algorithm for finding square root of 'n':
Initiation
Let 'a' = 5n and 'b' = n
Repetition
R1: If a ≥ b; replace 'a' with a-b and 'b' with b+10
R2: If a < b; replace 'a' with 100*a and add a zero before the unit's digit of 'b'
Observation
Value of 'b' converges to the square root of 'n' (without decimal point)
Example
To illustrate the method, let’s begin to work out the value of the square root of 2.
The initial step sets a = 5 × 2 = 10 and b = 5. So we start with the pair (a, b) = (10, 5).
Now we perform the repeated steps. As 10 > 5, we must apply R1. We therefore replace a with a − b, so that now a = 10 − 5 = 5, and add 10 to b, so that b becomes 15. The new pair is therefore (5, 15).
We apply the rule again. This time, however, a = 5 < 15 = b, and so we use R2. This rule says: Add two zeroes to the end of a, to make a = 500, and put a zero before the final digit of b, so that now b = 105. The pair becomes (500, 105).
Now 500 > 105, so we apply R1, and we replace a by a−b = 500−105 = 395, and add 10 to b, so that b becomes 115. Our pair is then (395, 115). Repeatedly applying the rules in turn gives:
(10, 5) R1 −→ (5, 15) R2 −→ (500, 105) R1 −→ (395, 115) R1 −→ (280, 125) R1 −→ (155, 135) R1 −→ (20, 145) R2 −→ (2000, 1405) R1 −→ (595, 1415) R2 −→ (59500, 14105) R1 −→ (45395, 14115) R1 −→ (31280, 14125) R1 −→ (17155, 14135) R1 −→ (3020, 14145) R2 −→ (302000, 141405) R1 −→ (160595, 141415) R1 −→ (19180, 141425) R2 −→ (1918000, 1414205) −→ · · ·
Conclusion
Obviously, it is far too slow to do with pen and paper, but is has proved to be an important tool in finding roots to many decimal places
Python implementation of the algorithm
def japanese_square_root(num):
a = 5*num
b = 5
while len(str(b))<=200:
if a >= b:
a = a-b
b += 10
else:
a *= 100
b = b*10 - 45 # same as adding a '0' before unit's place
return b
Input: 2
Output: 1414213562373095048801688724209698078569671875376948073
17667973799073247846210703885038753432764157273501384623091229702492483
605585073721264412149709993583141322266592750559275579995050115278206057147
Know more about it here.