Post Reply 
RCL-57
05-20-2022, 01:06 PM
Post: #21
RE: RCL-57
(05-20-2022 07:36 AM)Werner Wrote:  
(05-16-2022 03:58 PM)pauln Wrote:  Thank you! I plan to rewrite RCL-59.

Great! My first ever calculator was a 58 (sadly not a 58C..), and I have RCL-59 on my phone.
Gave me a chance to finally peek at the LinAlg routines of the Master Lib to see how they were written. Not so good, I figured, and rewrote them.
On the simulator, mine are 2-3 times as fast as the originals, so I'd like to know how much faster they would be in the emulator. Oh, and they allow solving a 9x9 system ;-).

Cheers, Werner

Interesting. Did you use a different algorithm or did you optimize the implementation?
Find all posts by this user
Quote this message in a reply
05-20-2022, 05:16 PM
Post: #22
RE: RCL-57
(05-20-2022 12:12 AM)pauln Wrote:  [...]
I know you are kidding : ) but in case anybody wonders, it means of course "Recall TI-57". I borrowed it from my own "RCL-59" and I borrowed that name from an excellent little book:

https://www.amazon.com/Rcl-20-Wiodek-Mie...0951073338

Thanks for the link!
I was unaware of that book!

10B, 10BII, 10C, 11C, 12C, 14B, 15C, 16C, 17B, 18C, 19BII, 20b, 22, 29C, 35, 38G, 39G, 39gs, 41CV, 48G, 97
Find all posts by this user
Quote this message in a reply
05-20-2022, 09:58 PM
Post: #23
RE: RCL-57
(05-16-2022 03:58 PM)pauln Wrote:  Thank you! I plan to rewrite RCL-59.

With RCL-57 I wanted to try a different approach than the one I used for the original RCL-59. It is ROM-based so it's a true emulator instead of a simulator. The code is publicly available so it could potentially be ported to other platforms (and maintained/enhanced : ) by others. On a more technical side I wanted to use the newer iOS frameworks: it has been 10 years since I wrote the original.

For RCL-59, I plan to incorporate some of what I did for RCL-57. This is something I do on the side but I plan to have some version of the new RCL-59 by the end of the year.

May I suggest when you rewrite RCL-59, maybe you could add the ability to install some of the Solid State Modules? May I also suggest as a first option to add the Math/Utilities module start with.
Find all posts by this user
Quote this message in a reply
05-21-2022, 02:13 PM
Post: #24
RE: RCL-57
(05-20-2022 07:36 AM)Werner Wrote:  [...] Gave me a chance to finally peek at the LinAlg routines of the Master Lib to see how they were written. Not so good, I figured, and rewrote them.
On the simulator, mine are 2-3 times as fast as the originals, so I'd like to know how much faster they would be in the emulator. [...]

Paradoxically, in a real device or emulator it could be a tie between your program and the one in the Master Library.

Indeed the same program will run faster if run from a module than from regular memory. I think it is because module programs are guaranteed, if coded correctly, to never run in an infinite loop, so there is no need to check for user input ("R/S") while they are running.

While coding RCL-57 I found out that the CPU spends a considerable amount of time checking for using input and updating the display (even when it doesn't change).
Find all posts by this user
Quote this message in a reply
05-21-2022, 03:37 PM
Post: #25
RE: RCL-57
(05-21-2022 02:13 PM)pauln Wrote:  Paradoxically, in a real device or emulator it could be a tie between your program and the one in the Master Library.

Btw, on the HP-41 we have the Clonix/NovRAM modules to emulate custom modules. Is there anything similar for the TI-58/59?
Find all posts by this user
Quote this message in a reply
05-21-2022, 03:46 PM
Post: #26
RE: RCL-57
I don't know if the "no infinite loop" is right or not about Master Libraries (although I don't ever recall hearing that there was one!).

But a big reason programs run faster from rom on the TI-58/59 than from ram is that the calculator converts the number that would be displayed to and from an internal state to a displayable state every time a step is executed in RAM just in case the R/S key is pressed.

While running in ROM it does not do this.

Once this was realized, the TI User Group (TI-PPC Notes has a lot of info on this), discovered how to initiate a "Fast Mode" where programs running in RAM will execute as if they were running from ROM instead.

At HHC 2015, I made a presentation on TI-Fast Mode:

HHC 2015 Fast Mode
Find all posts by this user
Quote this message in a reply
05-21-2022, 03:58 PM
Post: #27
RE: RCL-57
I'm sure your explanation is more accurate than mine : )

