{
  "schemaVersion": 1,
  "slug": "dog-food-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "8be4e9b4c98404c81497e813e22fc0626db606f2595fc2153bd7d696f663dfd3",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/dog-food-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "K = 70 × (0.45359237 × W)^0.75 × f; G = K ÷ d × 1000; Cp = e × G ÷ 1000",
    "vars": [
      [
        "W",
        "dog weight, lb"
      ],
      [
        "f",
        "life-stage factor"
      ],
      [
        "d",
        "food energy density, kcal/kg"
      ],
      [
        "e",
        "cups per kg"
      ],
      [
        "G",
        "food per day, g"
      ],
      [
        "Cp",
        "cups per day"
      ]
    ],
    "note": "f = 2.5 puppy, 1.8 intact, 1.6 neutered, 1 weight loss, 1.4 senior, 3 working. Per meal = Cp ÷ meals; ounces per day = G ÷ 28.3495."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const F = { puppy:2.5, intactAdult:1.8, neuteredAdult:1.6, weightLoss:1, senior:1.4, working:3 }; const f = F[lifeStage] || 1.6; const weightKg = weight*0.45359237; const rer = 70*Math.pow(Math.max(weightKg, 0.1), 0.75); const dailyCalories = rer*f; const gramsPerDay = kcalPerKg > 0 ? dailyCalories/kcalPerKg*1000 : 0; const cupsPerDay = cupsPerKg*gramsPerDay/1000; return { dailyCalories, gramsPerDay, cupsPerDay, perMealCups: mealsPerDay > 0 ? cupsPerDay/mealsPerDay : 0, ouncesPerDay: gramsPerDay/28.3495 };",
    "inputs": [
      {
        "name": "weight",
        "type": "number",
        "default": 45,
        "min": 1,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "lifeStage",
        "type": "select",
        "default": "neuteredAdult",
        "options": [
          {
            "value": "puppy"
          },
          {
            "value": "intactAdult"
          },
          {
            "value": "neuteredAdult"
          },
          {
            "value": "weightLoss"
          },
          {
            "value": "senior"
          },
          {
            "value": "working"
          }
        ]
      },
      {
        "name": "kcalPerKg",
        "type": "number",
        "default": 3600,
        "min": 500,
        "max": 6000,
        "step": 50,
        "slider": true
      },
      {
        "name": "cupsPerKg",
        "type": "number",
        "default": 8,
        "min": 3,
        "max": 16,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "mealsPerDay",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 6,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "dailyCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "gramsPerDay",
        "precision": 0,
        "unit": "g/day"
      },
      {
        "name": "cupsPerDay",
        "precision": 2,
        "unit": "cups/day"
      },
      {
        "name": "perMealCups",
        "precision": 2,
        "unit": "cups"
      },
      {
        "name": "ouncesPerDay",
        "precision": 1,
        "unit": "oz/day"
      }
    ],
    "interpret": null
  }
}
