William Naismith published his rule in 1892: one hour per 5 km, plus one minute per 10 m of ascent. It ignores descent entirely. Tranter's correction and Langmuir's later version add back the cost of going down — roughly a minute per 20 m lost once the gradient passes about 12°, because steep descents are slower than they look and hard on the knees.
The sunset times compute the Sun's true right ascension and declination from the Meeus low-precision series and reduce them through the local hour angle, with 90.833° as the zenith for atmospheric refraction and the solar disc. Checked against published London times through 2026 it lands within two minutes. Above the Arctic Circle in summer it will tell you the sun does not set, which is correct and worth planning around anyway.