code: func remainingSuspicionTime(n, k int32, elapsed time.Duration, min, max time.Duration) time.Duration {
  	frac := math.Log(float64(n)+1.0) / math.Log(float64(k)+1.0)
  	raw := max.Seconds() - frac*(max.Seconds()-min.Seconds())
  	timeout := time.Duration(math.Floor(1000.0*raw)) * time.Millisecond
  	if timeout < min {
  		timeout = min
  	}
  
  	// We have to take into account the amount of time that has passed so
  	// far, so we get the right overall timeout.
  	return timeout - elapsed
  }
docs: // remainingSuspicionTime takes the state variables of the suspicion timer and
  // calculates the remaining time to wait before considering a node dead. The
  // return value can be negative, so be prepared to fire the timer immediately in
  // that case.