[ BENCHMARKS / v5.0 / TASKS / 36_black_scholes_c ]

Black-Scholes European call price in C.

Black-Scholes European call prices from stdin, to 1e-3 per price.

Unit
36_black_scholes_c
Category
Mathematical FinanceOption pricing
Language
C
Difficulty
Medium600 s wall clock (10 min)
Origin
From v4, upgraded
Ranked rows passed
7/7single seed each

The prompt

The agent receives exactly this text as its task, verbatim. The harness adds its own system prompt and, in some campaign arms, guidance of its own; the harness chapter describes those. The task’s setup also writes the files its working directory starts with (a worked sample, a repository or a service, where the prompt names them); they are not reproduced here.

Prompt · 36_black_scholes_c
Create /tmp/eval_bs/bs.c — Read from stdin: line 1 is the number of cases C (1 <= C <= 1000). Each next line is 'S K T r sigma' (5 floats: spot, strike, time-to-expiry in years, risk-free rate, volatility; S, K, T, sigma > 0 and r >= 0). For each line output, on its own line, the Black-Scholes European call price c = S*N(d1) - K*exp(-r*T)*N(d2) where d1 = (ln(S/K) + (r + sigma^2/2)*T) / (sigma*sqrt(T)), d2 = d1 - sigma*sqrt(T), and N(.) is the standard normal CDF. Format to 4 decimals. If your stdlib lacks erf, use the Abramowitz & Stegun 7.1.26 approximation (p=0.3275911, a1=0.254829592, a2=-0.284496736, a3=1.421413741, a4=-1.453152027, a5=1.061405429). Grading runs hidden cases in this format with an absolute tolerance of 1e-3 per price; /tmp/eval_bs/sample_input.txt and /tmp/eval_bs/sample_output.txt are a worked sample. Compile with `gcc -O2 -std=c11 -Wall -Wextra -o bs bs.c -lm`.

What it tests and why it is in the suite

What it asks. Black-Scholes European call prices from stdin, to 1e-3 per price.

Why it is here. A six-language v4 family, upgraded for v5: its tests moved into the validator as seeded hidden cases, the expected-output files for those cases left the agent’s directory, and the Zig prompt lost its API tutoring.

The same problem in 6 languages. Each port is its own unit and asks the same question; SOLVE counts the problem once, and LANG counts how far a solution carried across its ports.

In the suite README: evals/README.md:134

How it is graded

The validator holds its test cases where the agent cannot read them, and runs them against what the agent left on disk once it stops. Since the upgrade its cases are generated from a seed and no expected output for them is in the agent’s directory (the worked sample the prompt names is only a sample); a mismatch reports only the failing case’s index. The unit was proven like the new ones (reference passes; wrong, empty, leaking and, where timed, slow solutions fail) and passed the same adversarial review.

Upstream: the prover’s controls · one unit’s life cycle · why v5 is built this way

How each ranked run did

One run per board row, the DGX Spark pair first, then the RTX 5090, then the gold standard. Each is a single seed: a pass or a fail on one unit is one draw, and a difference between two rows on one unit says little on its own. Claude Opus 5.5 is the unranked reference, in its own scaffold.

DGX Spark pair

One RTX 5090

Gold standard · unranked

  • Claude Opus 5.5Claude Code tools, no turn cap, 2× wallPassedPassed the validator.