(12C) Square Root

10022019, 10:23 AM
(This post was last modified: 10032019 04:10 AM by Gamo.)
Post: #1




(12C) Square Root
For case study purpose here is the very interesting algorithm to compute the square root of a number
by using this equation. B = [A+(n÷A)] ÷ 2 This equation used Successive Approximation Algorithms that continue to better approximate some desired result by providing the initial guess then this program will converge on to the correct answer if your initial guess is bad then more iteration will be required to achieve a giving accuracy. With this program it doesn't matter where you start your initial guess because this algorithm also used the Change in the Approximation: ABS [(BA) ÷ A] and Tolerance of 0.00000001 to guarantee that the result will be possible. This equation solves for B, which is the new improved approximation for the square root of n until we are happy with this approximation, we continue repeating the process by coping the new B value into A and then reexecuting the same equation to get a new B value.  Procedure: FIX 8 n [ENTER] A [R/S] display Answer [X<>Y] number of iterations  Example: √10 used 3 as a guess 10 [ENTER] 3 [R/S] 3.16227766 [X<>Y] 3.00000000 Answer: √10 = 3.16227766 and program took 3 iterations to get this answer.  Program: Code:
Gamo 

« Next Oldest  Next Newest »

Messages In This Thread 
(12C) Square Root  Gamo  10022019 10:23 AM
RE: (12C) Square Root  Albert Chan  10022019, 02:36 PM
RE: (12C) Square Root  Albert Chan  09282020, 05:18 PM
RE: (12C) Square Root  Albert Chan  09282020, 07:14 PM
RE: (12C) Square Root  Gamo  10032019, 02:01 AM
RE: (12C) Square Root  SlideRule  09282020, 09:45 PM
RE: (12C) Square Root  Albert Chan  06082021, 03:36 PM
RE: (12C) Square Root  depor  12212023, 11:50 PM
RE: (12C) Square Root  Dave Hicks  12232023, 01:48 AM
RE: (12C) Square Root  Thomas Klemm  12232023, 04:26 AM

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