{
  "schemaVersion": 1,
  "slug": "bowling-average-calculator",
  "category": "sports",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d0cc6906e05c308022e63b8895e14c6002192195dcab082d4614465d7108ec0c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/bowling-average-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": "avg = R/W; economy = R/O; strikeRate = O·b/W",
    "vars": [
      [
        "R",
        "Runs conceded"
      ],
      [
        "W",
        "Wickets taken"
      ],
      [
        "O",
        "Overs bowled"
      ],
      [
        "b",
        "Balls per over"
      ],
      [
        "avg",
        "Bowling average"
      ],
      [
        "economy",
        "Economy rate"
      ],
      [
        "strikeRate",
        "Strike rate"
      ]
    ],
    "note": "Cricket bowling average, economy and strike rate; the grade uses per-format targets (T20/ODI/Test/club); wickets per 50-over match are extrapolated from the rate."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "if(![runsConceded,wickets,oversBowled,ballsPerOver].every(Number.isFinite)||!Number.isInteger(runsConceded)||!Number.isInteger(wickets)||!Number.isInteger(ballsPerOver)||runsConceded<0||wickets<0||oversBowled<0||ballsPerOver<1||(oversBowled===0&&(runsConceded>0||wickets>0)))return{average:null,economy:null,strikeRate:null,__error:'inputError'};const average=wickets>0?runsConceded/wickets:null,economy=oversBowled>0?runsConceded/oversBowled:null,strikeRate=wickets>0?oversBowled*ballsPerOver/wickets:null;return{average,economy,strikeRate};",
    "inputs": [
      {
        "name": "runsConceded",
        "type": "number",
        "default": 620,
        "min": 0,
        "max": 100000,
        "step": 1
      },
      {
        "name": "wickets",
        "type": "number",
        "default": 28,
        "min": 0,
        "max": 5000,
        "step": 1,
        "slider": true
      },
      {
        "name": "oversBowled",
        "type": "number",
        "default": 210,
        "min": 0,
        "max": 100000,
        "step": 0.1
      },
      {
        "name": "ballsPerOver",
        "type": "number",
        "default": 6,
        "min": 4,
        "max": 8,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "average",
        "precision": 2,
        "unit": "",
        "optional": true
      },
      {
        "name": "economy",
        "precision": 2,
        "unit": "",
        "optional": true
      },
      {
        "name": "strikeRate",
        "precision": 1,
        "unit": "",
        "optional": true
      }
    ],
    "interpret": null
  }
}
