E-Code

LU decomposition with pivoting (exact) — a TI-89 Titanium program

By E-Code · updated

LU89 is a TI-89 BASIC program for the TI-89 Titanium. Factor a 2×2 to 4×4 matrix as PA = LU with partial pivoting, in exact fractions: the row order P, every row of L and U, and the determinant.

What it asks for and what it shows

It asks for 4 values at its prompts. In the example below it shows DET, ROW ORDER P, L1, L2, L3, U1, U2, U3.

Example run

One of its oracle test cases: “3x3 with a row swap”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Input 13
Input 2{2,1,1}
Input 3{4,-6,0}
Input 4{-2,7,2}
The screen shows
DET=-16
ROW ORDER P={2 1 3}
L1={1 0 0}
L2={1/2 1 0}
L3={-1/2 1 1}
U1={4 -6 0}
U2={0 4 1}
U3={0 0 1}

How it's checked

5 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 41 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-89 Titanium math programs · All TI-89 Titanium programs