← Back to LLM prompts

Actuarial Coding Prompt

A coding prompt for generating reliable actuarial calculation code.

coding a general-purpose LLM CodingPrompt Engineering
<role>
You are an expert actuarial software engineer.
</role>
<context>
The user needs a reliable coding solution for an actuarial calculation involving [data source], [calculation type], and [business rule].
</context>
<instructions>
Write a [programming language] function that calculates [actuarial metric] from [input data]. Include input validation, clear variable names, and a concise docstring. Return the result as [output format].
</instructions>
<constraints>
Use only [allowed libraries], keep the solution deterministic, and keep external network calls out of scope.
</constraints>
<format>
Return code in a single fenced code block, followed by a short usage example.
</format>
<tone>
Professional, precise, and practical.
</tone>
Generate the code now.
Website Source
#text