A good implementation will have a bunch of ready-to-use functions for - polynomials of various degrees, at least.
I recall an example where 7-8 points, trending up, are fitted with a polycurve that sharply dropped right after the last data point thereby giving erroneous prediction.