{
  "schemaVersion": 1,
  "slug": "fresh-to-dry-herb-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "3dd3e447c0b9f9e4456b697d2324a80e96f3b68db55ac1c5438cbd92a8f580ce",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/fresh-to-dry-herb-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": "dried = amount / r; fresh = amount x r; r = { 3, h ∈ R; 4, h ∈ D }",
    "vars": [
      [
        "amount",
        "quantity of the reference form"
      ],
      [
        "r",
        "fresh-to-dry ratio"
      ],
      [
        "dried",
        "dried-herb equivalent"
      ],
      [
        "fresh",
        "fresh-herb equivalent"
      ],
      [
        "h",
        "herb"
      ],
      [
        "R",
        "robust-herb set"
      ],
      [
        "D",
        "delicate-herb set"
      ]
    ],
    "note": "Enter the fresh amount in any unit and keep that unit for the dried equivalent. The model divides by 3 for robust herbs and by 4 for delicate herbs; these are kitchen estimates, not exact substitutions for every recipe."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const ratio = herbType === 'delicate' ? 4 : 3; return { dried: amount/ratio, fresh: amount*ratio, ratio: ratio + ' : 1' };",
    "inputs": [
      {
        "name": "amount",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 10000,
        "step": 0.25
      },
      {
        "name": "herbType",
        "type": "select",
        "default": "robust",
        "options": [
          {
            "value": "robust"
          },
          {
            "value": "delicate"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "dried",
        "precision": 3,
        "unit": ""
      },
      {
        "name": "fresh",
        "precision": 3,
        "unit": ""
      },
      {
        "name": "ratio",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
