Polynomial Interpolation for HP-67
05-11-2022, 01:04 AM (This post was last modified: 05-11-2022 01:06 AM by Matt Agajanian.)
Post: #1
 Matt Agajanian Senior Member Posts: 1,083 Joined: Dec 2013
Polynomial Interpolation for HP-67
Hi all.

In the Math/Utilities module for the TI-58/59, there’s an interpolation program that fits an n-th degree polynomial to n+1 data pairs. It then allows for the calculation when an x value is entered. I would have liked to have a version of that program which would also reveal the polynomial coefficients.

I no longer have my TI-58C nor the module. So, I can’t download and print the program so I could write an HP-67 version.

Does anyone have an HP-67 or even a 29C polynomial fitting/interpolation program so I could add that to my program library?

Thanks
05-11-2022, 05:31 AM
Post: #2
 Thomas Klemm Senior Member Posts: 2,155 Joined: Dec 2013
RE: Polynomial Interpolation for HP-67
(05-11-2022 01:04 AM)Matt Agajanian Wrote:  Does anyone have an HP-67 or even a 29C polynomial fitting/interpolation program so I could add that to my program library?

In Lagrangian Interpolation you can find some programs for the HP-67, HP-25 and HP-15C.
However these are limited to 3 points.

In the program of (42S) Newton Polynomial Interpolation the number of points is only limited by memory.
Furthermore points can be added if the interpolation is not considered sufficient.
It should be possible to rewrite these programs for the HP-67 even though some of the commands that access the stack registers are missing.

(05-11-2022 01:04 AM)Matt Agajanian Wrote:  I would have liked to have a version of that program which would also reveal the polynomial coefficients.

It may not be exactly what you want, but you get the coefficients of the Newton polynomial:
(03-09-2019 04:49 PM)Thomas Klemm Wrote:  Example:

Find a quadratic polynomial given these 3 points: $$P_0(-5, 12)$$, $$P_1(1, 13)$$ and $$P_2(2, 11)$$

0 STO 00

-5 ENTER 12
XEQ "P+"

1 ENTER 13
XEQ "P+"

2 ENTER 11
XEQ "P+"

These are the coefficients of the Newton polynomial:

R03: 12.000000
R05:  0.166667
R07: -0.309524

This leads to the formula:

$$f(x) = 12 + (x+5)(\frac{1}{6} - (x-1)\frac{13}{42})$$

But you can expand it to get:

$$-\frac{13 x^2}{42} - \frac{15 x}{14} + \frac{302}{21}$$
05-11-2022, 12:16 PM
Post: #3
 KeithB Senior Member Posts: 527 Joined: Jan 2017
RE: Polynomial Interpolation for HP-67
I have 3 or 4 routines written in C-Adjacent languages that you might be able to adapt. They use the Least Squares method (so you can put more than N data points) from Advanced Engineering Mathematics.

I keep re-inventing the wheel. 8^)
05-11-2022, 12:27 PM
Post: #4
 Albert Chan Senior Member Posts: 2,705 Joined: Jul 2018
RE: Polynomial Interpolation for HP-67
(05-11-2022 05:31 AM)Thomas Klemm Wrote:  $$f(x) = 12 + (x+5)(\frac{1}{6} - (x-1)\frac{13}{42})$$

But you can expand it to get:

$$-\frac{13 x^2}{42} - \frac{15 x}{14} + \frac{302}{21}$$

We can do synthetic multiplication, to transform "offset" polynomial to "normal" polynomial.
We do it inside out, first (x-1), then (x+5)

Code:
    -13/42      1/6       12 -1            13/42 ----------------------------     -13/42    10/21       12   +5           -65/42    50/21 ----------------------------     -13/42   -15/14   302/21

Or, we can convert 1 set of polynomial offsets, to another, in 1 shot.
see Funny Factorials and Slick Sums

We don't see much benefits here, because "normal" polynomial have zero offsets.

a(n) x^n + a(n-1) x^(n-1) + ... = (x-0) * (a(n) + (x-0) * (a(n-1) + ...

From offsets (-1,5) → (0,0):
Code:
      -13/42       1/6        12       -1 0> -13/42     10/21    302/21 +5 0> -13/42    -15/14 (-1+0)*(-13/42) + 1/6   =  10/21 (+5+0)*(+10/21) + 12    = 302/21 (+5+0)*(-13/42) + 10/21 = -15/14
05-11-2022, 09:37 PM
Post: #5
 Thomas Klemm Senior Member Posts: 2,155 Joined: Dec 2013
RE: Polynomial Interpolation for HP-67
(05-11-2022 05:31 AM)Thomas Klemm Wrote:  It should be possible to rewrite these programs for the HP-67 even though some of the commands that access the stack registers are missing.

Done.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 2 Guest(s)