# Knowledge Base

## Solution 11695: Algorithm Used to Compute a Cubic Polynomial on a TI-85, TI-86, TI-89 Family, TI-92 Family, and Voyage™ 200 Graphing Calculators.

### How are cubic polynomials computed on a TI-85, TI-86, TI-89 family, TI-92 family, and Voyage 200 graphing calculators?

The data listed below was used in the following explanation:

X = 1.0E-5 * {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
Y = {-11000, -8200, -5400, -3900, -2400, -1200, -830, 0, 600, 1400, 2300, 4000, 5400, 7900, 10800, 15400, 19000, 24000, 32100}

The TI-89 family, TI-92 family, Voyage 200, TI-85, and TI-86 will try to determine a cubic polynomial that best fits this data in the least squares sense by attempting to solve a linear system that is defined by the normal equations. It turns out that the normal equations for this data set lead to a poorly conditioned linear system (nearly singular) due to the fact that this data set is poorly scaled. The difference between the software on the TI-89 family and TI-92 family and the TI-85 and TI-86 is that they use different linear system solvers, which use slightly different criteria for determining when a linear system is too poorly conditioned to solve accurately. Apparently, the linear system solver on the TI-89 family and TI-92 family (simult) is slightly more conservative than the one on the TI-85/86 as it determines that this linear system is "singular" (when using floating point numbers, this usually means that the linear system is "nearly singular" or "ill-conditioned").

This does not mean that the algorithm in the TI-89 family, TI-92 family, and Voyage 200 is weaker than that in the TI-85 and TI-86, simply more cautious. This means that the TI-89 family, TI-92 family, and Voyage 200 are more likely to occasionally report that a linear system is singular when it actually may be possible to determine a reasonable solution. On the other hand, this also means that it is less likely to return an erroneous solution to a system that is truly too ill-conditioned to solve with the precision available.

The good news is that the "singularity" in this problem can easily be removed by simply scaling the data in the following manner:

X = (X - X-bar) / MAX(ABS(X)) and Y = (Y - Y-bar) / MAX(ABS(Y))

Where X-bar & Y-bar are the means and MAX(ABS(X)) = 1.1E-4 & MAX(ABS(Y)) = 32100. This scaling gives data X and Y both an order of 1. The normal equations for this data lead to a very well conditioned linear system that can be accurately solved to determine the solution:

y = b0 + b1*x + b2*(x)2 + b3*(x)3.

Using the variables following in the above equation will provide the desired result:

x = (x - X-bar) / MAX(ABS(X)) and y = (y - Y-bar) / MAX(ABS(Y)),

Solution provided:

y = b0 + b1*x + b2*x2 + b3*x3

Where:

b0 = 19.3593
b1 = 6.53199e7
b2 = -2.30295e10
b3 = 1.85522e16

Please see the applicable model of graphing calculator guidebooks for additional information.