Post Reply 
What comes next?
10-19-2024, 09:09 PM
Post: #48
RE: What comes next?
(10-19-2024 08:12 AM)Thomas Klemm Wrote:  Now this is a bit off topic, but the same method can be used to calculate square roots.
To calculate \(\sqrt{a}\), we use NEXT to calculate consecutive values of \(f(x)=x^2-a\).

Just to clear up confusion, f(x) = k*(x^2-a), where k start at 0.5, scale-up by 10 for each correct x digit.

Initially, f = 0.5*(x^2-a), ∇f = x-0.5, ∇²f = 1

This is the reason for INIT setup, at x=0:
M03 = f = -0.5*a
M02 = ∇f = -0.5
M01 = ∇²f = 1

Example, if we do √41 manually, digit by digit, we have:

f(x=6) = 0.5*(6^2 - 41) = -0.5*41 + 0.5 + 1.5 + 2.5 + 3.5 + 4.5 + 5.5 = -2.5
f(x=6.4) = 5*(6.4^2 - 41) = -25 + 6.05 + 6.15 + 6.25 + 6.35 = -0.2
f(x=6.40) = 50*(6.40^2 - 41) = -2
f(x=6.403) = 500*(6.403^2 - 41) = -20 + 6.4005 + 6.4015 + 6.4025 = -0.7955
...

This is similar to HP calculator, but not quite.
Calculator sqrt algorithm scale F by 100 for each correct digit, to keep ∇²F = 1, all the time.

F(X=6) = -2.5
F(X=64) = -250 + 60.5 + 61.5 + 62.5 + 63.5 = -2
F(X=640) = -200
F(X=6403) = -20000 + 6400.5 + 6401.5 + 6402.5 = -795.5
...

https://www.hpmuseum.org/forum/thread-17...#pid152220
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
What comes next? - Thomas Klemm - 10-08-2024, 12:26 AM
RE: What comes next? - chromos - 10-08-2024, 05:16 AM
RE: What comes next? - John Keith - 10-08-2024, 12:14 PM
RE: What comes next? - Thomas Klemm - 10-08-2024, 02:31 PM
RE: What comes next? - Thomas Klemm - 10-10-2024, 05:54 AM
RE: What comes next? - Gil - 10-10-2024, 02:55 PM
RE: What comes next? - Thomas Klemm - 10-10-2024, 08:24 PM
RE: What comes next? - Gil - 10-10-2024, 09:17 PM
RE: What comes next? - Thomas Klemm - 10-11-2024, 03:12 AM
RE: What comes next? - C.Ret - 10-13-2024, 12:35 PM
RE: What comes next? - Thomas Klemm - 10-13-2024, 06:08 PM
RE: What comes next? - Geoff Quickfall - 10-13-2024, 06:33 PM
RE: What comes next? - John Keith - 10-13-2024, 08:49 PM
RE: What comes next? - Thomas Klemm - 10-14-2024, 02:14 AM
RE: What comes next? - Thomas Klemm - 10-14-2024, 06:21 AM
RE: What comes next? - Gilles - 10-14-2024, 08:35 PM
RE: What comes next? - John Keith - 10-15-2024, 05:39 PM
RE: What comes next? - FLISZT - 10-15-2024, 10:59 PM
RE: What comes next? - Thomas Klemm - 10-15-2024, 03:39 AM
RE: What comes next? - Gil - 10-15-2024, 10:09 AM
RE: What comes next? - Thomas Klemm - 10-15-2024, 11:41 AM
RE: What comes next? - Gil - 10-15-2024, 01:34 PM
RE: What comes next? - Gil - 10-15-2024, 01:53 PM
RE: What comes next? - Gilles - 10-15-2024, 04:08 PM
RE: What comes next? - John Keith - 10-15-2024, 09:09 PM
RE: What comes next? - Thomas Klemm - 10-15-2024, 02:53 PM
RE: What comes next? - Thomas Klemm - 10-15-2024, 03:08 PM
RE: What comes next? - Thomas Klemm - 10-16-2024, 12:56 AM
RE: What comes next? - Thomas Klemm - 10-16-2024, 04:51 AM
RE: What comes next? - Gil - 10-16-2024, 10:14 AM
RE: What comes next? - Thomas Klemm - 10-16-2024, 11:41 AM
RE: What comes next? - Gil - 10-16-2024, 01:17 PM
RE: What comes next? - John Keith - 10-16-2024, 04:54 PM
RE: What comes next? - Gilles - 10-16-2024, 07:45 PM
RE: What comes next? - Thomas Klemm - 10-16-2024, 08:38 PM
RE: What comes next? - Thomas Klemm - 10-17-2024, 05:15 AM
RE: What comes next? - Gil - 10-17-2024, 10:16 AM
RE: What comes next? - Gilles - 10-18-2024, 07:53 PM
RE: What comes next? - Gil - 10-18-2024, 10:49 PM
RE: What comes next? - John Keith - 10-18-2024, 11:57 PM
RE: What comes next? - FLISZT - 10-19-2024, 12:03 AM
RE: What comes next? - Albert Chan - 10-19-2024, 01:29 AM
RE: What comes next? - Thomas Klemm - 10-19-2024, 12:03 AM
RE: What comes next? - Thomas Klemm - 10-19-2024, 12:17 AM
RE: What comes next? - Gil - 10-19-2024, 01:00 AM
RE: What comes next? - Thomas Klemm - 10-19-2024, 08:12 AM
RE: What comes next? - Albert Chan - 10-19-2024 09:09 PM
RE: What comes next? - Albert Chan - 10-20-2024, 08:44 PM
RE: What comes next? - Gil - 10-19-2024, 06:08 PM
RE: What comes next? - Thomas Klemm - 10-19-2024, 11:25 PM
RE: What comes next? - Thomas Klemm - 10-20-2024, 09:39 PM



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