06-03-2020, 06:35 PM

The Math ROM 1A has a weakness related to the internal 15-digit summation operation used in matrix operations.

The issue is that the Math ROM is using a 15-digit truncating addition for the internal summation with a final 12-digit rounding, instead of rounding each addition result.

I already mentioned the problem in another thread, but here is a more demonstrative example:

Computing DOT([-10000 (1/3) 10000],[1 1 1]):

> DIM X(3),Y(3) (assuming OPTION BASE 1)

> MAT INPUT X

X(1)? -10000,1/3,10000

> MAT Y=(1)

> DOT(X,Y)

This operation computes (-10000)+(1/3)+(10000) with 15 digits

and should return .33333333333 if correctly rounded, as do the HP-28S and the HP-42S,

but the Math ROM 1A is returning .33333333334 .

This weakness is causing the HP-71B Math ROM 1A to deliver answers that may be slightly different from later Saturn-based machines for several matrix operations using summations such as dot product, norms, matrix product and inversion, determinant and system solving.

For example, computing the determinant of the matrix [[69 58 96][51 43 71][32 55 54]]:

> DIM A(3,3)

> MAT INPUT A

A(1,1)? 69,58,96

A(2,1)? 51,43,71

A(3,1)? 32,55,54

> DET(A)

The operation returns 1.00000038313 on the HP-71B with Math ROM 1A.

The 28S , 42S return 1.00000038333 instead.

This is even more visible on the very ill-conditioned matrices built some years ago by Valentin Albillo (see his great article here).

For instance with the AM1 matrix:

Det = .970950561960 on the HP-71B Math ROM 1A,

Det = .970960198039 on the HP-28S, 42S.

I don't consider this weakness as a bug since the HP-71B results are not particularly wrong (in the sense of: not worst than the 28S/42S - the exact determinants of the above examples are 1), but the Math ROM 1A is not always consistent with later machines.

The weakness was probably identified quite early by HP, because the 1987 HP-28C (first scientific RPL machine) correctly manages the rounded 15-digit summations, at a time when the HP-71B and its Math ROM were still in production.

Unfortunately, the HP-71B Math ROM has never been updated, ... until today :-)

I'm particularly pleased to have solved the issue in the latest version of the new "Math Pac 2", now giving *exactly* the same results than the HP-28S and 42S, and moreover very happy to know what was the source of the discrepancy.

J-F

The issue is that the Math ROM is using a 15-digit truncating addition for the internal summation with a final 12-digit rounding, instead of rounding each addition result.

I already mentioned the problem in another thread, but here is a more demonstrative example:

Computing DOT([-10000 (1/3) 10000],[1 1 1]):

> DIM X(3),Y(3) (assuming OPTION BASE 1)

> MAT INPUT X

X(1)? -10000,1/3,10000

> MAT Y=(1)

> DOT(X,Y)

This operation computes (-10000)+(1/3)+(10000) with 15 digits

and should return .33333333333 if correctly rounded, as do the HP-28S and the HP-42S,

but the Math ROM 1A is returning .33333333334 .

This weakness is causing the HP-71B Math ROM 1A to deliver answers that may be slightly different from later Saturn-based machines for several matrix operations using summations such as dot product, norms, matrix product and inversion, determinant and system solving.

For example, computing the determinant of the matrix [[69 58 96][51 43 71][32 55 54]]:

> DIM A(3,3)

> MAT INPUT A

A(1,1)? 69,58,96

A(2,1)? 51,43,71

A(3,1)? 32,55,54

> DET(A)

The operation returns 1.00000038313 on the HP-71B with Math ROM 1A.

The 28S , 42S return 1.00000038333 instead.

This is even more visible on the very ill-conditioned matrices built some years ago by Valentin Albillo (see his great article here).

For instance with the AM1 matrix:

Det = .970950561960 on the HP-71B Math ROM 1A,

Det = .970960198039 on the HP-28S, 42S.

I don't consider this weakness as a bug since the HP-71B results are not particularly wrong (in the sense of: not worst than the 28S/42S - the exact determinants of the above examples are 1), but the Math ROM 1A is not always consistent with later machines.

The weakness was probably identified quite early by HP, because the 1987 HP-28C (first scientific RPL machine) correctly manages the rounded 15-digit summations, at a time when the HP-71B and its Math ROM were still in production.

Unfortunately, the HP-71B Math ROM has never been updated, ... until today :-)

I'm particularly pleased to have solved the issue in the latest version of the new "Math Pac 2", now giving *exactly* the same results than the HP-28S and 42S, and moreover very happy to know what was the source of the discrepancy.

J-F