> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meerietechnology.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Formulas and model code

> Write calculations, use the function library, and see the code the engine runs.

## Writing a formula

Open a calculation box in the [influence diagram](https://docs.meerietechnology.com/structure/influence-diagram.md) to write its formula. Boxes with arrows into it appear as inputs you can insert with one click. Using a variable draws its arrow, and dropping it removes the arrow.

Formulas can only use a short **approved list** of arithmetic and helper functions. This keeps the model safe to edit, including by an AI assistant.

## Distribution function library

Instead of a range, an estimate can be defined by a function from the distribution function library, for example when you know the shape of an uncertainty from your data.

## Model code

**Analyst tools → Advanced: model code** shows every formula as the code the engine runs. Use it to review the whole model in one place.

## Combining formulas with options

Options can carry settings that change a formula's result, so the same structure compares different choices. Properties marked **in model** feed the calculation.

> [!TIP]
>
> If a formula gets long, split it into several calculation boxes. Smaller boxes are easier to check and show up separately in the results.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.