FAILURE MAP
← Case archive

FA-70906 / Weather index computation / Open access

Humidex with discomfort band: integer rounding · case 01

Published humidex is one point low about half the time and can land in a milder band.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The humidex is truncated instead of rounded half up.

VERIFIED REPAIR

Round with floor(H + 0.5).

Unsuccessful approach: Using ceil raises every fractional value, overstating the index.

Case contract

Input air temperature and dew point in degC. If dew point exceeds air temperature return None. e = 6.11*exp(5417.7530*(1/273.16 - 1/(273.15+Td))); H = T + 0.5555*(e - 10); report the humidex rounded half up to an integer and a band on that integer: <30 comfortable, 30-39 some discomfort, 40-45 great discomfort, 46-53 dangerous, >=54 heat stroke imminent.

Why this case matters

Summer heat bulletins publish humidex with a discomfort band.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(t_c, td_c):
    if td_c > t_c:
        return None
    e = 6.11 * math.exp(5417.7530 * (1 / 273.16 - 1 / (273.15 + td_c)))
    h = t_c + 0.5555 * (e - 10.0)
    hx = int(h)
    if hx < 30:
        band = "comfortable"
    elif hx <= 39:
        band = "some discomfort"
    elif hx <= 45:
        band = "great discomfort"
    elif hx <= 53:
        band = "dangerous"
    else:
        band = "heat stroke imminent"
    return [hx, band]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['air 20 C dew point 5 C', [20, 5], [19, 'comfortable']], ['air 20 C dew point 12 C', [20, 12], [22, 'comfortable']], ['air 20 C dew point 18 C', [20, 18], [26, 'comfortable']], ['air 20 C dew point 20 C', [20, 20], [28, 'comfortable']], ['air 20 C dew point 22 C', [20, 22], None], ['air 20 C dew point 24 C', [20, 24], None], ['air 20 C dew point 26 C', [20, 26], None], ['air 20 C dew point 28 C', [20, 28], None]], [['air 20 C dew point 28 C', [20, 28], None], ['air 20 C dew point 30 C', [20, 30], None], ['air 20 C dew point 36 C', [20, 36], None], ['air 20 C dew point 41 C', [20, 41], None], ['air 25 C dew point 5 C', [25, 5], [24, 'comfortable']], ['air 25 C dew point 12 C', [25, 12], [27, 'comfortable']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']]], [['air 25 C dew point 20 C', [25, 20], [33, 'some discomfort']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 25 C dew point 24 C', [25, 24], [36, 'some discomfort']], ['air 25 C dew point 26 C', [25, 26], None], ['air 25 C dew point 28 C', [25, 28], None], ['air 25 C dew point 30 C', [25, 30], None], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 30 C', [30, 30], [49, 'dangerous']]], [['air 25 C dew point 41 C', [25, 41], None], ['air 28 C dew point 5 C', [28, 5], [27, 'comfortable']], ['air 28 C dew point 12 C', [28, 12], [30, 'some discomfort']], ['air 28 C dew point 18 C', [28, 18], [34, 'some discomfort']], ['air 28 C dew point 20 C', [28, 20], [36, 'some discomfort']], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 18 C', [30, 18], [36, 'some discomfort']], ['air 33 C dew point 30 C', [33, 30], [52, 'dangerous']]], [['air 28 C dew point 26 C', [28, 26], [41, 'great discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']], ['air 28 C dew point 30 C', [28, 30], None], ['air 28 C dew point 36 C', [28, 36], None], ['air 28 C dew point 41 C', [28, 41], None], ['air 30 C dew point 5 C', [30, 5], [29, 'comfortable']], ['air 33 C dew point 12 C', [33, 12], [35, 'some discomfort']], ['air 35 C dew point 30 C', [35, 30], [54, 'heat stroke imminent']]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
air 20 C dew point 5 C[19, 'comfortable'][19, 'comfortable']Passed
air 20 C dew point 12 C[22, 'comfortable'][22, 'comfortable']Passed
air 20 C dew point 18 C[26, 'comfortable'][26, 'comfortable']Passed
air 20 C dew point 20 C[27, 'comfortable'][28, 'comfortable']Failed
air 20 C dew point 22 CNoneNonePassed
air 20 C dew point 24 CNoneNonePassed
air 20 C dew point 26 CNoneNonePassed
air 20 C dew point 28 CNoneNonePassed

SHA-256 / 6668321637cb23ecedc086c8eb67ef53910c73d2b564d7e4142fa950701ef527

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(t_c, td_c):
    if td_c > t_c:
        return None
    e = 6.11 * math.exp(5417.7530 * (1 / 273.16 - 1 / (273.15 + td_c)))
    h = t_c + 0.5555 * (e - 10.0)
    hx = int(math.ceil(h))
    if hx < 30:
        band = "comfortable"
    elif hx <= 39:
        band = "some discomfort"
    elif hx <= 45:
        band = "great discomfort"
    elif hx <= 53:
        band = "dangerous"
    else:
        band = "heat stroke imminent"
    return [hx, band]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['air 20 C dew point 5 C', [20, 5], [19, 'comfortable']], ['air 20 C dew point 12 C', [20, 12], [22, 'comfortable']], ['air 20 C dew point 18 C', [20, 18], [26, 'comfortable']], ['air 20 C dew point 20 C', [20, 20], [28, 'comfortable']], ['air 20 C dew point 22 C', [20, 22], None], ['air 20 C dew point 24 C', [20, 24], None], ['air 20 C dew point 26 C', [20, 26], None], ['air 20 C dew point 28 C', [20, 28], None]], [['air 20 C dew point 28 C', [20, 28], None], ['air 20 C dew point 30 C', [20, 30], None], ['air 20 C dew point 36 C', [20, 36], None], ['air 20 C dew point 41 C', [20, 41], None], ['air 25 C dew point 5 C', [25, 5], [24, 'comfortable']], ['air 25 C dew point 12 C', [25, 12], [27, 'comfortable']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']]], [['air 25 C dew point 20 C', [25, 20], [33, 'some discomfort']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 25 C dew point 24 C', [25, 24], [36, 'some discomfort']], ['air 25 C dew point 26 C', [25, 26], None], ['air 25 C dew point 28 C', [25, 28], None], ['air 25 C dew point 30 C', [25, 30], None], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 30 C', [30, 30], [49, 'dangerous']]], [['air 25 C dew point 41 C', [25, 41], None], ['air 28 C dew point 5 C', [28, 5], [27, 'comfortable']], ['air 28 C dew point 12 C', [28, 12], [30, 'some discomfort']], ['air 28 C dew point 18 C', [28, 18], [34, 'some discomfort']], ['air 28 C dew point 20 C', [28, 20], [36, 'some discomfort']], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 18 C', [30, 18], [36, 'some discomfort']], ['air 33 C dew point 30 C', [33, 30], [52, 'dangerous']]], [['air 28 C dew point 26 C', [28, 26], [41, 'great discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']], ['air 28 C dew point 30 C', [28, 30], None], ['air 28 C dew point 36 C', [28, 36], None], ['air 28 C dew point 41 C', [28, 41], None], ['air 30 C dew point 5 C', [30, 5], [29, 'comfortable']], ['air 33 C dew point 12 C', [33, 12], [35, 'some discomfort']], ['air 35 C dew point 30 C', [35, 30], [54, 'heat stroke imminent']]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
air 20 C dew point 5 C[20, 'comfortable'][19, 'comfortable']Failed
air 20 C dew point 12 C[23, 'comfortable'][22, 'comfortable']Failed
air 20 C dew point 18 C[27, 'comfortable'][26, 'comfortable']Failed
air 20 C dew point 20 C[28, 'comfortable'][28, 'comfortable']Passed
air 20 C dew point 22 CNoneNonePassed
air 20 C dew point 24 CNoneNonePassed
air 20 C dew point 26 CNoneNonePassed
air 20 C dew point 28 CNoneNonePassed

SHA-256 / 41497d78cdaf6eaef826941fb9eb1c0f54fa362b5ea9c16d15d6ee58939e9fe4

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(t_c, td_c):
    if td_c > t_c:
        return None
    e = 6.11 * math.exp(5417.7530 * (1 / 273.16 - 1 / (273.15 + td_c)))
    h = t_c + 0.5555 * (e - 10.0)
    hx = int(math.floor(h + 0.5))
    if hx < 30:
        band = "comfortable"
    elif hx <= 39:
        band = "some discomfort"
    elif hx <= 45:
        band = "great discomfort"
    elif hx <= 53:
        band = "dangerous"
    else:
        band = "heat stroke imminent"
    return [hx, band]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['air 20 C dew point 5 C', [20, 5], [19, 'comfortable']], ['air 20 C dew point 12 C', [20, 12], [22, 'comfortable']], ['air 20 C dew point 18 C', [20, 18], [26, 'comfortable']], ['air 20 C dew point 20 C', [20, 20], [28, 'comfortable']], ['air 20 C dew point 22 C', [20, 22], None], ['air 20 C dew point 24 C', [20, 24], None], ['air 20 C dew point 26 C', [20, 26], None], ['air 20 C dew point 28 C', [20, 28], None]], [['air 20 C dew point 28 C', [20, 28], None], ['air 20 C dew point 30 C', [20, 30], None], ['air 20 C dew point 36 C', [20, 36], None], ['air 20 C dew point 41 C', [20, 41], None], ['air 25 C dew point 5 C', [25, 5], [24, 'comfortable']], ['air 25 C dew point 12 C', [25, 12], [27, 'comfortable']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']]], [['air 25 C dew point 20 C', [25, 20], [33, 'some discomfort']], ['air 25 C dew point 22 C', [25, 22], [34, 'some discomfort']], ['air 25 C dew point 24 C', [25, 24], [36, 'some discomfort']], ['air 25 C dew point 26 C', [25, 26], None], ['air 25 C dew point 28 C', [25, 28], None], ['air 25 C dew point 30 C', [25, 30], None], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 30 C', [30, 30], [49, 'dangerous']]], [['air 25 C dew point 41 C', [25, 41], None], ['air 28 C dew point 5 C', [28, 5], [27, 'comfortable']], ['air 28 C dew point 12 C', [28, 12], [30, 'some discomfort']], ['air 28 C dew point 18 C', [28, 18], [34, 'some discomfort']], ['air 28 C dew point 20 C', [28, 20], [36, 'some discomfort']], ['air 28 C dew point 22 C', [28, 22], [37, 'some discomfort']], ['air 30 C dew point 18 C', [30, 18], [36, 'some discomfort']], ['air 33 C dew point 30 C', [33, 30], [52, 'dangerous']]], [['air 28 C dew point 26 C', [28, 26], [41, 'great discomfort']], ['air 28 C dew point 28 C', [28, 28], [44, 'great discomfort']], ['air 28 C dew point 30 C', [28, 30], None], ['air 28 C dew point 36 C', [28, 36], None], ['air 28 C dew point 41 C', [28, 41], None], ['air 30 C dew point 5 C', [30, 5], [29, 'comfortable']], ['air 33 C dew point 12 C', [33, 12], [35, 'some discomfort']], ['air 35 C dew point 30 C', [35, 30], [54, 'heat stroke imminent']]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
air 20 C dew point 5 C[19, 'comfortable'][19, 'comfortable']Passed
air 20 C dew point 12 C[22, 'comfortable'][22, 'comfortable']Passed
air 20 C dew point 18 C[26, 'comfortable'][26, 'comfortable']Passed
air 20 C dew point 20 C[28, 'comfortable'][28, 'comfortable']Passed
air 20 C dew point 22 CNoneNonePassed
air 20 C dew point 24 CNoneNonePassed
air 20 C dew point 26 CNoneNonePassed
air 20 C dew point 28 CNoneNonePassed

SHA-256 / 91849a7eed750437045b7f12831a495659917dff0cc9ef065523263b9ac024bb

Verification & scope

Stipulated deterministic teaching model of an operational weather index; coefficients and thresholds are fixed by the contract and no claim of standards conformance is made. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:48:24.952082+00:00.

Case digest / 7ee15ba593e9e471f140285f22108947a7ee31b779c427ae66780572d35b7eed