FA-61291 / Bond day-count conventions / Open access
Rate conversion across day-count basis and compounding: the target is returned as a per-period rate · case 01
Semi-annual and monthly targets are divided by their frequency.
ROOT CAUSE
The inverse conversion omits the multiplication by m.
VERIFIED REPAIR
Annualize the per-period rate by multiplying by m.
Unsuccessful approach: Dividing the EAR by m ignores compounding altogether.
Case contract
Inputs a nominal rate, from/to day-count year basis (360 or 365), from/to compounding frequency (0 = continuous). First rescale the nominal rate by to_basis/from_basis, then convert compounding through the effective annual rate: EAR = (1+r/m)^m - 1 or e^r - 1; target nominal = m*((1+EAR)^(1/m)-1) or ln(1+EAR). Return rounded to 10 decimals.
Why this case matters
Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(rate, from_basis, to_basis, from_comp, to_comp):
def ear(r, m):
return math.exp(r) - 1 if m == 0 else (1 + r / m) ** m - 1
def nominal(e, m):
return math.log(1 + e) if m == 0 else (1 + e) ** (1 / m) - 1
scaled = rate * to_basis / from_basis
return round(nominal(ear(scaled, from_comp), to_comp), 10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression nominal from periodic 1', [0.03, 365, 365, 2, 2], 0.03], ['regression nominal from periodic 2', [0.08, 360, 365, 0, 12], 0.0813858553], ['partial repair probe 1', [0.15, 365, 360, 2, 2], 0.1479452055], ['partial repair probe 2', [0.08, 360, 360, 2, 2], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.0475, 360, 360, 4, 1], 0.0483528119], ['normal control 2', [0.001, 365, 365, 12, 1], 0.0010004585]], [['regression nominal from periodic 1', [0.15, 365, 360, 2, 12], 0.1435811627], ['regression nominal from periodic 2', [0.0475, 360, 360, 0, 12], 0.0475941346], ['partial repair probe 1', [0.0475, 360, 360, 2, 12], 0.0470366575], ['partial repair probe 2', [0.001, 365, 365, 4, 4], 0.001], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.15, 365, 365, 4, 1], 0.158650415], ['normal control 2', [0.0475, 360, 365, 0, 1], 0.0493382446]], [['regression nominal from periodic 1', [0.08, 360, 360, 2, 4], 0.0792156109], ['regression nominal from periodic 2', [0.0125, 365, 365, 2, 2], 0.0125], ['partial repair probe 1', [0.0125, 365, 360, 4, 4], 0.0123287671], ['partial repair probe 2', [0.0475, 360, 365, 1, 2], 0.0475934384], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 360, 2, 0], 0.0009860583], ['normal control 2', [0.03, 365, 360, 2, 0], 0.0293722984]], [['regression nominal from periodic 1', [0.0475, 360, 360, 12, 12], 0.0475], ['regression nominal from periodic 2', [0.08, 365, 360, 1, 2], 0.0774061804], ['partial repair probe 1', [0.03, 360, 360, 2, 12], 0.0298142007], ['partial repair probe 2', [0.001, 365, 365, 4, 12], 0.0009999167], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.0125, 360, 360, 2, 1], 0.0125390625], ['normal control 2', [0.001, 365, 365, 0, 0], 0.001]], [['regression nominal from periodic 1', [0.001, 365, 365, 2, 12], 0.0009997917], ['regression nominal from periodic 2', [0.03, 365, 360, 12, 4], 0.0296620603], ['partial repair probe 1', [0.03, 360, 360, 1, 12], 0.0295952373], ['partial repair probe 2', [0.08, 360, 360, 0, 4], 0.0808053601], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 365, 360, 1, 1], 0.0295890411], ['normal control 2', [0.15, 365, 365, 12, 1], 0.1607545177]]]
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 |
|---|---|---|---|
| regression nominal from periodic 1 | 0.015 | 0.03 | Failed |
| regression nominal from periodic 2 | 0.0067821546 | 0.0813858553 | Failed |
| partial repair probe 1 | 0.0739726027 | 0.1479452055 | Failed |
| partial repair probe 2 | 0.04 | 0.08 | Failed |
| boundary control 1 | 0.0506944444 | 0.0506944444 | Passed |
| boundary control 2 | 0.05 | 0.05 | Passed |
| normal control 1 | 0.0483528119 | 0.0483528119 | Passed |
| normal control 2 | 0.0010004585 | 0.0010004585 | Passed |
SHA-256 / d99ff7dfe4790736dcb11a3d1dce986d402c2d09193710f4894b2b4e51a98c29
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(rate, from_basis, to_basis, from_comp, to_comp):
def ear(r, m):
return math.exp(r) - 1 if m == 0 else (1 + r / m) ** m - 1
def nominal(e, m):
return math.log(1 + e) if m == 0 else e / m
scaled = rate * to_basis / from_basis
return round(nominal(ear(scaled, from_comp), to_comp), 10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression nominal from periodic 1', [0.03, 365, 365, 2, 2], 0.03], ['regression nominal from periodic 2', [0.08, 360, 365, 0, 12], 0.0813858553], ['partial repair probe 1', [0.15, 365, 360, 2, 2], 0.1479452055], ['partial repair probe 2', [0.08, 360, 360, 2, 2], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.0475, 360, 360, 4, 1], 0.0483528119], ['normal control 2', [0.001, 365, 365, 12, 1], 0.0010004585]], [['regression nominal from periodic 1', [0.15, 365, 360, 2, 12], 0.1435811627], ['regression nominal from periodic 2', [0.0475, 360, 360, 0, 12], 0.0475941346], ['partial repair probe 1', [0.0475, 360, 360, 2, 12], 0.0470366575], ['partial repair probe 2', [0.001, 365, 365, 4, 4], 0.001], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.15, 365, 365, 4, 1], 0.158650415], ['normal control 2', [0.0475, 360, 365, 0, 1], 0.0493382446]], [['regression nominal from periodic 1', [0.08, 360, 360, 2, 4], 0.0792156109], ['regression nominal from periodic 2', [0.0125, 365, 365, 2, 2], 0.0125], ['partial repair probe 1', [0.0125, 365, 360, 4, 4], 0.0123287671], ['partial repair probe 2', [0.0475, 360, 365, 1, 2], 0.0475934384], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 360, 2, 0], 0.0009860583], ['normal control 2', [0.03, 365, 360, 2, 0], 0.0293722984]], [['regression nominal from periodic 1', [0.0475, 360, 360, 12, 12], 0.0475], ['regression nominal from periodic 2', [0.08, 365, 360, 1, 2], 0.0774061804], ['partial repair probe 1', [0.03, 360, 360, 2, 12], 0.0298142007], ['partial repair probe 2', [0.001, 365, 365, 4, 12], 0.0009999167], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.0125, 360, 360, 2, 1], 0.0125390625], ['normal control 2', [0.001, 365, 365, 0, 0], 0.001]], [['regression nominal from periodic 1', [0.001, 365, 365, 2, 12], 0.0009997917], ['regression nominal from periodic 2', [0.03, 365, 360, 12, 4], 0.0296620603], ['partial repair probe 1', [0.03, 360, 360, 1, 12], 0.0295952373], ['partial repair probe 2', [0.08, 360, 360, 0, 4], 0.0808053601], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 365, 360, 1, 1], 0.0295890411], ['normal control 2', [0.15, 365, 365, 12, 1], 0.1607545177]]]
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 |
|---|---|---|---|
| regression nominal from periodic 1 | 0.0151125 | 0.03 | Failed |
| regression nominal from periodic 2 | 0.0070409491 | 0.0813858553 | Failed |
| partial repair probe 1 | 0.0767085757 | 0.1479452055 | Failed |
| partial repair probe 2 | 0.0408 | 0.08 | Failed |
| boundary control 1 | 0.0506944444 | 0.0506944444 | Passed |
| boundary control 2 | 0.05 | 0.05 | Passed |
| normal control 1 | 0.0483528119 | 0.0483528119 | Passed |
| normal control 2 | 0.0010004585 | 0.0010004585 | Passed |
SHA-256 / 2cc092573a7994cc47ca0a80911de0d39ab718c0eeb48af2fb070f4f50aab422
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(rate, from_basis, to_basis, from_comp, to_comp):
def ear(r, m):
return math.exp(r) - 1 if m == 0 else (1 + r / m) ** m - 1
def nominal(e, m):
return math.log(1 + e) if m == 0 else m * ((1 + e) ** (1 / m) - 1)
scaled = rate * to_basis / from_basis
return round(nominal(ear(scaled, from_comp), to_comp), 10)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression nominal from periodic 1', [0.03, 365, 365, 2, 2], 0.03], ['regression nominal from periodic 2', [0.08, 360, 365, 0, 12], 0.0813858553], ['partial repair probe 1', [0.15, 365, 360, 2, 2], 0.1479452055], ['partial repair probe 2', [0.08, 360, 360, 2, 2], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.0475, 360, 360, 4, 1], 0.0483528119], ['normal control 2', [0.001, 365, 365, 12, 1], 0.0010004585]], [['regression nominal from periodic 1', [0.15, 365, 360, 2, 12], 0.1435811627], ['regression nominal from periodic 2', [0.0475, 360, 360, 0, 12], 0.0475941346], ['partial repair probe 1', [0.0475, 360, 360, 2, 12], 0.0470366575], ['partial repair probe 2', [0.001, 365, 365, 4, 4], 0.001], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 365, 365, 0, 0], 0.05], ['normal control 1', [0.15, 365, 365, 4, 1], 0.158650415], ['normal control 2', [0.0475, 360, 365, 0, 1], 0.0493382446]], [['regression nominal from periodic 1', [0.08, 360, 360, 2, 4], 0.0792156109], ['regression nominal from periodic 2', [0.0125, 365, 365, 2, 2], 0.0125], ['partial repair probe 1', [0.0125, 365, 360, 4, 4], 0.0123287671], ['partial repair probe 2', [0.0475, 360, 365, 1, 2], 0.0475934384], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 360, 2, 0], 0.0009860583], ['normal control 2', [0.03, 365, 360, 2, 0], 0.0293722984]], [['regression nominal from periodic 1', [0.0475, 360, 360, 12, 12], 0.0475], ['regression nominal from periodic 2', [0.08, 365, 360, 1, 2], 0.0774061804], ['partial repair probe 1', [0.03, 360, 360, 2, 12], 0.0298142007], ['partial repair probe 2', [0.001, 365, 365, 4, 12], 0.0009999167], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.0125, 360, 360, 2, 1], 0.0125390625], ['normal control 2', [0.001, 365, 365, 0, 0], 0.001]], [['regression nominal from periodic 1', [0.001, 365, 365, 2, 12], 0.0009997917], ['regression nominal from periodic 2', [0.03, 365, 360, 12, 4], 0.0296620603], ['partial repair probe 1', [0.03, 360, 360, 1, 12], 0.0295952373], ['partial repair probe 2', [0.08, 360, 360, 0, 4], 0.0808053601], ['boundary control 1', [0.05, 365, 365, 0, 0], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 365, 360, 1, 1], 0.0295890411], ['normal control 2', [0.15, 365, 365, 12, 1], 0.1607545177]]]
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 |
|---|---|---|---|
| regression nominal from periodic 1 | 0.03 | 0.03 | Passed |
| regression nominal from periodic 2 | 0.0813858553 | 0.0813858553 | Passed |
| partial repair probe 1 | 0.1479452055 | 0.1479452055 | Passed |
| partial repair probe 2 | 0.08 | 0.08 | Passed |
| boundary control 1 | 0.0506944444 | 0.0506944444 | Passed |
| boundary control 2 | 0.05 | 0.05 | Passed |
| normal control 1 | 0.0483528119 | 0.0483528119 | Passed |
| normal control 2 | 0.0010004585 | 0.0010004585 | Passed |
SHA-256 / f9499f556553106090a587999cbf0a1bb268f6a3dbd5a0026819dc19e59bb76d
Verification & scope
A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any published convention text. 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:46:53.844994+00:00.
Case digest / f1c0c165ac4a41cc470eaa239b540fa1bdad4f01fe332816e7ca9e621bb3e7fb