{
  "schemaVersion": 1,
  "slug": "yeast-conversion-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "54af5aa08e0348f2cb012fad81878cc37a968b5b965152e2e21af4e0089cdfbc",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/yeast-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": "R = A × t[from] × f[to]",
    "vars": [
      [
        "A",
        "Amount (g)"
      ],
      [
        "t",
        "Source factor (1, 0.8 or 1/3)"
      ],
      [
        "f",
        "Target factor (1, 1.25 or 3)"
      ],
      [
        "R",
        "Converted amount (g)"
      ]
    ],
    "note": "t: instant 1, active dry 0.8, fresh 1/3; f: instant 1, active dry 1.25, fresh 3. Teaspoons of instant ≈ (A × t) ÷ 3.1; result shown to 3 decimals."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const mergedResult=(()=>{if((true&&![\"instant\", \"active\", \"fresh\"].includes(String(from)))||(true&&![\"instant\", \"active\", \"fresh\"].includes(String(to))))return{__error:'inputError'};\nif((true&&(!Number.isFinite(amount)||amount<0||amount>10000))||(true&&(!Number.isFinite(flourWeight)||flourWeight<0||flourWeight>10000000.0)))return{__error:'inputError'};\nconst toInstant={instant:1,active:0.8,fresh:1/3};const F={instant:1,active:1.25,fresh:3};if(!(amount>0)||!['instant','active','fresh'].includes(from)||!['instant','active','fresh'].includes(to)||!Number.isFinite(flourWeight)||flourWeight<0)return {result:null,asInstant:null,asActive:null,asFresh:null,teaspoons:null,__error:'inputError'};const instant=amount*toInstant[from];return {percentOfFlour:flourWeight>0?instant/flourWeight*100:null,result:instant*F[to],asInstant:instant,asActive:instant*1.25,asFresh:instant*3,teaspoons:instant/3.1};\n})();return mergedResult.__error?{\"result\":null,\"asInstant\":null,\"asActive\":null,\"asFresh\":null,\"teaspoons\":null,\"percentOfFlour\":null,...mergedResult}:mergedResult;",
    "inputs": [
      {
        "name": "amount",
        "type": "number",
        "default": 7,
        "min": 0,
        "max": 10000,
        "step": 0.1,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "instant",
        "options": [
          {
            "value": "instant"
          },
          {
            "value": "active"
          },
          {
            "value": "fresh"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "active",
        "options": [
          {
            "value": "instant"
          },
          {
            "value": "active"
          },
          {
            "value": "fresh"
          }
        ]
      },
      {
        "name": "flourWeight",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 10000000,
        "step": 0.1,
        "requiredValue": false,
        "strictRange": true,
        "advanced": true
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 3,
        "unit": "g"
      },
      {
        "name": "asInstant",
        "precision": 3,
        "unit": "g"
      },
      {
        "name": "asActive",
        "precision": 3,
        "unit": "g"
      },
      {
        "name": "asFresh",
        "precision": 3,
        "unit": "g"
      },
      {
        "name": "teaspoons",
        "precision": 2,
        "unit": "tsp"
      },
      {
        "name": "percentOfFlour",
        "precision": 3,
        "unit": "%",
        "optional": true
      }
    ],
    "interpret": null
  }
}
