- HP Community
- >
- Tablets
- >
- Calculators
- >
- HP prime - Matrix inversion rounding erro

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Flag Post

# HP prime - Matrix inversion rounding erro

03-24-2019 01:40 PM

My HP prime is inverting matrices incorrectly. (I know because I am comparing the results against MATLAB and textbook examples.

For example, inverting the following matrix,

[821667 308125

308125 616250]

returns

[1.4979e-6 0

0 1.9972e-6] ****This is an icorrect answer

The correct answer is

[.1498 -0.0749

-0.0749 0.1997]*1e-5

Why is the calculator zeroing out those two values of the matrix instead of returning the correct values? I have tried manipulating the settings several different ways and still get the incorrect results.

I am performing these calculations in home screen in RPN mode. The calculator seems to be able to invert this matrix correctly in CAS mode, but this is useless to me because I need to perform calculations in the stack. CAS gives me improper fractions so I can't do anything with them.

I recently took an exam that required matrix inversion and I failed it because my calculator kept giving me bogux answers.

Any help would be appreciated.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Flag Post

## HP prime - Matrix inversion rounding erro

03-24-2019 08:19 PM

Until somebody gives a better reply, here's a workaround that might help you. If you store your matrix in M1, then type **1./M1** __in CAS__ (be sure to include that decimal point!), you'll get the result you're looking for. OR you can turn off the "Exact" setting in the CAS Settings screen.

Disclaimer: I don't work for HP. I'm just another HP calculator fanatic.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Flag Post

## HP prime - Matrix inversion rounding erro

03-25-2019 03:48 AM

Hello,

In home, the result will be rounded to 0 as "most times", numerical matrix inversion will result in small, close to 0, but not 0, while it should have been 0.

Of course, you here, have a counter example where indeed, the result should NOT be 0 and where the Prime "default" round to 0 behavior is incorrect.

The best way to solve this is to do the calculations in the CAS where you will get EXACT result and not approximate ones. This should solve your problem.

Cyrille