{
  "schemaVersion": 1,
  "slug": "dog-calorie-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e9105491daeb5c9af8beed144670c784063350ca3044e30c6d7da4739a56e7fc",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/dog-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 × (0.45359237 × W)^0.75; daily kcal = RER × f",
    "vars": [
      [
        "W",
        "dog weight (lb)"
      ],
      [
        "f",
        "selected life-stage/activity factor"
      ],
      [
        "RER",
        "resting energy requirement (kcal/day)"
      ]
    ],
    "note": "This is a starting estimate using the selected factor. Individual needs vary; adjust with body-weight and body-condition monitoring and veterinary guidance. Treat calories are limited to 10% of the daily estimate."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const F = { puppy0to4:3, puppy4to12:2, intactAdult:1.8, neuteredAdult:1.6, weightLoss:1, lightWork:2, moderateWork:3, heavyWork:5, senior:1.4 }; 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 share=Math.min(10,Math.max(0,treatShare)); return { rer, dailyCalories, treatCalories: dailyCalories*share/100, foodCalories: dailyCalories*(1-share/100), weightKg };",
    "inputs": [
      {
        "name": "weight",
        "type": "number",
        "default": 45,
        "min": 1,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "lifeStage",
        "type": "select",
        "default": "neuteredAdult",
        "options": [
          {
            "value": "puppy0to4"
          },
          {
            "value": "puppy4to12"
          },
          {
            "value": "intactAdult"
          },
          {
            "value": "neuteredAdult"
          },
          {
            "value": "weightLoss"
          },
          {
            "value": "lightWork"
          },
          {
            "value": "moderateWork"
          },
          {
            "value": "heavyWork"
          },
          {
            "value": "senior"
          }
        ]
      },
      {
        "name": "treatShare",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 10,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "dailyCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "rer",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "treatCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "foodCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "weightKg",
        "precision": 2,
        "unit": "kg"
      }
    ],
    "interpret": null
  }
}
