Set minimum cosine to 0.02 to avoid blowing-up values near grazing