In fact, I just had a vague/fuzzy recollection from many years ago, possibly from your original website before it moved to rskey.org. I just found the current page:

https://www.rskey.org/gene/hpgene/fastmode.html

Thanks for the link to the video, I will definitely take a look.
Find all posts by this user
Quote this message in a reply
05-21-2022, 04:25 PM
Post: #28
RE: RCL-57
You were quite correct, however, that once in fast mode, R/S would not terminate a running program. If you mistakenly made an infinite loop... you had to use the ultimate R/S key.

The ON/OFF switch at the top. :-)
Find all posts by this user
Quote this message in a reply
05-23-2022, 07:39 AM
Post: #29
RE: RCL-57
(05-20-2022 01:06 PM)pauln Wrote:  Interesting. Did you use a different algorithm or did you optimize the implementation?

Both ;-)
- all routines use a single dot product routine at their core. the LU-decomp of the Master Lib uses a very badly written and slow axpy (y:=y+a*x) routine.
- pivotation vector is stored in a single register
- inversion is done solving U*X*L = I (so X= inv(A) ), making max. use of the innermost dot product routine. The Master Lib calculates the inverse as inv(U)*inv(L), in three separate steps, spending quite a bit more time in loop setup and control.
- only 640 steps (I simplified the interface a little bit as well). I do use some HIR registers (2 or 3), and of course the Opcodes to add or subtract 1 from a reg, which are not used in Pgm 02.

(05-21-2022 02:13 PM)pauln Wrote:  Paradoxically, in a real device or emulator it could be a tie between your program and the one in the Master Library.

Indeed the same program will run faster if run from a module than from regular memory. I think it is because module programs are guaranteed, if coded correctly, to never run in an infinite loop, so there is no need to check for user input ("R/S") while they are running.

Seeing that there's a factor 3 difference in LU factorisation, I'm hoping to be left with some speed improvement ;-)
But, on an emulator, I would not have both 100 registers and 960 program steps, I'm afraid, and so I would only be able to test small matrices (up to 5x5 I think), where the speed difference would not be so pronounced. Unless you can 'tweak' it a little.

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
05-24-2022, 02:29 AM (This post was last modified: 05-24-2022 02:30 AM by pauln.)
Post: #30
RE: RCL-57
(05-21-2022 03:37 PM)Didier Lachieze Wrote:  
(05-21-2022 02:13 PM)pauln Wrote:  Paradoxically, in a real device or emulator it could be a tie between your program and the one in the Master Library.

Btw, on the HP-41 we have the Clonix/NovRAM modules to emulate custom modules. Is there anything similar for the TI-58/59?

Not that I am aware of, but you may find this interesting:

http://www.datamath.org/Sci/WEDGE/PC-100_ModuleSel.htm
Find all posts by this user
Quote this message in a reply
05-24-2022, 03:06 AM (This post was last modified: 05-24-2022 04:16 AM by pauln.)
Post: #31
RE: RCL-57
(05-23-2022 07:39 AM)Werner Wrote:  Seeing that there's a factor 3 difference in LU factorisation, I'm hoping to be left with some speed improvement ;-)

Quite likely.

As a test, I just run, in an actual TI-59, the diagnostic program directly from the Master Library:

Code:
  Pgm 01 
  SBR =

It took 14.8 seconds.

Then I run the same program from memory:

Code:
  Pgm 01
  Op 09     # Loads current module program into memory
  RST       # Deselects module program
  SBR =

It took 16.7 seconds.

Not a huge difference. Even taking into account the fact that the diagnostic program uses, in part, subroutines from other module programs, I would expect the speedup (running from module vs running from memory) to be closer to 50% than 200%.
Find all posts by this user
Quote this message in a reply
05-24-2022, 11:31 AM
Post: #32
RE: RCL-57
Depends. Certain functions had no speed up at all. TRIG functions, for example, run at the same speed.
Find all posts by this user
Quote this message in a reply
05-24-2022, 03:27 PM (This post was last modified: 05-24-2022 03:50 PM by pauln.)
Post: #33
RE: RCL-57
Could it be that no instruction (whether "sin x" or "x^2") has any speedup at all, and that the speedup only occurs between instructions?

Since "sin x" is much slower than "x^2", it would appear that the sequence "sin x sin x" has no speedup percentage-wise (even if it has a little bit of speedup) while "x^2 x^2" has a significant amount of speedup.
Find all posts by this user
Quote this message in a reply
05-25-2022, 05:42 PM (This post was last modified: 05-25-2022 05:43 PM by Matt Agajanian.)
Post: #34
RE: RCL-57
A new thought came to my mind.

