HP Forums
Precision problem with matrix inversion - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Precision problem with matrix inversion (/thread-4351.html)

Pages: 1 2


RE: Precision problem with matrix inversion - parisse - 07-17-2015 08:18 AM

FYI, I have eventually checked from inside CAS.
Code:
a:=[[130.2544e9,34.4351e9,17.1192e9,10.4385e9],
[55.2158e9,32.7918e9,18.5083e9,11.6938e9],
[26.9576e9,29.2367e9,22.0630e9,15.2900e9],
[17.8132e9,25.8109e9,27.0660e9,21.6890e9]];
b:=400e3*[1,1,1,1]; linsolve(a,b)
returns the correct answer, as well as inv(a)*b. The CAS does not support the b/a notation because the CAS parser translate / to inv, here to b*inv(a).
If you do linear algebra, I would recomment to be inside CAS, because except for a few operations (matrix * and inverse, perhaps a few more, Cyrille could confirm), HOME matrices are converted to CAS matrices and giac algorithms are called. The constraints for Cyrille inside HOME (perhaps for learning apps like the linear system solver with HOME approx data but expecting exact results at the end) are not the same as for giac inside the CAS where the user is expected to understand the underlying maths, rounding to 0 for example might explain wrong results. Since RPN users are probably mastering the maths, the conclusion is perhaps that it would be a good idea to support RPN inside CAS.


RE: Precision problem with matrix inversion - Dirk. - 07-17-2015 09:07 AM

Quote: ... the conclusion is perhaps that it would be a good idea to support RPN inside CAS.

... some support for RPN in the CAS sounds like a good idea, since this might give a more convenient/natural work-flow for people not used to "normal" programming languages.