Working version of original matlab code!
Compiled code for pwl interpolation.