Post Reply 
New Sum of Powers Log Function
03-29-2021, 08:39 PM (This post was last modified: 03-29-2021 08:46 PM by C.Ret.)
Post: #2
RE: New Sum of Powers Log Function
Nice article Namir ! Thanks for sharing.

I don't know what will be a practical application of this new function, but meanwhile, here is my contribution for the SHARP PC-1211 inspired from the generic program you give for BASIC pocket machines.

Since, it is a venerable and aged pocket, I add a way to get an estimation, for any user in a hurry, who may not have time or patience to wait for the several minutes needed to compute the exact x value by (numerus) iterations.


Code:
1:Y=1:FOR I=2 TO N:Y=Y+I^Z:NEXT I:Y=S-Y:RETURN
2:INPUT "N.TERMS N=";N,"TOT SUM S=";S:RETURN
3:PAUSE "NEW SOPLOG.N.(S) = X ":PAUSE "S=SUM I^X FOR I=1 TO N":GOTO 2
4:L=LOG N,X=10^(-.314706469-.965654959*LOG L)*LN S-1.1689028*(1-EXP -1.6467435L:GOTO 6
5:H=€-3*(1+ABS X,Z=X:GOSUB 1:F=Y,Z=X+H:GOSUB 1:D=HF/(Y-F,X=X-D,R=R-1:IF RIF ABS D>TGOTO 5
6:BEEP 1:PRINT "SOPLOG";N;"(";S;E$;X:PRINT E$;X:RETURN
8:"Z"GOSUB 3:X=1,T=€-7,R=€3,E$=")=":GOSUB 5:GOTO 8
9:"A"GOSUB 3:E$=")¥":GOSUB 4:GOTO 9

In DEF-mode, press shift+Z for the exact value obtained by the iterative process or press shift-A for an immediate estimation.

Code:

>                        [mode] DEF
>                        [shift][ Z ]
NEW SOPLOG.N.(S) = X
S= SUM I^X FOR I=1 TO N
N.TERM N=_               10 [enter]
TOT SUM S=_              250 [enter]
                         <... 2'38" ...>  
SOPLOG10.(250.)=1.784518 [enter]
)=1.784518859
Code:
                         [shift][ A ]
NEW SOPLOG.N.(S) = X
S= SUM I^X FOR I=1 TO N
N.TERM N=_               1€3 [enter]
TOT SUM S=_              7500 [enter]
SOPLOG1000.(7500.)¥3.356 [enter]
)¥3.358863814€-01

P.S.:
¥ is shift-Y (Yen) character that I use to indicate approximative egality.
€ is the standard bold |Exp key that indicates ten's exponentiation on this pocket.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
New Sum of Powers Log Function - Namir - 03-29-2021, 04:53 PM
RE: New Sum of Powers Log Function - C.Ret - 03-29-2021 08:39 PM
RE: New Sum of Powers Log Function - Namir - 03-30-2021, 11:05 AM
RE: New Sum of Powers Log Function - Gene - 03-30-2021, 01:43 PM
RE: New Sum of Powers Log Function - C.Ret - 03-30-2021, 04:01 PM
RE: New Sum of Powers Log Function - Namir - 03-30-2021, 05:56 PM
RE: New Sum of Powers Log Function - Namir - 03-31-2021, 01:27 PM
RE: New Sum of Powers Log Function - Namir - 03-31-2021, 02:19 PM
RE: New Sum of Powers Log Function - Namir - 04-01-2021, 06:05 PM
RE: New Sum of Powers Log Function - Namir - 04-01-2021, 11:55 PM
RE: New Sum of Powers Log Function - Namir - 04-04-2021, 03:41 PM



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