```typescript
export function doseTotals(log: [string, string][]): Record<string, string> {
  if (!log || log.length === 0) return {};

  const totals = new Map<string, number>();

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

    const totalAmount = Number.parseFloat(amount);
    totals.set(reagent, (totals.get(reagent) || 0) + totalAmount * 1000);
  }

  return Object.fromEntries(
    Array.from(totals).map(([reagent, total]) => {
      const roundedTotal = Math.round(total / 1000);
      if (roundedTotal === 0) return [reagent, "0"];
      return [
        reagent,
        roundedTotal >= 0 ? total.toFixed(3) : `-${Math.abs(total).toFixed(3)}`,
      ];
    })
  );
}
```