Post Reply 
What comes next?
10-20-2024, 08:44 PM
Post: #50
RE: What comes next?
(10-19-2024 09:09 PM)Albert Chan Wrote:  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

For each digit, we can stop if (F + ∇F + ∇²F) > 0, eliminate routine BACK

Stack Y = (-F) = -K*(x^2 - a)
Stack X = (∇F + ∇²F) = K*((2x-1) + 2) = K*(2x+1) = ΔF

Stop routine NEXT if stack X > Y
Initial setup, K=0.5, x=0 --> Stack Y, X = a/2, 1/2

Code:
00 { 100-Byte Prgm }
01▸LBL "ROOT"
02 12       
03 STO 00
04 10↑X     
05 STO 01
06 X<>Y
07 XEQ "INIT"
08▸LBL 00
09 XEQ "NEXT"
10 XEQ "ZOOM"
11 DSE 00
12 GTO 00
13 IP
14 RCL÷ 01
15 RTN

16▸LBL "INIT"
17 0.5
18 ×
19 LASTX
20 RTN

21▸LBL "NEXT"
22 X>Y?
23 RTN
24 -
25 LASTX
26 1
27 +
28 GTO "NEXT"

29▸LBL "ZOOM"
30 10
31 STO× ST Z
32 STO× ST Z
33 ×
34 4.5
35 -
36 END

41 XEQ "ROOT"      → 6.40312423743

Here, we do √41 manually, digit by digit.

Code:
41
XEQ "INIT"      --> Y=20.5  , X=0.5
XEQ "NEXT"      --> Y=2.5   , X=6.5
XEQ "ZOOM"      --> Y=250   , X=60.5
XEQ "NEXT"      --> Y=2     , X=64.5
XEQ "ZOOM"      --> Y=200   , X=640.5
XEQ "NEXT"      --> Y=200   , X=640.5
XEQ "ZOOM"      --> Y=20000 , X=6400.5
XEQ "NEXT"      --> Y=795.5 , X=6403.5
...
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: 2 Guest(s)