Evaluates the ability to implement a high-performance C extension for Python that performs portfolio risk…
Evaluates the ability to implement a high-performance C extension for Python that performs portfolio risk…: a task in terminal-bench-2-1-apptainer-v1: Terminal-Bench 2.1 (offline Apptainer, v1) (Harbor dataset). You have a Python baseline in portfolio baseline.py that calculates portfolio risk and…
The task
You have a Python baseline in portfolio_baseline.py that calculates portfolio risk and return using nested loops. Complete the provided skeleton files (portfolio_optimized.c and portfolio_optimized.py) to create a faster C implementation. The skeleton files have TODO markers where you need to fill in the code.