The FITLS utility allows an equation with $n$ unknown constants to 
be fitted to experimental data.

For example to fit a simple least squares regression line to a set of 
points you would give FITLS the equation:

     a*x+b

FITLS would then solve the equation to find the {\em best} values for
the constants $a$ and $b$. 

FITLS can work with non linear equations, it will ask for initial
values for the parameters so that a solution around those initial
guesses will be found.

FITLS writes out a GLE file containing commands to draw the data
points and the equation it has fitted to them.

Here is a sample FITLS session:

$ fitls
Input data file (x and y columns optional) [test.dat,1,2] ? fitls.dat
Loading data from file, fitls.dat,  xcolumn=1, ycolumn=2
Valid operators: +, -, *, /, ^ (power) 
Valid functions:
        abs(), atn(), cos(), exp(), fix(), int()
        log(), log10(), not(), rnd(), sgn(), sin()
        sqr(), sqrt(), tan()

 Enter a function of 'x' using constants 'a'...'z' 
 e.g.    a + b*x   (standard linear least squares fit) 
         sin(x)*a+b 
         a + b*x + c*x^2 + d*x^3  
         log(a*x)+(b+x)*c+a 

Equation ? sin(a*x)*b+c*x^2+d
Output file name to write gle file [fitls.gle] ?
Precision of fit required, [1e-4] ?
Initial value for constant a [1.0] ? 
Initial value for constant b [1.0] ? 
Initial value for constant c [1.0] ? 
Initial value for constant d [1.0] ? 
0 evaluations, 1 1 1 1 , fit = 1355.36 
20 evaluations, 1.97005 1 1 1 , fit = 1281.95 
40 evaluations, 1.97005 10.228 0.151285 1 , fit = 54.7694 
60 evaluations, 2.01053 10.228 0.151285 1.06365 , fit = 54.1771 
.
.
.
440 evaluations, -0.640525 -2.81525 0.13997 1.13871 , fit = 0.940192 
460 evaluations, -0.638055 -2.82934 0.140971 1.10502 , fit = 0.93842 
480 evaluations, -0.63808 -2.82357 0.140993 1.10452 , fit = 0.938389 
a = -0.638262 b = -2.81719 c = 0.140722 d = 1.11256 

10 Iterations, sum of squares devided by n = 0.938389
y = sin(-0.638262*x)*-2.81719+0.140722*x^2+1.11256

                           