Sunrise and sunset are calculated when the top of the sun is on the horizon. However, equal daylight is measured from the center of the sun -- accounting for a few minutes. The other discrepancy is from when the sun is on the horizon, the Earth's atmosphere bends the sun's light.
As a result, the sun still looks to be above the horizon for a few minutes after it has already set. The U.S. Naval Observatory takes this into consideration when calculating sunrise and sunset times.
For More Information -- www.usatoday.com