```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: ${amount}`);
    }

    const parsedAmount = parseFloat(amount);
    if (isNaN(parsedAmount)) {
      throw new Error(`Invalid amount value: ${amount}`);
    }

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

  const result: Record<string, string> = {};
  for (const [reagent, total] of Object.entries(totals)) {
    const decimalPlaces = Math.max(...log.filter(([r]) => r === reagent).map(([_, a]) => a.split('.')[1]?.length || 0));
    result[reagent] = total.toFixed(decimalPlaces);
  }

  return result;
}
```