FA-70891 / Weather index computation / Open access
Magnus dew point with ice branch: relative humidity fraction · case 01
Dew points exceed the air temperature for every humid reading.
ROOT CAUSE
The Magnus log term uses RH in percent rather than as a fraction.
THE FAILURE
The Magnus log term uses RH in percent rather than as a fraction.
Unsuccessful approach: Converting to a fraction but using log10 still mis-scales the humidity term.
Case contract
Input temperature in degC and RH in percent. RH <= 0 or RH > 100 returns None. Use Magnus constants a=17.62, b=243.12 when T >= 0 and a=22.46, b=272.62 below freezing; g = ln(RH/100) + aT/(b+T); dew/frost point = b*g/(a-g) rounded to 0.01.
Why this case matters
Dew and frost point drive fog, icing and frost forecasts.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(t_c, rh):
if rh <= 0 or rh > 100:
return None
a, b = (17.62, 243.12) if t_c >= 0 else (22.46, 272.62)
g = math.log(rh) + a * t_c / (b + t_c)
return round(b * g / (a - g), 2)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['-20 C at 0% RH', [-20, 0], None], ['-20 C at 0.5% RH', [-20, 0.5], -65.32], ['-20 C at 5% RH', [-20, 5], -47.79], ['-20 C at 30% RH', [-20, 30], -31.95], ['-20 C at 50% RH', [-20, 50], -27.02], ['-20 C at 80% RH', [-20, 80], -22.3], ['-20 C at 100% RH', [-20, 100], -20.0], ['-20 C at 104% RH', [-20, 104], None]], [['-20 C at 50% RH', [-20, 50], -27.02], ['-20 C at 104% RH', [-20, 104], None], ['-5 C at 0% RH', [-5, 0], None], ['-5 C at 0.5% RH', [-5, 0.5], -55.32], ['-5 C at 5% RH', [-5, 5], -35.98], ['-5 C at 30% RH', [-5, 30], -18.38], ['-5 C at 50% RH', [-5, 50], -12.87], ['-5 C at 80% RH', [-5, 80], -7.58]], [['-5 C at 0.5% RH', [-5, 0.5], -55.32], ['-5 C at 100% RH', [-5, 100], -5.0], ['-5 C at 104% RH', [-5, 104], None], ['-0.5 C at 0% RH', [-0.5, 0], None], ['-0.5 C at 0.5% RH', [-0.5, 0.5], -52.36], ['-0.5 C at 5% RH', [-0.5, 5], -32.47], ['-0.5 C at 30% RH', [-0.5, 30], -14.32], ['-0.5 C at 50% RH', [-0.5, 50], -8.63]], [['-5 C at 50% RH', [-5, 50], -12.87], ['-0.5 C at 80% RH', [-0.5, 80], -3.17], ['-0.5 C at 100% RH', [-0.5, 100], -0.5], ['-0.5 C at 104% RH', [-0.5, 104], None], ['0 C at 0% RH', [0, 0], None], ['0 C at 0.5% RH', [0, 0.5], -56.21], ['0 C at 5% RH', [0, 5], -35.33], ['0 C at 30% RH', [0, 30], -15.55]], [['-0.5 C at 0.5% RH', [-0.5, 0.5], -52.36], ['0 C at 50% RH', [0, 50], -9.2], ['0 C at 80% RH', [0, 80], -3.04], ['0 C at 100% RH', [0, 100], 0.0], ['0 C at 104% RH', [0, 104], None], ['0.5 C at 0% RH', [0.5, 0], None], ['0.5 C at 0.5% RH', [0.5, 0.5], -55.91], ['0.5 C at 5% RH', [0.5, 5], -34.96]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| -20 C at 0% RH | None | None | Passed |
| -20 C at 0.5% RH | -27.02 | -65.32 | Failed |
| -20 C at 5% RH | -2.03 | -47.79 | Failed |
| -20 C at 30% RH | 21.23 | -31.95 | Failed |
| -20 C at 50% RH | 28.62 | -27.02 | Failed |
| -20 C at 80% RH | 35.75 | -22.3 | Failed |
| -20 C at 100% RH | 39.26 | -20.0 | Failed |
| -20 C at 104% RH | None | None | Passed |
SHA-256 / 26cc6bf58f43b02fb2155703c91f16f28184e4d2960488518f648543581363df
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, rh):
if rh <= 0 or rh > 100:
return None
a, b = (17.62, 243.12) if t_c >= 0 else (22.46, 272.62)
g = math.log10(rh / 100.0) + a * t_c / (b + t_c)
return round(b * g / (a - g), 2)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['-20 C at 0% RH', [-20, 0], None], ['-20 C at 0.5% RH', [-20, 0.5], -65.32], ['-20 C at 5% RH', [-20, 5], -47.79], ['-20 C at 30% RH', [-20, 30], -31.95], ['-20 C at 50% RH', [-20, 50], -27.02], ['-20 C at 80% RH', [-20, 80], -22.3], ['-20 C at 100% RH', [-20, 100], -20.0], ['-20 C at 104% RH', [-20, 104], None]], [['-20 C at 50% RH', [-20, 50], -27.02], ['-20 C at 104% RH', [-20, 104], None], ['-5 C at 0% RH', [-5, 0], None], ['-5 C at 0.5% RH', [-5, 0.5], -55.32], ['-5 C at 5% RH', [-5, 5], -35.98], ['-5 C at 30% RH', [-5, 30], -18.38], ['-5 C at 50% RH', [-5, 50], -12.87], ['-5 C at 80% RH', [-5, 80], -7.58]], [['-5 C at 0.5% RH', [-5, 0.5], -55.32], ['-5 C at 100% RH', [-5, 100], -5.0], ['-5 C at 104% RH', [-5, 104], None], ['-0.5 C at 0% RH', [-0.5, 0], None], ['-0.5 C at 0.5% RH', [-0.5, 0.5], -52.36], ['-0.5 C at 5% RH', [-0.5, 5], -32.47], ['-0.5 C at 30% RH', [-0.5, 30], -14.32], ['-0.5 C at 50% RH', [-0.5, 50], -8.63]], [['-5 C at 50% RH', [-5, 50], -12.87], ['-0.5 C at 80% RH', [-0.5, 80], -3.17], ['-0.5 C at 100% RH', [-0.5, 100], -0.5], ['-0.5 C at 104% RH', [-0.5, 104], None], ['0 C at 0% RH', [0, 0], None], ['0 C at 0.5% RH', [0, 0.5], -56.21], ['0 C at 5% RH', [0, 5], -35.33], ['0 C at 30% RH', [0, 30], -15.55]], [['-0.5 C at 0.5% RH', [-0.5, 0.5], -52.36], ['0 C at 50% RH', [0, 50], -9.2], ['0 C at 80% RH', [0, 80], -3.04], ['0 C at 100% RH', [0, 100], 0.0], ['0 C at 104% RH', [0, 104], None], ['0.5 C at 0% RH', [0.5, 0], None], ['0.5 C at 0.5% RH', [0.5, 0.5], -55.91], ['0.5 C at 5% RH', [0.5, 5], -34.96]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| -20 C at 0% RH | None | None | Passed |
| -20 C at 0.5% RH | -41.9 | -65.32 | Failed |
| -20 C at 5% RH | -32.87 | -47.79 | Failed |
| -20 C at 30% RH | -25.33 | -31.95 | Failed |
| -20 C at 50% RH | -23.1 | -27.02 | Failed |
| -20 C at 80% RH | -21.01 | -22.3 | Failed |
| -20 C at 100% RH | -20.0 | -20.0 | Passed |
| -20 C at 104% RH | None | None | Passed |
SHA-256 / db47e62d3e1d570dcca16fda5de2989e3f5c1e61303474f84b080def0b43fe52
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.866494+00:00.
Case digest / 8fc9d3135bf49895016fa27f21158bd40fe6497d733fe2394e2ec90c47207e11