continued gradient implementation for degenerate covariance functions