This paper presents a modified algorithm, Mazhar-Eslam, which enhances the Lyapunov exponent method to analyze heart rate variability (HRV) more accurately. HRV is essential for detecting cardiovascular risks and is influenced by both linear and nonlinear dynamics, highlighting the need for sensitive analysis tools. The study emphasizes the importance of HRV in understanding cardiac health and proposes an innovative approach for its analysis to aid in the prognostic evaluation of heart conditions.