how about:

```php
function linearLow(x)
{
   return x / 2;
}
```

Your approach is really not fast enough because of the loop.