Calculate yield to maturity — the total return if you hold a bond until it matures.
YTM is the discount rate that makes the present value of all future cash flows (coupons + face value) equal to the current market price. It assumes all coupons are reinvested at the YTM rate.
The approximation formula is quick and usually within 10-20 bps of the exact value. For precise calculations, we use Newton's method to iteratively solve for the exact YTM.