Collection of functions for DM42/Free42 (updated on 2021-02-23)

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by salvomic »

ok,
I followed your instructions, but I got always the strange number -1734.7235...
FF = 1/(1+x)
point=3, order=2

with Free42s 2.25 in macOS 11

Salvo
Schermata 2021-02-22 alle 22.30.22.jpg
Schermata 2021-02-22 alle 22.30.22.jpg (164.56 KiB) Viewed 2665 times
::
EDIT Found! (this could be interesting for Thomas)
The problem is the "Binary" version instead of "Decimal" one (in Big Sur).
In "Decimal" the results is correct, in Binary not.
Schermata 2021-02-22 alle 22.30.22.jpg
Schermata 2021-02-22 alle 22.30.22.jpg (164.56 KiB) Viewed 2665 times
Attachments
Schermata 2021-02-22 alle 22.39.23.jpg
Schermata 2021-02-22 alle 22.39.23.jpg (153.92 KiB) Viewed 2664 times
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
ferni123
Posts: 36
Joined: Tue Aug 08, 2017 11:24 am

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by ferni123 »

Weird, I think that the function is not correctly imported.

In Free42, you do not need to remove the comments. They are silently ignored in the importing process. After importing the file, using the paste function, the program is 1125 bytes and the END line is numbered with 337.
ferni123
Posts: 36
Joined: Tue Aug 08, 2017 11:24 am

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by ferni123 »

Ah! Of course, I am pushing the differential to the limit! The binary version does not have such accuracy.

I am using differentials that can be 1e-20, the binary version does not have that accuracy.

Mystery solved!
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by salvomic »

Then it works well also your new version for Free42 2.25 (full interactive menu), but always with "Decimal" app.
Thomas warned, indeed:
«This inexactness can cause some HP-42S programs to fail.
...
If you don't fully understand the above, it is best to play safe and use
Free42 Decimal»

This is one of the cases in which "Binary" fails.

Salvo
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by Thomas Okken »

I just released 3.0, so PGMMENU is official now.
(And the big stack, but that's a different topic!)
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by Thomas Okken »

salvomic wrote:
Mon Feb 22, 2021 10:50 pm
Then it works well also your new version for Free42 2.25 (full interactive menu), but always with "Decimal" app.
Thomas warned, indeed:
«This inexactness can cause some HP-42S programs to fail.
...
If you don't fully understand the above, it is best to play safe and use
Free42 Decimal»

This is one of the cases in which "Binary" fails.
That's a different problem, actually. The warning about Free42 Binary has to do with the fact that negative powers of 10 are inexact in binary, which causes problems for programs that try to extract specific digits from fractions. For example, a function like HMS+ is difficult to implement in binary.

The problem in this thread appears to be due to insufficient precision, and that is a different issue. A problem for which the 53-bit mantissa used by Free42 Binary is insufficient, will likely also fail on the real HP-42S, with its 12-digit mantissa.
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by salvomic »

Thomas Okken wrote:
Tue Feb 23, 2021 1:52 pm
The problem in this thread appears to be due to insufficient precision, and that is a different issue. A problem for which the 53-bit mantissa used by Free42 Binary is insufficient, will likely also fail on the real HP-42S, with its 12-digit mantissa.
Thanks Thomas,
I didn't know that.

Salvo
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-22)

Post by salvomic »

just updated Free42 3.0 (iOS)!
Thanks Thomas :)
All the suite of Fernando (new version) seems to be ok there, at least DERIV is ok, and with the interactive menu more friendly.

Salvo

PS: now I would be curious to test it into a new version of FW (compatible with Free42 3.0) in DM42 too, soon :)
Last edited by salvomic on Tue Feb 23, 2021 8:01 pm, edited 1 time in total.
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
ferni123
Posts: 36
Joined: Tue Aug 08, 2017 11:24 am

Re: Collection of functions for DM42/Free42 (updated on 2021-02-23)

Post by ferni123 »

Thanks for the notification Thomas. I have just added again the PGMMENU in the programs of my repository.

@Salvo, I have seen that you say that "DERIV is almost OK". Have you seen any problem in the program?
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Collection of functions for DM42/Free42 (updated on 2021-02-23)

Post by salvomic »

ferni123 wrote:
Tue Feb 23, 2021 7:46 pm

@Salvo, I have seen that you say that "DERIV is almost OK". Have you seen any problem in the program?
No, Fernando, I wrote wrongly (now I corrected): DERIV *at least* is ok :)
The interactive version is very friendly.

Salvo
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
Post Reply