20130605: an example of piecewise linear regression to fit cos function