The method of least squares is a standard approach in regression analysis to approximate the solution of overdetermined systems (sets of equations in which there are more equations than unknowns) by minimizing the sum of the squares of the residuals (a residual being the difference between an observed value and the fitted value provided by a model) made in the results of each individual equation.
Your data should be stored in any file and formatted like example.dat
Build: make
Run: bin/main
Example
$ bin/main
Enter file with X & Y data:
> example.data
Y = 2X + 1.08764