Help for a student project on calculator algorithms
|
08-14-2018, 03:06 PM
(This post was last modified: 08-13-2019 10:17 PM by Albert Chan.)
Post: #12
|
|||
|
|||
RE: Help for a student project on calculator algorithms
(08-14-2018 01:39 PM)Bill (Smithville NJ) Wrote: Indeed there is a pdf of the series: Thanks for the link. I were peeking the first article on doing square root. I thought Newton's method is great for doing square root. Seems, the old calculator is too under-powered to do that. Even squaring a number is too costly, replace by sum of odd numbers. The algorithm turns out to be like doing it by hand, grade-school style. Guess the hundreds, guess the tens, ..., like this: SQRT(x = 1936) = 40 + b b error = x - (40+b)^2 = (x - 1600) - 80b - b^2 0 1936 - 1600 = 336 1 336 - 80 - 1 = 255 2 255 - 80 - 3 = 172 3 172 - 80 - 5 = 87 4 87 - 80 - 7 = 0 --> SQRT(1936) = 44 Edit: HP engineer were amazing. Subtractions cut in half: b 5*error = 5x - 5(40+b)^2 = (9680 - 8000) - (400b + 5b^2) 0 9680 - 8000 = 1680 1 1680 - 405 = 1275 2 1275 - 415 = 860 3 860 - 425 = 435 4 435 - 435 = 0 --> SQRT(1936) = 44 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)