FA-61281 / Bond day-count conventions / Open access
Rate conversion across day-count basis and compounding: a continuous target returns the effective annual rate · case 01
Continuously compounded outputs are too high.
ROOT CAUSE
The continuous branch of the inverse conversion returns EAR without taking the logarithm.
VERIFIED REPAIR
Return ln(1 + EAR) for a continuous target.
Unsuccessful approach: Applying exp to the EAR uses the forward conversion in the inverse direction.
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 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 continuous target 1', [0.08, 365, 360, 0, 0], 0.0789041096], ['regression continuous target 2', [0.15, 360, 365, 2, 0], 0.1465783693], ['partial repair probe 1', [0.0475, 360, 360, 4, 0], 0.0472201818], ['partial repair probe 2', [0.15, 365, 365, 1, 0], 0.1397619424], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 360, 365, 2, 4], 0.0303018911], ['normal control 2', [0.0475, 360, 360, 4, 2], 0.0477820313]], [['regression continuous target 1', [0.0475, 365, 365, 1, 0], 0.0464063728], ['regression continuous target 2', [0.0125, 365, 360, 0, 0], 0.0123287671], ['partial repair probe 1', [0.08, 365, 360, 12, 0], 0.0786458304], ['partial repair probe 2', [0.0125, 360, 360, 0, 0], 0.0125], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.03, 365, 360, 1, 12], 0.0291951909], ['normal control 2', [0.0125, 365, 365, 2, 4], 0.0124805295]], [['regression continuous target 1', [0.0475, 365, 360, 1, 0], 0.0457850009], ['regression continuous target 2', [0.0475, 365, 365, 2, 0], 0.0469447124], ['partial repair probe 1', [0.08, 360, 365, 2, 0], 0.0795095171], ['partial repair probe 2', [0.0475, 360, 360, 12, 0], 0.0474062369], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.15, 365, 365, 12, 1], 0.1607545177], ['normal control 2', [0.0475, 360, 365, 0, 2], 0.0487442442]], [['regression continuous target 1', [0.001, 360, 365, 2, 0], 0.001013632], ['regression continuous target 2', [0.0125, 360, 365, 4, 0], 0.0126535759], ['partial repair probe 1', [0.001, 365, 360, 1, 0], 0.0009858153], ['partial repair probe 2', [0.001, 360, 360, 1, 0], 0.0009995003], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 365, 12, 1], 0.0010004585], ['normal control 2', [0.001, 365, 365, 1, 2], 0.0009997501]], [['regression continuous target 1', [0.0125, 365, 365, 4, 0], 0.0124805093], ['regression continuous target 2', [0.0125, 360, 365, 2, 0], 0.0126336248], ['partial repair probe 1', [0.15, 365, 365, 12, 0], 0.14907024], ['partial repair probe 2', [0.08, 365, 365, 0, 0], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.0125, 365, 360, 4, 2], 0.0123477669], ['normal control 2', [0.08, 360, 360, 0, 1], 0.0832870677]]]
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 continuous target 1 | 0.082100554 | 0.0789041096 | Failed |
| regression continuous target 2 | 0.1578656684 | 0.1465783693 | Failed |
| partial repair probe 1 | 0.0483528119 | 0.0472201818 | Failed |
| partial repair probe 2 | 0.15 | 0.1397619424 | Failed |
| boundary control 1 | 0.05 | 0.05 | Passed |
| boundary control 2 | 0.0506944444 | 0.0506944444 | Passed |
| normal control 1 | 0.0303018911 | 0.0303018911 | Passed |
| normal control 2 | 0.0477820313 | 0.0477820313 | Passed |
SHA-256 / 144793b22fa51e4fd5aae342586c62b0ef8da1a2348d4c692f19db7b23a22936
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.exp(e) - 1 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 continuous target 1', [0.08, 365, 360, 0, 0], 0.0789041096], ['regression continuous target 2', [0.15, 360, 365, 2, 0], 0.1465783693], ['partial repair probe 1', [0.0475, 360, 360, 4, 0], 0.0472201818], ['partial repair probe 2', [0.15, 365, 365, 1, 0], 0.1397619424], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 360, 365, 2, 4], 0.0303018911], ['normal control 2', [0.0475, 360, 360, 4, 2], 0.0477820313]], [['regression continuous target 1', [0.0475, 365, 365, 1, 0], 0.0464063728], ['regression continuous target 2', [0.0125, 365, 360, 0, 0], 0.0123287671], ['partial repair probe 1', [0.08, 365, 360, 12, 0], 0.0786458304], ['partial repair probe 2', [0.0125, 360, 360, 0, 0], 0.0125], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.03, 365, 360, 1, 12], 0.0291951909], ['normal control 2', [0.0125, 365, 365, 2, 4], 0.0124805295]], [['regression continuous target 1', [0.0475, 365, 360, 1, 0], 0.0457850009], ['regression continuous target 2', [0.0475, 365, 365, 2, 0], 0.0469447124], ['partial repair probe 1', [0.08, 360, 365, 2, 0], 0.0795095171], ['partial repair probe 2', [0.0475, 360, 360, 12, 0], 0.0474062369], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.15, 365, 365, 12, 1], 0.1607545177], ['normal control 2', [0.0475, 360, 365, 0, 2], 0.0487442442]], [['regression continuous target 1', [0.001, 360, 365, 2, 0], 0.001013632], ['regression continuous target 2', [0.0125, 360, 365, 4, 0], 0.0126535759], ['partial repair probe 1', [0.001, 365, 360, 1, 0], 0.0009858153], ['partial repair probe 2', [0.001, 360, 360, 1, 0], 0.0009995003], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 365, 12, 1], 0.0010004585], ['normal control 2', [0.001, 365, 365, 1, 2], 0.0009997501]], [['regression continuous target 1', [0.0125, 365, 365, 4, 0], 0.0124805093], ['regression continuous target 2', [0.0125, 360, 365, 2, 0], 0.0126336248], ['partial repair probe 1', [0.15, 365, 365, 12, 0], 0.14907024], ['partial repair probe 2', [0.08, 365, 365, 0, 0], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.0125, 365, 360, 4, 2], 0.0123477669], ['normal control 2', [0.08, 360, 360, 0, 1], 0.0832870677]]]
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 continuous target 1 | 0.0855649623 | 0.0789041096 | Failed |
| regression continuous target 2 | 0.1710088806 | 0.1465783693 | Failed |
| partial repair probe 1 | 0.0495408805 | 0.0472201818 | Failed |
| partial repair probe 2 | 0.1618342427 | 0.1397619424 | Failed |
| boundary control 1 | 0.05 | 0.05 | Passed |
| boundary control 2 | 0.0506944444 | 0.0506944444 | Passed |
| normal control 1 | 0.0303018911 | 0.0303018911 | Passed |
| normal control 2 | 0.0477820313 | 0.0477820313 | Passed |
SHA-256 / 13c97984313da47bc8ac6fd9f7a0d549d6e8842308bd2b57489bad0758b36cb5
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 continuous target 1', [0.08, 365, 360, 0, 0], 0.0789041096], ['regression continuous target 2', [0.15, 360, 365, 2, 0], 0.1465783693], ['partial repair probe 1', [0.0475, 360, 360, 4, 0], 0.0472201818], ['partial repair probe 2', [0.15, 365, 365, 1, 0], 0.1397619424], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.03, 360, 365, 2, 4], 0.0303018911], ['normal control 2', [0.0475, 360, 360, 4, 2], 0.0477820313]], [['regression continuous target 1', [0.0475, 365, 365, 1, 0], 0.0464063728], ['regression continuous target 2', [0.0125, 365, 360, 0, 0], 0.0123287671], ['partial repair probe 1', [0.08, 365, 360, 12, 0], 0.0786458304], ['partial repair probe 2', [0.0125, 360, 360, 0, 0], 0.0125], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.03, 365, 360, 1, 12], 0.0291951909], ['normal control 2', [0.0125, 365, 365, 2, 4], 0.0124805295]], [['regression continuous target 1', [0.0475, 365, 360, 1, 0], 0.0457850009], ['regression continuous target 2', [0.0475, 365, 365, 2, 0], 0.0469447124], ['partial repair probe 1', [0.08, 360, 365, 2, 0], 0.0795095171], ['partial repair probe 2', [0.0475, 360, 360, 12, 0], 0.0474062369], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.15, 365, 365, 12, 1], 0.1607545177], ['normal control 2', [0.0475, 360, 365, 0, 2], 0.0487442442]], [['regression continuous target 1', [0.001, 360, 365, 2, 0], 0.001013632], ['regression continuous target 2', [0.0125, 360, 365, 4, 0], 0.0126535759], ['partial repair probe 1', [0.001, 365, 360, 1, 0], 0.0009858153], ['partial repair probe 2', [0.001, 360, 360, 1, 0], 0.0009995003], ['boundary control 1', [0.05, 360, 360, 2, 2], 0.05], ['boundary control 2', [0.05, 360, 365, 1, 1], 0.0506944444], ['normal control 1', [0.001, 365, 365, 12, 1], 0.0010004585], ['normal control 2', [0.001, 365, 365, 1, 2], 0.0009997501]], [['regression continuous target 1', [0.0125, 365, 365, 4, 0], 0.0124805093], ['regression continuous target 2', [0.0125, 360, 365, 2, 0], 0.0126336248], ['partial repair probe 1', [0.15, 365, 365, 12, 0], 0.14907024], ['partial repair probe 2', [0.08, 365, 365, 0, 0], 0.08], ['boundary control 1', [0.05, 360, 365, 1, 1], 0.0506944444], ['boundary control 2', [0.05, 360, 360, 2, 2], 0.05], ['normal control 1', [0.0125, 365, 360, 4, 2], 0.0123477669], ['normal control 2', [0.08, 360, 360, 0, 1], 0.0832870677]]]
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 continuous target 1 | 0.0789041096 | 0.0789041096 | Passed |
| regression continuous target 2 | 0.1465783693 | 0.1465783693 | Passed |
| partial repair probe 1 | 0.0472201818 | 0.0472201818 | Passed |
| partial repair probe 2 | 0.1397619424 | 0.1397619424 | Passed |
| boundary control 1 | 0.05 | 0.05 | Passed |
| boundary control 2 | 0.0506944444 | 0.0506944444 | Passed |
| normal control 1 | 0.0303018911 | 0.0303018911 | Passed |
| normal control 2 | 0.0477820313 | 0.0477820313 | Passed |
SHA-256 / b9529d93687c014be1e5f3a3be938a3ab71cdfc5f07f2fa1d4d66fec354c1e6b
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.783360+00:00.
Case digest / d59431bb5c4f409eb8a7a68c199072b9f875b06ad0772438c4fc85bbef225cb3