{
  "schemaVersion": 1,
  "slug": "oil-to-butter-conversion-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "8440de2a1204a8c044180231d39be1b3181c1d3cf8ef1061e9b732c7ff34f1d5",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/oil-to-butter-conversion-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": "B = O ÷ 0.8 = 1.25 × O",
    "vars": [
      [
        "B",
        "butter amount"
      ],
      [
        "O",
        "oil amount"
      ],
      [
        "tbsp",
        "butter in tablespoons"
      ],
      [
        "kcal",
        "oil calories"
      ]
    ],
    "note": "Butter amount = oil amount / 0.8 as a rough fat-content substitution. Calories = oil grams × 8.84 kcal/g; volume inputs convert to millilitres and assume oil density of 0.92 g/ml. This does not adjust other recipe liquids."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const ml=unit==='g'?oilAmount/0.92:unit==='cup'?oilAmount*236.5882365:unit==='tbsp'?oilAmount*14.7867648:oilAmount;const butter=oilAmount/0.8,tbsp=unit==='tbsp'?butter:unit==='cup'?butter*16:unit==='g'?butter/14.17:butter/14.7867648,calories=unit==='g'?oilAmount*8.84:ml*0.92*8.84;return{butterAmount:butter,calories,butterTbsp:tbsp}",
    "inputs": [
      {
        "name": "oilAmount",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 100000,
        "step": 1
      },
      {
        "name": "unit",
        "type": "select",
        "default": "ml",
        "options": [
          {
            "value": "ml"
          },
          {
            "value": "cup"
          },
          {
            "value": "tbsp"
          },
          {
            "value": "g"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "butterAmount",
        "precision": 2,
        "unit": ""
      },
      {
        "name": "calories",
        "precision": 0,
        "unit": "kcal"
      },
      {
        "name": "butterTbsp",
        "precision": 2,
        "unit": "tbsp"
      }
    ],
    "interpret": null
  }
}
