{
  "schemaVersion": 1,
  "slug": "bakers-percentage-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "3e68666a7bbbad6710c8ff0b032f3980c956f72050a5ecad18ed786209063105",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/bakers-percentage-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": "W = F × h ÷ 100; H = W ÷ (F + W + S + Y) × 100",
    "vars": [
      [
        "F",
        "Flour mass"
      ],
      [
        "h",
        "Hydration %"
      ],
      [
        "W",
        "Water mass"
      ],
      [
        "S",
        "Salt mass"
      ],
      [
        "Y",
        "Yeast mass"
      ],
      [
        "H",
        "True hydration %"
      ]
    ],
    "note": "Baker's percentages use flour as 100%; h is entered in percent; H is water as a share of the total dough, not the recipe hydration."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "if (flourGrams <= 0) return { waterGrams: null, saltGrams: null, yeastGrams: null, totalDough: null, trueHydration: null, __error: 'inputError' }; const water=flourGrams*hydration/100; const salt=flourGrams*saltPercent/100; const yeast=flourGrams*yeastPercent/100; const total=flourGrams+water+salt+yeast; return { waterGrams: water, saltGrams: salt, yeastGrams: yeast, totalDough: total, trueHydration: water/flourGrams*100 };",
    "inputs": [
      {
        "name": "flourGrams",
        "type": "number",
        "default": 1000,
        "min": 0,
        "max": 100000,
        "step": 10
      },
      {
        "name": "hydration",
        "type": "number",
        "default": 70,
        "min": 0,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "saltPercent",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 10,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "yeastPercent",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 10,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "waterGrams",
        "precision": 1,
        "unit": "g"
      },
      {
        "name": "saltGrams",
        "precision": 1,
        "unit": "g"
      },
      {
        "name": "yeastGrams",
        "precision": 2,
        "unit": "g"
      },
      {
        "name": "totalDough",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "trueHydration",
        "precision": 1,
        "unit": "%"
      }
    ],
    "interpret": null
  }
}
