FAILURE MAP
← Case archive

FA-61556 / Options payoff and settlement / Open access

European option value with continuous dividend yield: the put formula swaps d1 and d2 · case 01

Puts violate put-call parity.

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

ROOT CAUSE

The put uses N(-d1) on the strike leg and N(-d2) on the spot leg.

THE FAILURE

The put uses N(-d1) on the strike leg and N(-d2) on the spot leg.

Unsuccessful approach: Swapping the discount rates instead leaves the put wrong when r differs from q.

Case contract

Inputs kind, spot S, strike K, rate r, dividend yield q, volatility sigma and calendar days to expiry. T = days/365. At days == 0 return intrinsic value. Otherwise d1 = (ln(S/K) + (r - q + sigma^2/2)T)/(sigma sqrt T), d2 = d1 - sigma sqrt T, call = S e^{-qT} N(d1) - K e^{-rT} N(d2), put = K e^{-rT} N(-d2) - S e^{-qT} N(-d1). Round to 6.

Why this case matters

Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(kind, S, K, r, q, sigma, days):
    def N(x):
        return 0.5 * (1 + math.erf(x / math.sqrt(2)))
    T = days / 365
    if days == 0:
        return round(max(S - K, 0.0) if kind == 'C' else max(K - S, 0.0), 6)
    d1 = (math.log(S / K) + (r - q + 0.5 * sigma ** 2) * T) / (sigma * math.sqrt(T))
    d2 = d1 - sigma * math.sqrt(T)
    if kind == 'C':
        v = S * math.exp(-q * T) * N(d1) - K * math.exp(-r * T) * N(d2)
    else:
        v = K * math.exp(-r * T) * N(-d1) - S * math.exp(-q * T) * N(-d2)
    return round(v, 6)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression put probability terms 1', ['P', 100.0, 95.0, 0.05, 0.03, 0.2, 91], 1.722771], ['regression put probability terms 2', ['P', 90.0, 95.0, 0.0, 0.0, 0.1, 365], 6.71447], ['partial repair probe 1', ['P', 100.0, 105.0, 0.05, 0.0, 0.1, 1], 4.985617], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.015, 0.1, 1], 15.003699], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 100.0, 95.0, 0.05, 0.0, 0.2, 182], 9.862004], ['normal control 2', ['P', 110.0, 95.0, 0.0, 0.03, 0.1, 7], 0.0]], [['regression put probability terms 1', ['P', 100.0, 100.0, 0.05, 0.015, 0.2, 365], 6.135286], ['regression put probability terms 2', ['P', 110.0, 105.0, 0.0, 0.0, 0.35, 30], 2.255177], ['partial repair probe 1', ['P', 90.0, 95.0, 0.02, 0.0, 0.1, 1], 4.994795], ['partial repair probe 2', ['P', 100.0, 105.0, 0.05, 0.0, 0.1, 1], 4.985617], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 90.0, 105.0, 0.05, 0.03, 0.35, 30], 0.27202], ['normal control 2', ['C', 90.0, 100.0, 0.05, 0.0, 0.1, 365], 1.680636]], [['regression put probability terms 1', ['P', 110.0, 100.0, 0.0, 0.0, 0.1, 182], 0.302927], ['regression put probability terms 2', ['P', 110.0, 95.0, 0.05, 0.0, 0.1, 182], 0.017745], ['partial repair probe 1', ['P', 90.0, 105.0, 0.0, 0.015, 0.1, 1], 15.003699], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.03, 0.1, 7], 15.051766], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 110.0, 95.0, 0.02, 0.0, 0.35, 730], 30.382734], ['normal control 2', ['P', 110.0, 95.0, 0.0, 0.0, 0.2, 1], 0.0]], [['regression put probability terms 1', ['P', 100.0, 100.0, 0.02, 0.0, 0.1, 365], 3.036848], ['regression put probability terms 2', ['P', 100.0, 105.0, 0.02, 0.0, 0.1, 182], 5.274405], ['partial repair probe 1', ['P', 90.0, 105.0, 0.02, 0.03, 0.2, 1], 15.001644], ['partial repair probe 2', ['P', 90.0, 95.0, 0.02, 0.015, 0.1, 1], 4.998493], ['boundary control 1', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 100.0, 100.0, 0.05, 0.015, 0.35, 0], 0.0], ['normal control 2', ['C', 90.0, 105.0, 0.05, 0.0, 0.35, 182], 4.510431]], [['regression put probability terms 1', ['P', 110.0, 100.0, 0.02, 0.0, 0.2, 730], 5.917793], ['regression put probability terms 2', ['P', 90.0, 105.0, 0.05, 0.0, 0.2, 182], 13.737285], ['partial repair probe 1', ['P', 90.0, 100.0, 0.02, 0.015, 0.1, 1], 9.998219], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.015, 0.35, 1], 15.003699], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 90.0, 95.0, 0.05, 0.015, 0.35, 365], 11.600139], ['normal control 2', ['C', 90.0, 100.0, 0.02, 0.0, 0.2, 0], 0.0]]]
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
regression put probability terms 1-4.8380151.722771Failed
regression put probability terms 20.3395346.71447Failed
partial repair probe 14.9856174.985617Passed
partial repair probe 215.00369915.003699Passed
boundary control 110.010.0Passed
boundary control 210.010.0Passed
normal control 19.8620049.862004Passed
normal control 20.00.0Passed

