/guava/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java
maxPermits = thresholdPermits + 2.0 * warmupPeriodMicros / ( slope + coldIntervalMicros) ;
maxPermits = thresholdPermits + 2.0 * warmupPeriodMicros / ( stableIntervalMicros + coldIntervalMicros ) ;
} @Override void doSetRate(double permitsPerSecond, double stableIntervalMicros) { double oldMaxPermits = maxPermits; double coldIntervalMicros = stableIntervalMicros * coldFactor; thresholdPermits = 0.5 * warmupPeriodMicros / stableIntervalMicros; <extra_id_0> slope = (coldIntervalMicros - stableIntervalMicros) / (maxPermits - thresholdPermits); if (oldMaxPermits == Double.POSITIVE_INFINITY) { storedPermits = 0.0; } else { storedPermits = (oldMaxPermits == 0.0)