{
  "schemaVersion": 1,
  "slug": "cat-food-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "96d30253d8202df261352238014a6f3fa33ef611c398e6d9003f2ad0b3c1727a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/cat-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": "RER = 70 × (0.45359237 × W)^0.75; kcal = RER × f; grams = kcal ÷ D × 1000",
    "vars": [
      [
        "W",
        "cat weight (lb)"
      ],
      [
        "f",
        "selected life-stage factor"
      ],
      [
        "D",
        "food energy density from package (kcal/kg)"
      ],
      [
        "grams",
        "estimated food per day"
      ]
    ],
    "note": "The food amount uses the metabolizable energy printed on the package. Product recipes and individual needs vary; monitor body condition and ask your veterinarian to adjust portions."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const F={kitten:2.5,junior:2,intact:1.4,neutered:1.2,weightLoss:0.8,senior:1.1}; const f=F[lifeStage]??1.2; const weightKg=weight*0.45359237; const rer=70*Math.pow(weightKg,0.75); const dailyCalories=rer*f; const gramsPerDay=dailyCalories/kcalPerKg*1000; return {weightKg,dailyCalories,gramsPerDay,ouncesPerDay:gramsPerDay/28.3495};",
    "inputs": [
      {
        "name": "weight",
        "type": "number",
        "default": 9,
        "min": 1,
        "max": 40,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "lifeStage",
        "type": "select",
        "default": "neutered",
        "options": [
          {
            "value": "kitten"
          },
          {
            "value": "junior"
          },
          {
            "value": "intact"
          },
          {
            "value": "neutered"
          },
          {
            "value": "weightLoss"
          },
          {
            "value": "senior"
          }
        ]
      },
      {
        "name": "kcalPerKg",
        "type": "number",
        "default": 3600,
        "min": 500,
        "max": 7000,
        "step": 50,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "gramsPerDay",
        "precision": 0,
        "unit": "g/day"
      },
      {
        "name": "weightKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "dailyCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "ouncesPerDay",
        "precision": 1,
        "unit": "oz/day"
      }
    ],
    "interpret": null
  }
}
