```ts
export function hourRate(rate: number): number {
  return rate;
}

/** Pay for a week, with overtime beyond forty hours. */
export function weekPay(hours: number, rate: number): number {
  if (hours <= 40) {
    return Math.floor(hours * hourRate(rate));
  }
  return Math.floor(40 * hourRate(rate) + (hours - 40) * hourRate(rate) * 1.5);
}
```

The bug was that the original formula `Math.floor((hours * hourRate(rate) * 3) / 2)` applied the 1.5x overtime multiplier to *all* hours, rather than only to the hours beyond 40. The fix splits the pay into two parts: 40 hours at the base rate, plus (hours - 40) hours at 1.5x the rate.