Page 3 of 3

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Wed Feb 27, 2019 9:25 pm
by Thomas Okken
whuyse wrote:
Wed Feb 13, 2019 9:18 am
Thomas Okken wrote:
Tue Feb 12, 2019 10:58 am
  • More accurate 2x2 matrix operations
  • More accurate dot product using FMA
Yes!!! As this is something the real 42S does, as well (albeit not with FMAs)
Cheers, Werner
Werner, do you know exactly which functions in the HP-42S use special-case logic for 2x2 matrices?

And what about higher-precision dot products? Obviously DOT, but matrix-matrix multiplication is essentially just a lot of dot products as well.

Just trying to get an idea of the scope of work that would be involved... I need something to keep me busy, now that I've worked off all of the original to-do list, maar het moet wel een beetje leuk blijven. :D

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Thu Feb 28, 2019 11:00 am
by whuyse
Thomas Okken wrote:
Wed Feb 27, 2019 9:25 pm
Werner, do you know exactly which functions in the HP-42S use special-case logic for 2x2 matrices?
I know DET does - it simply evaluates ab-cd in 15-digit precision. The others, I'll perform some tests.
Thomas Okken wrote:
Wed Feb 27, 2019 9:25 pm
And what about higher-precision dot products? Obviously DOT, but matrix-matrix multiplication is essentially just a lot of dot products as well.
Well, everywhere a dot product is used..
FNRM, UVEC (which calls FNRM)
everything using LU-decomp (/, INVRT, DET)
and of course the rest of the algorithms:
- the determinant is probably kept in a 15-digit register for accumulation.
- Lx = B and Ux = B in /
- I have no idea what algorithm the 42S uses for INVRT, probably A=LU and then AINV = UINV*LINV as that can be done entirely in-place. For Free42, it is probably easier to do UXL, which calculates the inverse from the LU decomp in a single loop at the expense of 1 work vector, and makes maximum use of dot products. (yes I know pivoting is involved but that doesn't change the base algorithm)

RNRM and RSUM will use extended precision for adding up the values in one row, of course.

And I know nothing of CROSS, I'm afraid to admit.
Thomas Okken wrote:
Wed Feb 27, 2019 9:25 pm
Just trying to get an idea of the scope of work that would be involved... I need something to keep me busy, now that I've worked off all of the original to-do list, maar het moet wel een beetje leuk blijven. :D
Nou voor mij is dit leuk ;-)
To me, this is fun ;-)
Actually, I attach far more significance to the accuracy obtained (using intermediate extended precision, I.a.) than having 34 digits. But then I majored in Numerical Analysis, ages (too long) ago.

Cheers, Werner

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Thu Feb 28, 2019 12:16 pm
by Thomas Okken
whuyse wrote:
Thu Feb 28, 2019 11:00 am
I attach far more significance to the accuracy obtained (using intermediate extended precision, I.a.) than having 34 digits. But then I majored in Numerical Analysis, ages (too long) ago.
Extended precision is not really an option, since I'm already using the highest-precision format supported by the Intel library... But it seems to me that it's better to use maximum precision throughout anyway, and never round to anything less than that, at least as long as storage is not an issue.

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Thu Feb 28, 2019 2:11 pm
by whuyse
We spoke of this before, can't remember whether it was here or at the hpmuseum.
There is a way to use FMAs to implement dot products, and obtain a result that is as accurate as if you used double precision.
I'll see if I can find it again,
Werner

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Thu Feb 28, 2019 2:19 pm
by Thomas Okken
I think you're referring to this thread: http://www.hpmuseum.org/forum/thread-10 ... A#pid95201

My question in my second-to-last post in this thread was about where to apply this algorithm. Another question that just occurred to me: is this for real dot products only, or does this apply to the complex case as well?

My previous post was about the desirability of extended precision, but that's a separate (and, because of the limitations of the Intel library, academic) question.

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Thu Feb 28, 2019 2:36 pm
by whuyse
in my second-to-last post, 'extended precision' was but an example ;-) - that's why I said 'i.a.' - it's the resulting accuracy that counts.
And yes, all of that applies to the complex case as well. A DOT product of 2 complex vectors is obtained using 4 real dot products.
Cheers, Werner

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Fri Mar 01, 2019 12:43 am
by Thomas Okken
I have only skimmed the two articles in that MoHPC thread, but it seems to me that the techniques described there could be applied in many places, including most matrix functions and also in complex multiplication. The scope of this appears to grow larger the more I think about it.

This is starting to look like something I'd rather not get into -- too much work, and a bit outside of my mathematical comfort zone as well.

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Fri Mar 01, 2019 7:55 pm
by toml_12953
zeno333 wrote:
Tue Feb 12, 2019 12:36 am
An up to dat DM42 is a better DM42 :)
I'd rather have the 2.024 update! :lol:

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Fri Mar 01, 2019 8:39 pm
by Thomas Okken
toml_12953 wrote:
Fri Mar 01, 2019 7:55 pm
zeno333 wrote:
Tue Feb 12, 2019 12:36 am
An up to dat DM42 is a better DM42 :)
I'd rather have the 2.024 update! :lol:
None of the updates since 2.0.23, up to and including the current one, 2.0.24d, contain anything that's relevant to the DM42, though, so you're not likely to get anything newer than 2.0.23 any time soon...

Re: Looking forward to the DM42 update utilizing the Free42 2.023 update...

Posted: Fri Mar 01, 2019 11:58 pm
by toml_12953
Thomas Okken wrote:
Fri Mar 01, 2019 8:39 pm
toml_12953 wrote:
Fri Mar 01, 2019 7:55 pm
zeno333 wrote:
Tue Feb 12, 2019 12:36 am
An up to dat DM42 is a better DM42 :)
I'd rather have the 2.024 update! :lol:
None of the updates since 2.0.23, up to and including the current one, 2.0.24d, contain anything that's relevant to the DM42, though, so you're not likely to get anything newer than 2.0.23 any time soon...
I hope you saw the LOL emoji that lets people know I was kidding!