An Algorithm for Computing Spline Function