RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
|
11-22-2023, 05:18 PM
Post: #21
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
Firstly - GreatWork!!! - to have our favorite machines work on readily available hardware.
My comments/wishes: 1. Complex Number Support 2. Keystroke programming (like 42) 3. More data memory (I regularly use 100 complex registers on my DM42). 4. Support for the 84'C' type machines (I've come to enjoy these backlit displays). Thanks again for your fine work, TomC +++++++++++++++++++++++++++++++++++++++++ (11-22-2023 02:43 AM)bxparks Wrote:(11-21-2023 10:02 PM)floppy Wrote: Ouch. Perhaps you just signed the death of my HP35S (no exchange with PC possible with that weird one). Now the TI84+ is on my amazon list. In few days will probably make its way to me. Then after install/test probably bye bye HP35S via eBay. |
|||
11-22-2023, 05:21 PM
Post: #22
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 05:43 AM)Gerald H Wrote: My own preference is the 83+SE - awfully elegant. The 84+SE is merely greyish & looks much bulkier although it in fact weighs less. That's true, the 83+SE is a better looking than the 84+SE. I prefer the perfectly straight, no-nonsense grid layout of its keys, versus the new-age-weird-artsy-curvy key layout of the 84+SE. And you are right, it is slightly smaller as well, which I hadn't notice before, probably because they are both pretty large compared to my HP calculators. The problem I had with the 83+SE is that it uses a translucent, whitish plastic. From the photos on eBay, the contrast between the light Yellow (2ND) and light Green (ALPHA) key labels and the translucent plastic seemed terrible. As my eyes have grown older, I cannot read such small letters with such low contrast. It turns out that TI created another hardware version of the 83+SE, which in their infinite wisdom, is called the exactly the same thing, the "83 Plus Silver Edition" (so I have no idea what it is actually called). This variant has a black plastic background, and I find the key labels to be far more readable. This variant is targeted towards teachers. It has an extra video port on the back to allow the the calculator screen to be projected with a special video projector. The problem with this model, as I discovered after my purchase, is that the humpback video port makes the calculator feel bulky. The 84+/84+SE does have a few advantages over the 83+/83+SE though. One of them is that the 84+/84+SE has a USB-mini-B port in addition to the traditional 2.5mm serial port. So in theory, you don't need to buy that proprietary USB-to-serial cable from TI. |
|||
11-22-2023, 05:33 PM
(This post was last modified: 11-22-2023 05:35 PM by bxparks.)
Post: #23
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 01:32 PM)floppy Wrote: TI 84 PLUS (Wow that German Amazon website is painful to use. Captcha. Cookie authorization taking up 1/2 my screen, which can't be dismissed...) The first one is a custom TI USB-to-serial cable that plugs into the 2.5mm port on many of the older TI graphing calculators, including the 83+, 83+SE, 84+, 84+SE that the RPN83P is compatible with. Don't buy it new, you should be able get it on eBay for $10-15. The second one is a standard USB-A to USB-mini-B cable. That works for the 84+ and 84+SE which also have a mini-USB-B port. Many people have a lot of these cables already. If you don't, you should be able to get one from a thrift store for like $1 (or the equivalent in Euros). |
|||
11-22-2023, 06:11 PM
(This post was last modified: 11-22-2023 06:21 PM by bxparks.)
Post: #24
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 03:53 PM)Thomas Klemm Wrote: I noticed the link while reading the source code of lnOnePlus in float.asm. The "faster than above" is a slight typo, it should be "faster than below". I had flipped the order of the 2 implementations without updating the comments. The LOG1P_USING_LOG macro is now undefined by default, so the code selects the asinh() version. Hopefully that was clear from the context. I have updated the comments, and added this new comment at the top of the function: Quote:; Description: Calculate ln(1+x) such that it is less susceptible from So I think the x*ln(x)/((1+x)-1) *did* work for the TI calculators. But since I did not understand the explanation given in the math.stackexchange.com link about *why* it worked, I could not be sure that it worked for *all* ranges of numbers. The comment about not working on certain computers came from another source that has this formula, but I cannot remember what that other source was. (Maybe it was one of the old HP-15C or HP-34C solutions book.) Instead, I decided to use the asinh() version because I actually understand it. It's a mathematical identity, which I was able to re-derive. And as long as I used the expression which was less susceptible to numerical errors for x->0, that is log(1+x)=asinh((x/2)(1+1/(1+x))), I could depend on it. [Edit: Also added a stronger comment that the identity holds only for (1+x)>0, and this condition must be checked in the code. Because for (1+x)<0, the asinh() expression returns a value, but log(1+x) must throw an exception.] |
|||
11-22-2023, 06:54 PM
(This post was last modified: 11-22-2023 07:25 PM by bxparks.)
Post: #25
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 05:18 PM)TomC Wrote: Firstly - GreatWork!!! - to have our favorite machines work on readily available hardware. Thanks! (1) and (2) and many others are already in the future enhancements section in the USER_GUIDE.md. So many features, so little time. Part of the problem is that I'm finding Z80 assembly language programming to be about 1/3 as productive as C, and maybe 1/6 as productive as C++. Maybe that just means that I'm not a good assembly language programmer. It's a grind. Especially as the RPN83P application has become bigger, it takes more and more time to add new features, to make sure that I haven't broken everything else that has already been programmed. I am not aware of any way to do automated unit testing with assembly language programming. So all my testing has to be done manually. Very time consuming. I'm curious about your (3). I can give you 100 real registers easily right now. I chose to limit to 25, because that's the HP-42S default, and because I thought, "who would need more than 25 registers?" :-) Why do you need 100 *complex* registers? Some sort of EE/signal processing work? With regards to (4), are you talking about the 84+CSE, or the 84+CE? (The people who created the names for these calculators must have been on drugs. It is completely confusing.) The 84+CSE is a technological dead-end for TI calculators. I won't port to that. The 84+CE... maybe. Those use a different CPU (eZ80), a different screen, different development tools (probably). I hear there's a C compiler for it, no idea how good it is. But get this, the sizeof(int) on that compiler is 3 (not 2 or 4) because the eZ80 processor has 24-bit registers. What an adventure that would be. [Addendum: Another higher-level question would be: Why would you want to use the RPN83P app on a budget TI calculator instead of the DM42? The DM42 uses Free42 which is an awesome piece of software. The DM42 hardware, from all I hear, is also awesome. Seems like RPN83P would be a poor substitute.] |
|||
11-22-2023, 07:51 PM
Post: #26
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-21-2023 10:02 PM)floppy Wrote:(11-21-2023 09:26 PM)bxparks Wrote: Yes. There is a host app that runs on Windows (TI Connect), Mac (TI Connect) or Linux (TiLP2). It gives you a view of the contents of the calculator's memory that looks like a file system. You can drag-and-drop any app or variable from the calculator to the host. You can drag-and-drop those files from the host back to the calculator. Bear in mind that the current version of RPN83P is not (yet) programmable like HP calculators that inspired it. You can usually get used TI-84 Plus or Plus Silver Edition pretty cheap on eBay. I have a few. Also look out for the TI-84 Pocket Plus SE, which is quite nice and compact. — Ian Abbott |
|||
11-23-2023, 06:03 PM
Post: #27
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
"not (yet) programmable like HP calculators that inspired it."
got it. HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
11-24-2023, 07:54 PM
Post: #28
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 06:11 PM)bxparks Wrote: But since I did not understand the explanation given in the math.stackexchange.com link about *why* it worked, I could not be sure that it worked for *all* ranges of numbers. We can start with the geometric series for \(|q| < 1\): \[ \begin{align} \frac{1}{1-q} &= \sum_{k=0}^\infty q^k \\ &= 1 + q + q^2 + q^3 + q^4 + q^5 + \cdots \end{align} \] Substitute \(q = -x\) to get: \[ \begin{align} \frac{1}{1+x} &= 1 - x + x^2 - x^3 + x^4 - x^5 + \cdots \\ \end{align} \] Integrate both sides: \[ \begin{align} \int \frac{1}{1+x} \; \mathrm{d}x &= \log(1 + x) \\ &= x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5} - \frac{x^6}{6} + \cdots \\ \end{align} \] In the following I'm using the same definitions of \(x\), \(y\) and \(z\) as in your code. Example I assume we use a 10-digit calculator. x = 1.234509876e-5 y = 1 + x 1.000012345 z = y - 1 0.000012345 Due to cancellation we can't calculate \(\log(1+x)\) but calculate \(\log(1 + z)\) instead. Thus we get: \[ \begin{align} \log(1 + z) &= z - \frac{z^2}{2} + \frac{z^3}{3} - \frac{z^4}{4} + \frac{z^5}{5} - \frac{z^6}{6} + \cdots \\ &= z \cdot \left(1 - \frac{z}{2} + \frac{z^2}{3} - \frac{z^3}{4} + \frac{z^4}{5} - \frac{z^5}{6} + \cdots \right) \\ \end{align} \] We can improve the result by first dividing by \(z\) and then multiplying by \(x\): \[ \begin{align} \frac{x \cdot \log(1 + z)}{z} &= x \cdot \left(1 - \frac{z}{2} + \frac{z^2}{3} - \frac{z^3}{4} + \frac{z^4}{5} - \frac{z^5}{6} + \cdots \right) \\ &= x - \frac{xz}{2} + \frac{xz^2}{3} - \frac{xz^3}{4} + \frac{xz^4}{5} - \frac{xz^5}{6} + \cdots \\ \end{align} \] Now both series start with \(x - \cdots\) which is the dominant term if \(x\) is small. If \(x\) is very close to \(0\), that is \(z = 0\), we can ignore the higher order terms and just return \(x\). If \(|x| > 1\), then the cancellation is minuscule and thus \(x \approx z\). Therefore the factor \(\left | \frac{x}{z} \right | \approx 1\) and the multiplication doesn't change much. I could be wrong, but I don't see a case where the use of this trick would lead to a problem. |
|||
11-25-2023, 01:01 AM
Post: #29
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 03:53 PM)Thomas Klemm Wrote:(11-21-2023 06:00 PM)bxparks Wrote: ; This uses ln(1+x) = x * log(1+x) / ((1+x)-1). I think this algorithm is This was mentioned in Kahan's article, "How Futile are Mindless Assessments of Roundoff in Floating-Point Computation?", page 22 Kahan Wrote:For example, no spike should mar the graph of The quote is for log2, but that is just a scaling factor for log. My guess is code for log/log2 was bad, causing spikes in plots. Note that Kahan's formula is actually designed for ratio, log1p(x)/x (same article (page 19) have formula for expm1(x)/x, with similar idea) Let y=x+1., z=y-1., error ε = exact - approx = x-z log1p(x) = log(1+z+ε) = log(1+z) + log(1+ε/(1+z)) ≈ log(1+z) + ε/(1+z) x = z + ε If z is small, log(1+z) ≈ z, ε/(1+z) ≈ ε Numerator and Denominator has about same relative errors, cancelled each other out. --> log1p(x)/x ≈ log1p(z)/z = log(y)/(y-1) --> log1p(x) ≈ x * log(y)/(y-1) I prefer Dieter's formula, with slightly better accuracy: log1p(x) ≈ log(y) - (y-1-x)/y |
|||
11-27-2023, 08:18 PM
(This post was last modified: 11-28-2023 04:21 PM by bxparks.)
Post: #30
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-21-2023 10:58 PM)dm319 Wrote: Please do! I wrote a TVM solver for the DM42 (available here) specifically for NSTK mode. I suspect it may need a bit more work/optimising though as just managed to get a divide by 0 error putting in a really big N. As promised, I documented my equations and algorithms in the TVM.md document, and posted a summary of it in the recent TVM formula error in programming manual? thread. |
|||
11-29-2023, 10:00 PM
Post: #31
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-21-2023 05:24 PM)bxparks Wrote:(11-21-2023 09:26 AM)Gerald H Wrote: PRIM actually finds a factor, otherwise returning 1 for prime input. Good news. I made my app 2.5X faster on the 83+SE, 84+, and 84+SE models with almost no effort. So PRIM finishes the factorization of 65521*65521 in about 13 seconds instead of 33 seconds on these machines. It turns out these 3 later models use Z80 processors which can run at 2 speeds: 6 MHz or 15 MHz. But I didn't know that flash apps are configured to run at 6 MHz by default, for backwards compatibility with the original 83+ which can only run at 6 MHz. So I added a few lines of code to configure my app to run at 15 MHz, and bam, everything runs faster. I guess I didn't need to optimize my app so much. But in return, I now have an app that is perfectly usable on the oldest, slowest, and cheapest TI-83+ calculator. I bought one locally for $10 the other day, for testing purposes. I expected my app to run 2.5X slower, but it ran just fine. Which led me down this rabbit hole. |
|||
11-30-2023, 09:57 AM
Post: #32
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-29-2023 10:00 PM)bxparks Wrote: Good news. I made my app 2.5X faster on the 83+SE, 84+, and 84+SE models with almost no effort. So PRIM finishes the factorization of 65521*65521 in about 13 seconds instead of 33 seconds on these machines. It turns out these 3 later models use Z80 processors which can run at 2 speeds: 6 MHz or 15 MHz. But I didn't know that flash apps are configured to run at 6 MHz by default, for backwards compatibility with the original 83+ which can only run at 6 MHz. So I added a few lines of code to configure my app to run at 15 MHz, and bam, everything runs faster. I don't own TI calculators but I find very interesting this project anyway. Have you checked the battery consumption at 15 Mhz? If it's going to draw it quickly maybe you can do the frequency user selectable? |
|||
11-30-2023, 03:43 PM
(This post was last modified: 11-30-2023 03:56 PM by bxparks.)
Post: #33
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-30-2023 09:57 AM)ebs Wrote: Have you checked the battery consumption at 15 Mhz? If it's going to draw it quickly maybe you can do the frequency user selectable? I have not, but it would interesting (Though I'm having some difficulty imagining how I would build a contraption that could inject an ammeter into the circuit in the AAA battery compartment. A thin insulator with 2 conductors on either side, with metallic tabs?). My guess is that the battery consumption is not an issue because:
|
|||
11-30-2023, 09:11 PM
Post: #34
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
I received an TI 84 Plus from ebay (quite cheap HW: 40Eur). Will install Forth during Christmas time.
HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
12-01-2023, 03:47 PM
(This post was last modified: 12-01-2023 03:53 PM by goosnarrggh.)
Post: #35
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(11-22-2023 06:54 PM)bxparks Wrote: With regards to (4), are you talking about the 84+CSE, or the 84+CE? (The people who created the names for these calculators must have been on drugs. It is completely confusing.) The 84+CSE is a technological dead-end for TI calculators. I won't port to that. The 84+CE... maybe. Those use a different CPU (eZ80), a different screen, different development tools (probably). I hear there's a C compiler for it, no idea how good it is. But get this, the sizeof(int) on that compiler is 3 (not 2 or 4) because the eZ80 processor has 24-bit registers. What an adventure that would be. I gather that writing a community-driven freeware flash app for the 84+CE might be a dead end because TI has changed the signing algorithm for flash apps on that platform - I think the only viable path to distributing flash apps on that platform is to submit it to TI for commercial distribution. Still, it might be viable to distribute it as a program that is totally resident in RAM. Although, native compiled/assembled programs running from RAM are restricted if the user has the latest OS version for the 84+CE. They'd need to jailbreak to get past this restriction. Yes, there is at least one experimental fork of LLVM/clang with support for the eZ80. (And also the classic Z80 as part of the same fork.) Heck, the Z80 also had earlier C compilers as well, but to my knowledge none of them have been able to leverage the same kind of sophistication as you can get with LLVM. That being said, the Z80 architecture was never created with C-compatible calling conventions in mind, so it might be less efficient than what you could achieve coding assembly by hand. |
|||
12-01-2023, 07:20 PM
(This post was last modified: 12-01-2023 07:50 PM by bxparks.)
Post: #36
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
(12-01-2023 03:47 PM)goosnarrggh Wrote: I gather that writing a community-driven freeware flash app for the 84+CE might be a dead end because TI has changed the signing algorithm for flash apps on that platform - I think the only viable path to distributing flash apps on that platform is to submit it to TI for commercial distribution. There are several reasons why I hesitate to work on the TI84+CE platform, some of which you have described:
On the other hand, the 84+CE is appealing to me for the following reasons:
I believe you are quite correct about a Z80 being terrible for C calling conventions. Even in hand-coded assembly, I am constantly suffering from register starvation, then forced to juggle them around due to the non-orthogonal Z80 instruction set, and the stack is basically useless for local variables due to the lack of stack addressing modes. (I am forced to use stack-local variables a handful times in the RPN83P, but it is not pretty.) No idea if the eZ80 fixes any of that pain. |
|||
12-02-2023, 03:05 PM
Post: #37
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
Great work. It has given me a reason to insert batteries in my monochrome 84+ for the first time in a while.
|
|||
12-03-2023, 09:37 AM
(This post was last modified: 12-03-2023 10:21 AM by jthole.)
Post: #38
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
That is a great accomplishment, and the most extensive RPN implementation for the TI-calculators I have seen so far!
About keystroke programming; I agree that it wouldn't be really needed on the TI-8x Plus, since it already supports TI-Basic. But it would be really nice if I could XEQ a Basic program from within the RPN app. However, I understand that might be challenging to implement. I would love keystroke programming and a solver, but that is probably way more work than being able to call Basic programs. If I understand correctly, the register list variable can be manipulated from within a Basic program, so that these register values are available within the RPN app (would work both ways). 11C, 12C, 15C CE, 17Bii, DM42 |
|||
12-03-2023, 02:45 PM
Post: #39
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
I've just tried out version 0.7, but haven't tried earlier versions yet. I couldn't get the SHOW (2ND ENTRY) function to work. Perhaps it got broken on this version?
Minor suggestions:
— Ian Abbott |
|||
12-04-2023, 01:31 AM
Post: #40
|
|||
|
|||
RE: RPN83P: RPN calculator for TI-83+ TI-84+ inspired by HP-42S
If I didn't have a gray monochrome 84 Plus, I would have been an "excuse" to buy a white 84 Plus at Target. BTW, for those wanting to purchase an 84 Plus, there is a lot on sale used, almost no need to pay retail.
This is the best RPN application for the 84 Plus. I like the solid interface and how quickly and smoothly the app runs. One thing to note: I think the arguments for polar/rectangular conversions are "reversed" from most RPN calculators: Y-Stack: X or R X-Stack: Y or theta Examples (Degrees mode): -2 ENTER 11 >POL Expected: Y: -10.3048, X: 11.1803 Instead the results are: Y: 11.1803, X: 100.3048 30 ENTER 5 >REC Excepted: Y: 2.5000, X: 4.3301 Instead the results are: Y: 29.8858, X: 2.6147 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)