fixed t calculation for non-looping natural spline
optimized t calculator based on profiling results