{
  "schemaVersion": 1,
  "slug": "commute-cost-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e16410efd5fb95d37d5bef35d665b2e49dbe3552a7bb89eb846857011a7fb292",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/commute-cost-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": "D = d_w − d_r; C = 48 × D × (M × c + p + 2t ÷ 60 × v)",
    "vars": [
      [
        "D",
        "office days per week"
      ],
      [
        "d_w",
        "in-office days per week"
      ],
      [
        "d_r",
        "remote days per week"
      ],
      [
        "M",
        "round-trip miles"
      ],
      [
        "c",
        "cost per mile"
      ],
      [
        "p",
        "parking per day"
      ],
      [
        "t",
        "minutes one way"
      ],
      [
        "v",
        "value of time per hour"
      ],
      [
        "C",
        "annual commuting cost"
      ]
    ],
    "note": "Assumes 48 commuting weeks per year. The editable $0.76/mile default is a planning proxy based on the U.S. IRS 2026 business rate effective July–December; ordinary home-to-work commuting is generally not deductible."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const empty={annualMiles:null,drivingCost:null,parkingCost:null,timeHours:null,timeValue:null,totalCost:null,remoteSaving:null};const nums=[roundTripMiles,daysPerWeek,costPerMile,parkingPerDay,minutesEachWay,timeValuePerHour,remoteDays].map(Number);if(nums.some(v=>!Number.isFinite(v)||v<0)||!Number.isInteger(Number(daysPerWeek))||!Number.isInteger(Number(remoteDays))||daysPerWeek<1||daysPerWeek>7||remoteDays>daysPerWeek)return{...empty,__error:'inputError'};const officeDays=daysPerWeek-remoteDays,annualMiles=roundTripMiles*officeDays*48,drivingCost=annualMiles*costPerMile,parkingCost=parkingPerDay*officeDays*48,timeHours=minutesEachWay*2/60*officeDays*48,timeValue=timeHours*timeValuePerHour,totalCost=drivingCost+parkingCost+timeValue,fullCost=roundTripMiles*daysPerWeek*48*costPerMile+parkingPerDay*daysPerWeek*48+minutesEachWay*2/60*daysPerWeek*48*timeValuePerHour;return{annualMiles,drivingCost,parkingCost,timeHours,timeValue,totalCost,remoteSaving:fullCost-totalCost};",
    "inputs": [
      {
        "name": "roundTripMiles",
        "type": "number",
        "default": 30,
        "min": 0,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "daysPerWeek",
        "type": "number",
        "default": 5,
        "min": 1,
        "max": 7,
        "step": 1
      },
      {
        "name": "costPerMile",
        "type": "number",
        "default": 0.76,
        "min": 0,
        "max": 5,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "parkingPerDay",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "minutesEachWay",
        "type": "number",
        "default": 35,
        "min": 0,
        "max": 300,
        "step": 5,
        "slider": true
      },
      {
        "name": "timeValuePerHour",
        "type": "number",
        "default": 30,
        "min": 0,
        "max": 1000,
        "step": 5,
        "slider": true
      },
      {
        "name": "remoteDays",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 7,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "annualMiles",
        "precision": 0,
        "unit": "mi"
      },
      {
        "name": "drivingCost",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "parkingCost",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "timeHours",
        "precision": 0,
        "unit": "h"
      },
      {
        "name": "timeValue",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "totalCost",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "remoteSaving",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
