Improve performance by simplifying the duration log factor calculation.