Hi all,

Busy as always, just a quick post to let you know that a new article

from mine appears published in the latest September-October issue of Datafile (V24 N5), namely:

**HP-71B Minimax Polynomial Fit**

This is a 12-page article including two programs, namely a *3-liner* to compute the

Least-Squares Nth-degree polynomial which best fits a given set of (x,y) datapoints

in the least-square sense, and a *50-line* program to compute the minimax Nth-degree

polynomial fit to an arbitrary set of datapoints (x,y), which can be entered from the

keyboard, automatically generated by evaluating an arbitrary user-provided function,

or read/stored from/to a data file.

The user can specify the degree of the polynomial or else specify instead a maximum

absolute error and let the program select the lowest degree which will achieve it.

Once the coefficients have been computed, the user can *evaluate* the resulting

polynomial at any given arguments right from the keyboard (even as part of more

complicated expressions), and can also *scan* any given interval for maximum errors in

it, at whatever step size desired.

For example, when asked to automatically produce the minimax polynomial of lowest

degree which fits **y = Gamma(x)** in the interval [1,2] with maximum absolute error less

than 0.00005 (i.e.: 4 correct decimal places), my program

produces the 5th-degree minimax polynomial:

P(x) = A0 + A1*x + A2*x^2 + ... + A5*x^5with

A0 = 3.73459956Once computed, we can use the automatic scan option to check the [1,2] interval at 0.01 steps

A1 = -6.72738793

A2 = 6.54439953

A3 = -3.37095678

A4 = 0.91923039

A5 = -0.09992158

to confirm that it has absolute maximum error app. 0.00003812 (<0.00005) at x=1.06

>FNE(1, 2, 0.01)1.06000000 (x-coordinate where the max. err. occurs)

0.00003812 (absolute maximum error in [1,2])

and can evaluate it for any argument, say Ln(Pi), like this:

>FIX 5 @ FNF(LN(PI))while the correct value is0.93479 (P(Ln(Pi)) = predicted value of Gamma(Ln(Pi)))

GAMMA(LN(PI)) -> 0.93480i.e., we sure got 4 correct decimal places, more nearly five.

Any and all comments are very welcome.

Best regards from V.