protected function adapt($delta, $numPoints, $firstTime)
{
$delta = (int) ($firstTime ? $delta / static::DAMP : $delta / 2);
$delta += (int) ($delta / $numPoints);
$k = 0;
while ($delta > (static::BASE - static::TMIN) * static::TMAX / 2) {
$delta = (int) ($delta / (static::BASE - static::TMIN));
$k = $k + static::BASE;
}
$k = $k + (int) ((static::BASE - static::TMIN + 1) * $delta / ($delta + static::SKEW));
return $k;
}