Xiggi's formula

<p>It’s basically the harmonic mean of two numbers, and is often used to find the average speed if half the distance is traveled at rate r1 and half the distance is traveled at rate r2.</p>

<p>In the above case, if you travel distance d at rate r1 and distance d at rate r2, then overall, you travel 2d distance in time d/r1 + d/r2, so your average rate is 2d/(d/r1 + d/r2) = 2/(1/r1 + 1/r2), which is the harmonic mean of r1 and r2 (this generalizes to more rates). The above expression is equal to 2r1*r2/(r1 + r2).</p>

<p>In general, the harmonic mean of n numbers x1, …, xn is n/(1/x1 + 1/x2 + … + 1/xn).</p>