SHA-256 / aae695e11e5ae1cf90f436a75ec9d56d604200bb35e65e4343de13b91d6c3194

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(kind, S, K, r, q, sigma, days):
    def N(x):
        return 0.5 * (1 + math.erf(x / math.sqrt(2)))
    T = days / 365
    if days == 0:
        return round(max(S - K, 0.0) if kind == 'C' else max(K - S, 0.0), 6)
    d1 = (math.log(S / K) + (r - q + 0.5 * sigma ** 2) * T) / (sigma * math.sqrt(T))
    d2 = d1 - sigma * math.sqrt(T)
    if kind == 'C':
        v = S * math.exp(-q * T) * N(d1) - K * math.exp(-r * T) * N(d2)
    else:
        v = K * math.exp(-q * T) * N(-d2) - S * math.exp(-r * T) * N(-d1)
    return round(v, 6)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression put probability terms 1', ['P', 100.0, 95.0, 0.05, 0.03, 0.2, 91], 1.722771], ['regression put probability terms 2', ['P', 90.0, 95.0, 0.0, 0.0, 0.1, 365], 6.71447], ['partial repair probe 1', ['P', 100.0, 105.0, 0.05, 0.0, 0.1, 1], 4.985617], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.015, 0.1, 1], 15.003699], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 100.0, 95.0, 0.05, 0.0, 0.2, 182], 9.862004], ['normal control 2', ['P', 110.0, 95.0, 0.0, 0.03, 0.1, 7], 0.0]], [['regression put probability terms 1', ['P', 100.0, 100.0, 0.05, 0.015, 0.2, 365], 6.135286], ['regression put probability terms 2', ['P', 110.0, 105.0, 0.0, 0.0, 0.35, 30], 2.255177], ['partial repair probe 1', ['P', 90.0, 95.0, 0.02, 0.0, 0.1, 1], 4.994795], ['partial repair probe 2', ['P', 100.0, 105.0, 0.05, 0.0, 0.1, 1], 4.985617], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 90.0, 105.0, 0.05, 0.03, 0.35, 30], 0.27202], ['normal control 2', ['C', 90.0, 100.0, 0.05, 0.0, 0.1, 365], 1.680636]], [['regression put probability terms 1', ['P', 110.0, 100.0, 0.0, 0.0, 0.1, 182], 0.302927], ['regression put probability terms 2', ['P', 110.0, 95.0, 0.05, 0.0, 0.1, 182], 0.017745], ['partial repair probe 1', ['P', 90.0, 105.0, 0.0, 0.015, 0.1, 1], 15.003699], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.03, 0.1, 7], 15.051766], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 110.0, 95.0, 0.02, 0.0, 0.35, 730], 30.382734], ['normal control 2', ['P', 110.0, 95.0, 0.0, 0.0, 0.2, 1], 0.0]], [['regression put probability terms 1', ['P', 100.0, 100.0, 0.02, 0.0, 0.1, 365], 3.036848], ['regression put probability terms 2', ['P', 100.0, 105.0, 0.02, 0.0, 0.1, 182], 5.274405], ['partial repair probe 1', ['P', 90.0, 105.0, 0.02, 0.03, 0.2, 1], 15.001644], ['partial repair probe 2', ['P', 90.0, 95.0, 0.02, 0.015, 0.1, 1], 4.998493], ['boundary control 1', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 100.0, 100.0, 0.05, 0.015, 0.35, 0], 0.0], ['normal control 2', ['C', 90.0, 105.0, 0.05, 0.0, 0.35, 182], 4.510431]], [['regression put probability terms 1', ['P', 110.0, 100.0, 0.02, 0.0, 0.2, 730], 5.917793], ['regression put probability terms 2', ['P', 90.0, 105.0, 0.05, 0.0, 0.2, 182], 13.737285], ['partial repair probe 1', ['P', 90.0, 100.0, 0.02, 0.015, 0.1, 1], 9.998219], ['partial repair probe 2', ['P', 90.0, 105.0, 0.0, 0.015, 0.35, 1], 15.003699], ['boundary control 1', ['P', 90.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['boundary control 2', ['C', 110.0, 100.0, 0.05, 0.0, 0.2, 0], 10.0], ['normal control 1', ['C', 90.0, 95.0, 0.05, 0.015, 0.35, 365], 11.600139], ['normal control 2', ['C', 90.0, 100.0, 0.02, 0.0, 0.2, 0], 0.0]]]
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
regression put probability terms 11.9984131.722771Failed
regression put probability terms 26.714476.71447Passed
partial repair probe 15.0136984.985617Failed
partial repair probe 214.99568515.003699Failed
boundary control 110.010.0Passed
boundary control 210.010.0Passed
normal control 19.8620049.862004Passed
normal control 20.00.0Passed

SHA-256 / c1d0749548d25a61f6ccfbc980ee2fde645a085b0a02ec9c11b3968bcf319d04

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

A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any exchange or clearing rulebook. 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:56.394910+00:00.

Case digest / e38b7ccf15604285d3d553911bde4ce4ee18c26ebaf85085d8968dd3d0446b7c