Computes inverse haversine. Has good numerical stability around 0.
arcHav(x) == acos(1 - 2 * x) == 2 * asin(sqrt(x)).
The argument must be in 0, 1, and the result is positive.
Wraps the given value into the inclusive-exclusive interval between min
and max.
@param n The value to wrap.
@param min The minimum.
@param max The maximum.