So I’m sure I shared it somewhere, though I’m not going to bother to look for it, I developed a method for finding the degree of a function (as a polynomial) using differentiation, the idea being that you differentiate numerically some fixed number of times (simply taking the difference between adjacent terms). Then you find the derivative that is closest to zero, by simply taking the sum over the terms. So for example, if you have range values (3,4,5), taking the difference between adjacent terms produces the vector (1,1), and doing that again you have (0). In the real world, data will not be so nice, but you can find the vector that is closest to zero by taking the sum over the vector. Now you know the next vector up is a linear function, the one after that second degree, and so on. Once you get back up to the function, now you know the degree of the function as a polynomial, and then you can use simple Gaussian Elimination to solve for the function as a polynomial. This algorithm will be included in the pro version of my AutoML software.