Bakshali Approximation is a mathematical method of finding an approximation to a square root of a number. It is equivalent to two iterations of Babylonian Method.
To calculate sqrt(S). Step 1: Calculate nearest perfect square to S i.e (N2). Step 2: Calculate d = S - (N2) Step 3: Calculate P = d/(2*N) Step 4: Calculate A = N + P Step 5: Sqrt(S) will be nearly equal to A - (P2/2*A)
Below is the implementation of above steps.
Square root of 9.2345 = 3.03883
find sqrt(9.2345) S = 9.2345 N = 3 d = 9.2345 – (3^2) = 0.2345 P = 0.2345/(2*3) = 0.0391 A = 3 + 0.0391 = 3.0391 therefore, sqrt(9.2345) = 3.0391 – (0.0391^2/(2*0.0391)) = 3.0388
- Used to find approximation to a square root.
- Requires the value of nearest perfect square of the number whose square root is needed to be calculated.
- More efficient for floating point numbers than integers as it finds approximation.
This article is contributed by Harsh Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Babylonian method for square root
- Find minimum number to be divided to make a number a perfect square
- Magic Square
- Square root of an integer
- Euler's criterion (Check if square root under modulo p exists)
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
- Check perfect square using addition/subtraction
- Program to find the Roots of Quadratic equation
- Find Square Root under Modulo p | Set 2 (Shanks Tonelli algorithm)
- Roots of Unity
- Seeds (Or Seed Roots) of a number
- Nth Square free number
- Fast method to calculate inverse square root of a floating point number in IEEE 754 format
- How to check if given four points form a square
- Number of times the largest perfect square number can be subtracted from N