Optimized ThreadedMidpointInterpolation.cs