Two-variable stats would be best. So, rather than having 10 registers, two up from eight in the original TI-57, how about 15 or even 20 which will leave nine or 14 registers for the user since the stat registers are using six?
Find all posts by this user
Quote this message in a reply
06-04-2022, 03:02 AM (This post was last modified: 06-04-2022 05:54 AM by pauln.)
Post: #35
RE: RCL-57
(05-12-2022 04:37 PM)pauln Wrote:  [...] But a full biorhythm program seems beyond its capabilities. [...]

Actually it's possible! By the way, I forgot how much fun it can be to write programs within 50 steps.

The difficulty in this case is to find out the exact number of days between 2 dates in such limited space. The program works between 1901 and 2099 which should cover most of us...

Note though the following: this program expects the user to write dates for January and February using some special convention. In general dates are written as MM.DDYYYY but, for January, MM should be 13 and, for February, MM should be 14. Also for these 2 months, the year should be 1 less than the actual year.

Instructions:
  1. Key in the program
  2. 0.0001 STO 4
  3. 3652500 STO 5
  4. 30.6 STO 6
  5. Enter birthdate: MM.DDYYYY STO 1
  6. Enter today's date: MM.DDYYYY STO 2
  7. RST R/S
  8. 23 SBR 1 returns the physical score (scores are between -1 and 1)
  9. 28 SBR 1 returns the emotional score
  10. 33 SBR 1 returns the intellectual score


Code:

# Computes the number of days between Day 1 and Day 2.
# Result will be in register 3.
RCL 2 SBR 0                       # Numbers of days until Day 2
STO 3
RCL 1 STO 2 SBR 0.                # Numbers of days until Day 1
INV SUM 3
R/S

# Computes the biorhythm for a given period.
# Number of days since birth should be in register 3.
Lbl 1
/ RCL 3 / 360 = 1/x sin R/S

# Computes the number of days until some date.
# Input should be in Register 2 with format MM.DDYYYY.
Lbl 0
INT STO 7                    # R7 = MM
INV SUM 2
2 INV log Prd 2
RCL 2 Int
STO 0                        # R0 = DD
INV SUM 2                    # R2 = 0.YYYY
RCL 4 INV SUM 2
RCL 5 Prd 2
RCL 2 Int
SUM 0                        # Add the number of days in YYYY years
3 INV SUM 7
RCL 6 Prd 7
RCL 7 + .5 = INT
SUM 0                        # Add the number of days in MM months
RCL 0
INV SBR
Find all posts by this user
Quote this message in a reply
06-04-2022, 05:48 AM
Post: #36
RE: RCL-57
A little perplexed by the 3 INV 7 line. What does that do? What’s the RPN equivalent?
Find all posts by this user
Quote this message in a reply
06-04-2022, 05:56 AM
Post: #37
RE: RCL-57
(06-04-2022 05:48 AM)Matt Agajanian Wrote:  A little perplexed by the 3 INV 7 line. What does that do? What’s the RPN equivalent?

Thanks for catching the typo! It should have been "3 INV SUM 7". Fixed.
Find all posts by this user
Quote this message in a reply
06-04-2022, 10:54 PM
Post: #38
RE: RCL-57
(06-04-2022 05:56 AM)pauln Wrote:  
(06-04-2022 05:48 AM)Matt Agajanian Wrote:  A little perplexed by the 3 INV 7 line. What does that do? What’s the RPN equivalent?

Thanks for catching the typo! It should have been "3 INV SUM 7". Fixed.

Ah! That makes perfect sense.
Find all posts by this user
Quote this message in a reply
06-12-2022, 06:48 AM
Post: #39
RE: RCL-57
New alpha/beta version of RCL-57. Same link: https://testflight.apple.com/join/FxfbbK0s

I have added a few fun programs. Make sure to play Lunar Lander!

See attached screenshot for the list of programs.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
06-12-2022, 10:05 AM
Post: #40
RE: RCL-57
(06-12-2022 06:48 AM)pauln Wrote:  Make sure to play Lunar Lander!

Is it the one from French magazine "l'Ordinateur de Poche"?
It has a bit of boring solution for a perfect landing.

Here's an online emulator: TI-57 Programmable Calculator
Find all posts by this user
Quote this message in a reply
Post Reply 




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