[VA] SRC #015b - HP-15C & clones: COMPLEX Matrix Inverse up to 8x8
|
09-27-2023, 03:43 PM
Post: #4
|
|||
|
|||
RE: [VA] SRC #015b - HP-15C & clones: COMPLEX Matrix Inverse up to 8x8
Not quite what you asked for, Valentin, but here's a short routine to multiply two split complex matrices.
Together with your inversion routine, it may be used to solve a system of equations as well. This routine multiplies the complex matrices A+iB and C+iD, and places the result in C+iD. C+iD := (A+iB)*(C+iD); on condition that A is invertible. It leaves A intact, while B may suffer some accuracy loss. (A+iB)*(C+iD) = (A.C - B.D) + i(A.D + B.C) that is impossible to do with just one extra matrix, so we have to resort to a 'trick' A.C - B.D = A*(C - A^-1.B.D) A.D + B.C = A*(D + A^-1.B.C) so we can do: E := A; B := E^-1*B; E := C; E := E - B*D; D := D + B*C; C := A*D; D := C; C := A*E; E := A*B; B := E; If you leave off the last 5 lines, B is not restored, and it's 26 lines, 31 bytes. 31 lines, 37 bytes LBL D RCL MATRIX A STO MATRIX E RCL MATRIX B RCL MATRIX E RESULT B / RCL MATRIX C STO MATRIX E RCL MATRIX B RCL MATRIX D RESULT E MATRIX 6 RCL MATRIX A RCL MATRIX B RCL MATRIX C CHS RESULT D MATRIX 6 RESULT C x STO MATRIX D RCL MATRIX A RCL MATRIX E x RCL MATRIX A RCL MATRIX B RESULT E x STO MATRIX B RTN Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)