# aquice/functools architecture

> Architecture diagram of the GitHub repository aquice/functools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aquice/functools
- Repository: https://github.com/aquice/functools

## Overview

This is a small C++ function-algebra library with a sample program that builds a symbolic expression, derives it, and prints its representation. The sampled code supports constants, identity, composite operations, trigonometric functions, and logarithms; evaluation and primitive APIs also appear in the library. Source excerpts are partial, so the graph keeps the runtime wiring to the demonstrated entry point and shared implementation file.

Main entry points: [`main.cpp`](https://github.com/aquice/functools/blob/main/main.cpp) (Example entry), [`src/function.hpp`](https://github.com/aquice/functools/blob/main/src/function.hpp) (Evaluate and represent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_example["Sample program"]
  node_main["Example entry<br/>[main.cpp]"]
end

subgraph group_library["Function algebra"]
  node_function_api["Function expressions<br/>[function.hpp]"]
  node_function_results["Evaluate and represent<br/>[function.hpp]"]
  node_calculus["Derivative and primitive<br/>[function.hpp]"]
end

node_caller(("Program caller"))

node_caller -->|"runs"| node_main
node_main -->|"builds expressions"| node_function_api
node_main -->|"requests derivative"| node_calculus
node_main -->|"prints representation"| node_function_results
node_main -.->|"evaluates"| node_function_results

click node_main "https://github.com/aquice/functools/blob/main/main.cpp"
click node_function_api "https://github.com/aquice/functools/blob/main/src/function.hpp"
click node_function_results "https://github.com/aquice/functools/blob/main/src/function.hpp"
click node_calculus "https://github.com/aquice/functools/blob/main/src/function.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main toneBlue
class node_function_api,node_function_results,node_calculus toneAmber
class node_caller toneIndigo
```

## Components

### Sample program

- [Example entry](https://github.com/aquice/functools/blob/main/main.cpp): `main.cpp`

### Function algebra

- [Function expressions](https://github.com/aquice/functools/blob/main/src/function.hpp): `src/function.hpp`
- [Evaluate and represent](https://github.com/aquice/functools/blob/main/src/function.hpp): `src/function.hpp`
- [Derivative and primitive](https://github.com/aquice/functools/blob/main/src/function.hpp): `src/function.hpp`

### Other components

- **Program caller**

## Connections

- Program caller → Example entry: runs
- Example entry → Function expressions: builds expressions
- Example entry → Derivative and primitive: requests derivative
- Example entry → Evaluate and represent: prints representation
- Example entry → Evaluate and represent: evaluates
