```ts
export function doseTotals(log: [string, string][]): Record<string, string> {
  const totals: Record<string, number> = {};

  for (const [reagent, amount] of log) {
    if (!/^-?\d+(\.\d{1,3})?$/.test(amount)) {
      throw new Error('Invalid amount format');
    }

    totals[reagent] = (totals[reagent] || 0) + parseFloat(amount);
  }

  const result: Record<string, string> = {};
  for (const [reagent, total] of Object.entries(totals)) {
    result[reagent] = total.toFixed(3).replace(/\.?0+$/, '');
  }

  return result;
}
```