```ts
export function vatBack(gross: number, rate: number): number {
  if (rate < 0) {
    throw new Error("Rate cannot be negative");
  }

  const taxRate = rate / 100;
  const originalPrice = gross / (1 + taxRate);

  return Math.floor(originalPrice);
}
```