{
  "schemaVersion": 1,
  "slug": "pet-calorie-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "514b88ccb7958309f5cc8afbd4fb7a149da39ed667987bb401b79967bb6ba84a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pet-calorie-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 × W^0.75; D = RER × F; W = lb × 0.45359237",
    "vars": [
      [
        "D",
        "Daily calories (kcal)"
      ],
      [
        "W",
        "Body weight (kg)"
      ],
      [
        "F",
        "Activity factor"
      ],
      [
        "RER",
        "Resting energy need"
      ]
    ],
    "note": "F = 1.2/1.6/2.2/1.0 (low/normal/active/weight loss); W floor 0.1 kg; cats are also multiplied by 0.8 and 1.25."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const A = { low:1.2, normal:1.6, active:2.2, weightLoss:1 }; const factor = A[activity] || 1.6; const weightKg = weight*0.45359237; const k = petType === 'cat' ? 0.8 : 1; const rer = 70*Math.pow(Math.max(weightKg, 0.1), 0.75); const dailyCalories = rer*factor*k*(petType === 'cat' ? 1.25 : 1); const caloriesPerPound = weight > 0 ? dailyCalories/weight : 0; return { weightKg, rer, dailyCalories, caloriesPerPound, feedingNote: petType === 'cat' ? 'Cats are obligate carnivores — do not feed dog food' : 'Split the daily amount across at least two meals' };",
    "inputs": [
      {
        "name": "petType",
        "type": "select",
        "default": "dog",
        "options": [
          {
            "value": "dog"
          },
          {
            "value": "cat"
          }
        ]
      },
      {
        "name": "weight",
        "type": "number",
        "default": 30,
        "min": 0.5,
        "max": 300,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "activity",
        "type": "select",
        "default": "normal",
        "options": [
          {
            "value": "low"
          },
          {
            "value": "normal"
          },
          {
            "value": "active"
          },
          {
            "value": "weightLoss"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "dailyCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "weightKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "rer",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "caloriesPerPound",
        "precision": 1,
        "unit": "kcal/lb"
      },
      {
        "name": "feedingNote",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
