WP43 Bug Reports and Maintenance

This area is for discussion about these families of custom high-end Scientific Calculator applications for SwissMicros devices.
User avatar
pauli
Posts: 251
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: 43S Bug Reports and Maintenance

Post by pauli »

The immediate large difference is the maths library used. DM42 uses Intel's decimal library, the WP uses the decNumber library + lots of additions. Intel's library is much faster but larger. It also occasionally rounds incorrectly in the last place for some functions.
dlachieze
Posts: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: 43S Bug Reports and Maintenance

Post by dlachieze »

pauli wrote:
Mon Dec 12, 2022 3:00 am
The immediate large difference is the maths library used.
To verify the influence of the math library on the execution time I’ve tested the following program on the WP43 and the DM42. It’s essentially a loop on the SIN instruction executed 10000 times on the same value.

Code: Select all

01 LBL "Speed"
02 1E4
03 PI
04 6.3
05 /
06 STO ST L
07 LBL 01
08 X<> ST L
09 SIN
10 DSE ST Y
11 GTO 01
12 END
Execution time battery powered:
DM42: 13"
WP43: 7’34"

The WP43 is 35 times slower than the DM42 !

Here we have only 5 instructions in the loop: one label, 2 stack instructions, a trigonometric instruction and a branch instruction. So either it’s the SIN calculation with the DecNumber library that is 35 times slower than with the Intel library or it’s the GTO that takes ages to find the label.

To identify the culprit I’ve replaced the instruction SIN at step 09 by x^2 and the execution times are:

DM42: 8"
WP43: 11"

Now the execution times between the WP43 and the DM42 are much more closer.
So the huge speed difference in the Hat and Speed programs between the DM42 and the WP43 is clearly due to the difference in the trigonometric functions execution time between the DecNumber library used on the WP43 and the Intel decimal library used on the DM42.
DM42: 00425 - DM41X: β00066 - WP43: 00042
User avatar
pauli
Posts: 251
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: 43S Bug Reports and Maintenance

Post by pauli »

It's not the decNumber library. I wrote the SIN function, so it's my fault.

Intel's library trades space for time with large lookup tables and it uses binary floating point operations to seed the decimal ones (e.g. provide a first estimate which is then refined), effectively including a second maths library.

The WP 34S didn't have space for such niceties, so other approaches had to be taken.


Pauli
dlachieze
Posts: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: 43S Bug Reports and Maintenance

Post by dlachieze »

Good to know the reason of this performance difference. Should we expect a similar lack of speed on other math functions on the WP43?
DM42: 00425 - DM41X: β00066 - WP43: 00042
burkhard
Posts: 43
Joined: Fri Mar 16, 2018 10:15 pm

Re: 43S Bug Reports and Maintenance

Post by burkhard »

pauli wrote:
Tue Dec 13, 2022 1:36 am
The WP 34S didn't have space for such niceties, so other approaches had to be taken.
And presently WP43 is using the routines originally written for the WP34S?
So, are there still similar space constraints with the WP43, or "no, but these things haven't been optimized for WP43 yet".
Or something else?
Thanks!
Panchdara
Posts: 148
Joined: Sat May 15, 2021 9:02 am

Re: 43S Bug Reports and Maintenance

Post by Panchdara »

pauli wrote:
Tue Dec 13, 2022 1:36 am
... so it's my fault.
You realize, you'd make a terrible, terrible politician! 👍
rprosperi
Posts: 1698
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: 43S Bug Reports and Maintenance

Post by rprosperi »

Panchdara wrote:
Tue Dec 13, 2022 10:23 pm
pauli wrote:
Tue Dec 13, 2022 1:36 am
... so it's my fault.
You realize, you'd make a terrible, terrible politician! 👍
Yeah, but I'd vote for him :!:
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
User avatar
pauli
Posts: 251
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: 43S Bug Reports and Maintenance

Post by pauli »

burkhard wrote:
Tue Dec 13, 2022 9:36 pm
And presently WP43 is using the routines originally written for the WP34S?
Yes, for the most part.

So, are there still similar space constraints with the WP43, or "no, but these things haven't been optimized for WP43 yet".
No, there aren't the same space constraints and there hasn't been any optimisation.
Or something else?
It needs someone to step forward and improve the implementation without losing accuracy.
Feel free to be the volunteer if you feel strongly about the performance.
User avatar
pauli
Posts: 251
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: 43S Bug Reports and Maintenance

Post by pauli »

dlachieze wrote:
Tue Dec 13, 2022 9:01 pm
Should we expect a similar lack of speed on other math functions on the WP43?
It depends on the function. Some are relatively fast, others aren't.
User avatar
pauli
Posts: 251
Joined: Tue May 02, 2017 10:11 am
Location: Australia

Re: 43S Bug Reports and Maintenance

Post by pauli »

Panchdara wrote:
Tue Dec 13, 2022 10:23 pm
You realize, you'd make a terrible, terrible politician! 👍
That's the best compliment I've had in a long time :)
Post Reply