HP Forums
Plus42 Equations, Preview Release - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Plus42 Equations, Preview Release (/thread-17724.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 11:32 AM

It is not THAT wrong, it is a sign issue, more a philosophical thing, do you make money or pay some.
If you know what you are doing and how to interpret the results, then both ways are fine.


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-17-2022 11:39 AM

(06-17-2022 08:59 AM)Vincent Weber Wrote:  One small difference though, if you set up the amortization table parameters (FIRST, LAST, INC), and exit TVM app and come back, these parameters are gone in both Plus42 and the HP-27S, but on Plus42 the number of payments is reset to 0, whereas on the 27S it is reset to 1, hence you get something (1 entry) if you press "GO".

Thomas, is this intended ?

No, that sounds like a bug.


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-17-2022 11:44 AM

(06-17-2022 10:49 AM)jonmoore Wrote:  The assumption that I would question is that HP is wrong. TVM calculations on the 12C have been proven to be robust by multiple institutions and individuals (within the confines of the calculator's precision).

HP wouldn't continue to sell the 12C 40 years down the line if it had mission-critical errors.

I'd say it's more of a "don't care" kind of thing. The sign change refers to a situation where, after having repaid a loan in full, you keep on paying, and you continue to use the same interest rate on the surplus as on the debt. Since the situation is nonsensical, I assume it doesn't really matter whether you calculate it like the 17B does, or like Plus42. I merely went with the simplest approach, but I'm prepared to reconsider if this approach causes problems in practice.


RE: Plus42 Equations, Preview Release - jonmoore - 06-17-2022 12:09 PM

(06-17-2022 11:44 AM)Thomas Okken Wrote:  
(06-17-2022 10:49 AM)jonmoore Wrote:  The assumption that I would question is that HP is wrong. TVM calculations on the 12C have been proven to be robust by multiple institutions and individuals (within the confines of the calculator's precision).

HP wouldn't continue to sell the 12C 40 years down the line if it had mission-critical errors.

I'd say it's more of a "don't care" kind of thing. The sign change refers to a situation where, after having repaid a loan in full, you keep on paying, and you continue to use the same interest rate on the surplus as on the debt. Since the situation is nonsensical, I assume it doesn't really matter whether you calculate it like the 17B does, or like Plus42. I merely went with the simplest approach, but I'm prepared to reconsider if this approach causes problems in practice.

And it sounds like a reasonable approach to me, especially seeing as we're talking about a nonsensical situation.


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 12:39 PM

(06-17-2022 11:39 AM)Thomas Okken Wrote:  No, that sounds like a bug.

Ok, thanks.
Also, small thing, while printing the HP-27S displays the header on what is printed on the LCD screen (like #P=1 PMTS: 1-12 or 13-24, it evolves with the printing), whereas Plus42 prints noting on the LCD, only on the printer.

Cheers


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-17-2022 01:12 PM

(06-17-2022 11:39 AM)Thomas Okken Wrote:  
(06-17-2022 08:59 AM)Vincent Weber Wrote:  One small difference though, if you set up the amortization table parameters (FIRST, LAST, INC), and exit TVM app and come back, these parameters are gone in both Plus42 and the HP-27S, but on Plus42 the number of payments is reset to 0, whereas on the 27S it is reset to 1, hence you get something (1 entry) if you press "GO".

Thomas, is this intended ?

No, that sounds like a bug.

I think I spoke too soon. I just tried this, and I don't see how Plus42 behaves differently from the 27S when leaving and re-entering AMORT. Could you elaborate?


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 01:27 PM

(06-17-2022 01:12 PM)Thomas Okken Wrote:  
(06-17-2022 11:39 AM)Thomas Okken Wrote:  No, that sounds like a bug.

I think I spoke too soon. I just tried this, and I don't see how Plus42 behaves differently from the 27S when leaving and re-entering AMORT. Could you elaborate?
-Take the example above, from Ajaja.
-Go to AMORT, TABLE, key in 1 for FIRST, 36 for LAST, 12 for INCR, GO.
-In both cases, what needs to be done is done (but not on the LCD on Plus42, see my previous message);
-Now press EXIT twice, you are back to the TVM menu (second page with P/YR), choose AMORT gain.
- Plus 42 says "#P=1 PMTS: 0-0". Pressing TABLE and GO just prints the variables, no payment;
- The HP-27S prints one paiement (1-1) and only then (why not before ?) says: "#P1=1 PMTS:1-1"


RE: Plus42 Equations, Preview Release - Albert Chan - 06-17-2022 03:09 PM

(06-17-2022 11:32 AM)Vincent Weber Wrote:  It is not THAT wrong, it is a sign issue, more a philosophical thing, do you make money or pay some.
If you know what you are doing and how to interpret the results, then both ways are fine.

Sign is important !

Some situations, even signed zero is important !
Much Ado About Nothing's Sign Bit, by W. Kahan

With the right sign, if we follow the math, we get the right answer.
And, it signal problems, without extensive "intepretation"

Doing the same amortization problem on TI BA-35 Solar (loan-convention)

PMT 01-12: ΣINT = 756.35, ΣPRN = 5413.33
PMT 13-24: ΣINT = 189.50, ΣPRN = 5980.18
PMT 25-36: ΣINT = -436.70, ΣPRN = 6606.38

Every year, ΣINT + ΣPRN = 12*PMT = 12*514.14 = 6169.68


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 03:43 PM

(06-17-2022 03:09 PM)Albert Chan Wrote:  
(06-17-2022 11:32 AM)Vincent Weber Wrote:  It is not THAT wrong, it is a sign issue, more a philosophical thing, do you make money or pay some.
If you know what you are doing and how to interpret the results, then both ways are fine.

Sign is important !

Some situations, even signed zero is important !
Much Ado About Nothing's Sign Bit, by W. Kahan

With the right sign, if we follow the math, we get the right answer.
And, it signal problems, without extensive "intepretation"

Doing the same amortization problem on TI BA-35 Solar (loan-convention)

PMT 01-12: ΣINT = 756.35, ΣPRN = 5413.33
PMT 13-24: ΣINT = 189.50, ΣPRN = 5980.18
PMT 25-36: ΣINT = -436.70, ΣPRN = 6606.38

Every year, ΣINT + ΣPRN = 12*PMT = 12*514.14 = 6169.68
I 100% agree with you on all counts. That's why when discussing with Thomas during the TVM implementation, I advocated his way, not HP's Smile


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-17-2022 04:53 PM

(06-17-2022 01:27 PM)Vincent Weber Wrote:  -Take the example above, from Ajaja.
-Go to AMORT, TABLE, key in 1 for FIRST, 36 for LAST, 12 for INCR, GO.
-In both cases, what needs to be done is done (but not on the LCD on Plus42, see my previous message);
-Now press EXIT twice, you are back to the TVM menu (second page with P/YR), choose AMORT gain.
- Plus 42 says "#P=1 PMTS: 0-0". Pressing TABLE and GO just prints the variables, no payment;
- The HP-27S prints one paiement (1-1) and only then (why not before ?) says: "#P1=1 PMTS:1-1"

So, in other words, the 27S TABLE menu has defaults FIRST=LAST=INCR=1?

(Plus42 has FIRST=LAST=INCR=0 initially, which is why it doesn't print anything after the header, if you just press GO without setting any parameters.)


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 04:59 PM

(06-17-2022 04:53 PM)Thomas Okken Wrote:  
(06-17-2022 01:27 PM)Vincent Weber Wrote:  -Take the example above, from Ajaja.
-Go to AMORT, TABLE, key in 1 for FIRST, 36 for LAST, 12 for INCR, GO.
-In both cases, what needs to be done is done (but not on the LCD on Plus42, see my previous message);
-Now press EXIT twice, you are back to the TVM menu (second page with P/YR), choose AMORT gain.
- Plus 42 says "#P=1 PMTS: 0-0". Pressing TABLE and GO just prints the variables, no payment;
- The HP-27S prints one paiement (1-1) and only then (why not before ?) says: "#P1=1 PMTS:1-1"

So, in other words, the 27S TABLE menu has defaults FIRST=LAST=INCR=1?

(Plus42 has FIRST=LAST=INCR=0 initially, which is why it doesn't print anything after the header, if you just press GO without setting any parameters.)
Yes.
I think it would actually make more sense to have defaults = previous values, memorize them as long as the TVM variables have not changed, but it seems that it is not how the 27S/17B work.
This is also this issue of printing on the LCD some info about the current set of payments being printed on the printer...


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-17-2022 06:12 PM

(06-17-2022 04:59 PM)Vincent Weber Wrote:  
(06-17-2022 04:53 PM)Thomas Okken Wrote:  So, in other words, the 27S TABLE menu has defaults FIRST=LAST=INCR=1?

(Plus42 has FIRST=LAST=INCR=0 initially, which is why it doesn't print anything after the header, if you just press GO without setting any parameters.)
Yes.

OK, I'll change those defaults to match the original calculator. Setting everything to 0 initially really isn't a very good choice.

(06-17-2022 04:59 PM)Vincent Weber Wrote:  This is also this issue of printing on the LCD some info about the current set of payments being printed on the printer...

I don't think that's useful, given that Plus42 will calculate and print any realistic amortization table in a fraction of a second.


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-17-2022 06:19 PM

Agreed - I was just mentioning that out of compatibility purity.


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-19-2022 05:54 AM

Thanks Thomas for correcting the default number of payments.
Just one thing, when you click AMORT, Plus42 displays some initial infos, starting with #P=1 PMTS :0-0. Shouldn't it be 1-1 instead ?


RE: Plus42 Equations, Preview Release - Thomas Okken - 06-19-2022 07:57 AM

No, because that's before any payments have been made.


RE: Plus42 Equations, Preview Release - Vincent Weber - 06-19-2022 07:59 AM

Ok, thanks.


RE: Plus42 Equations, Preview Release - Ajaja - 06-19-2022 11:55 AM

Plus42 v1.0.8
Something weird is happening with SGN() function in EQN mode.
Looks like it takes the stack value as the argument instead of the value in ():
Code:
  EQNSLV 'T(X):X+SGN(1)'
            0.00 STO "X"
   EVALN 'T(X):X+SGN(1)'
                     PRX
             0.00    ***
            1.00 STO "X"
   EVALN 'T(X):X+SGN(1)'
                     PRX
             2.00    ***
           -1.00 STO "X"
   EVALN 'T(X):X+SGN(1)'
                     PRX
            -2.00    ***



RE: Plus42 Equations, Preview Release - Thomas Okken - 06-19-2022 12:48 PM

Confirmed. The code for the parameter of SGN() is not being generated.

I uploaded 1.0.9 with a fix for this bug. Note that the fix will not fix the incorrect generated code; you'll have to re-parse all equations containing SGN() calls in order to get them to behave correctly.


RE: Plus42 Equations, Preview Release - Ajaja - 06-19-2022 03:53 PM

Thank you!


RE: Plus42 Equations, Preview Release - Ajaja - 06-19-2022 09:53 PM

I wonder, maybe SIZE command should create new REGS only in current directory and do not affect REGS in HOME?
For example, I create a sub-directory SANDBOX with its own REGS, work here, and then [accidentally] run some programm with CLV "REGS" and SIZE xxxx commands that currently deletes REGS in my SANDBOX directory and changes REGS in HOME. That's not good.
What do you think?