If the quality rating is less than 3, then set the new interval to lapseInterval and reset the number of repetitions to 0.
If the number of repetitions is 0, then set the new interval to newInterval.
If the number of repetitions is 1, then set the new interval to hardInterval.
Otherwise, calculate the new interval as the minimum of the rounded product of the current interval and the ease factor, or the maximum interval of 90 days.
3. Calculate Next Review Date:
The next review date is determined by adding the adjusted interval (in days) to the current date: