A class of piecewise interpolating polynomial approximation to the time fractional differential equation and its stability analysis