{
  "schemaVersion": 1,
  "slug": "calorie-deficit-calculator",
  "category": "health",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "155bce1c49d2740c3077450c474c3fdd54ea1666ecbf1999a68f2ec33ff3b9f0",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/calorie-deficit-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": "D = (W₀ − W₁)·7700 ÷ (7t);  C = C_m − D",
    "vars": [
      [
        "D",
        "Daily calorie deficit"
      ],
      [
        "W₀",
        "Current weight, kg"
      ],
      [
        "W₁",
        "Target weight, kg"
      ],
      [
        "t",
        "Timeframe, weeks"
      ],
      [
        "C",
        "Daily calorie target"
      ],
      [
        "C_m",
        "Maintenance calories"
      ]
    ],
    "note": "This is static arithmetic, not a dynamic weight-response model: it assumes 7,700 kcal per kg and fixed maintenance calories. Actual energy needs and weight change adapt over time; the result is not a personal medical or nutrition recommendation."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const totalChange=currentWeight-targetWeight;const dailyDeficit=totalChange*7700/(weeks*7);const dailyCalories=maintenanceCalories-dailyDeficit;if(currentWeight<=targetWeight||weeks<=0||maintenanceCalories<=0||dailyCalories<=0)return{dailyCalories:null,dailyDeficit:null,weeklyLoss:null,totalChange:null,__error:'inputError'};return{dailyCalories,dailyDeficit,weeklyLoss:dailyDeficit*7/7700,totalChange};",
    "inputs": [
      {
        "name": "currentWeight",
        "type": "number",
        "default": 85,
        "min": 20,
        "max": 400,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "targetWeight",
        "type": "number",
        "default": 75,
        "min": 20,
        "max": 400,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "weeks",
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "maintenanceCalories",
        "type": "number",
        "default": 2400,
        "min": 800,
        "max": 10000,
        "step": 50,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "dailyCalories",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "dailyDeficit",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "weeklyLoss",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "totalChange",
        "precision": 2,
        "unit": "kg"
      }
    ],
    "interpret": null
  }
}
