Here's a sample data file which polyfit can't handle directly.
-1196.4 315571.7086 -1195.2 315575.9618 -1194 315579.4195 -1192.8 315582.6206 -1191.6 315585.4966 -1190.4 315588.3172 -1189.2 315590.9326 -1188 315593.5934 -1186.8 315596.0455 -1185.6 315598.4201 -1184.4 315600.7143 -1183.2 315602.9508 -1182 315605.1765