SimpliPy:
Efficient Simplification of Mathematical Expressions
Publications
- Saegert & Köthe 2026, Breaking the Simplification Bottleneck in Amortized Neural Symbolic Regression (ICML 2026) https://arxiv.org/abs/2602.08885
Usage
pip install simplipy
The compiled Rust extension (
simplipy._core) is required: the inline phase (simplify, conversions, validation) runs on it exclusively, and there is no pure-Python fallback. Prebuilt wheels are published for Linux (x86_64/aarch64), macOS (x86_64/arm64) and Windows (x64) on CPython ≥ 3.12, sopip install simplipydoes not compile anything for most users. Installing from the source distribution (an unsupported platform, or--no-binary) requires a Rust toolchain (rustup, MSRV 1.83). If the extension is missing at runtime, constructing an engine raisesImportError.
import simplipy as sp
engine = sp.SimpliPyEngine.load("acj-5-4-llm", install=True) # a published ruleset artifact
# Simplify infix expressions
engine.simplify('x3 * sin(<constant> + 1) / (x3 * x3)')
# > '<constant>/x3'
# Simplify prefix expressions
engine.simplify(('/', '<constant>', '*', '/', '*', 'x3', '<constant>', 'x3', 'log', 'x3'))
# > ('/', '<constant>', 'log', 'x3')
simplify only simplifies: it answers in the form it was given -- a str in, a str
out; explicit binary prefix in, explicit binary prefix out; the engine's native tagged
form in (n-ary +/* bags are delimited: <add> ... </add>, <mul> ... </mul>), tagged
out. To change the NOTATION, convert -- to_infix / to_prefix / to_tagged are pure
syntactic conversions that never simplify -- and compose the two:
expr = ('/', '<constant>', '*', '/', '*', 'x3', '<constant>', 'x3', 'log', 'x3')
engine.to_infix(engine.simplify(expr)) # simplify, then render
# > '<constant> / log(x3)'
engine.simplify(engine.to_tagged(expr)) # convert, then simplify: the tagged answer
# > ['<mul>', '<constant>', '<div>', 'log', 'x3', '</mul>']
Normalization
The root-exported to_skeleton, to_expression, and normalize_variable_token
helpers (also available as simplipy.normalization) canonicalize an expression so
that two expressions that are "the same" up to variable renaming / constant values
compare equal. Each takes all three forms (infix str, explicit prefix, tagged)
and returns the one it was given; the canonicalization runs through the engine's
internal state, so the answer does not depend on the dialect you passed.
import simplipy as sp
# Skeleton form: variables -> x{n}, EVERY numeric literal -> <constant>
sp.to_skeleton(['+', 'v1', '2.5'], engine)
# > ['+', 'x1', '<constant>']
# Expression form: variables canonicalized, numeric values kept
sp.to_expression(['+', 'V1', '3'], engine)
# > ['+', 'x1', '3']
# Classify / canonicalize a single token -> (normalized_token, is_variable)
sp.normalize_variable_token('X3')
# > ('x3', True)
sp.normalize_variable_token('sin')
# > ('sin', False)
More examples can be found in the documentation.
Performance
On a 65,536-expression symbolic-regression benchmark, paired per-row against SymPy's simplify (serial single-core, 1 s cap):
| SimpliPy | SymPy | |
|---|---|---|
| Mean size ratio (lower is better) | 0.97 | 1.09 |
| Expressions strictly simplified | 13.2% | 22.3% |
| Expressions made bigger | 0.00% | 45.1% |
| Median per-row speedup | ≈260× | 1× |
Full results, figures, and methodology: simplify guide · paper.
Development
Setup
To set up the development environment, run the following commands:
pip install -e .[dev]
pre-commit install
Tests
Test the package with pytest:
pytest tests --cov src --cov-report html
or to skip integration tests,
pytest tests --cov src --cov-report html -m "not integration"
Citation
@inproceedings{saegert2026breakingsimplificationbottleneckamortized,
title = {Breaking the Simplification Bottleneck in Amortized Neural Symbolic Regression},
author = {Paul Saegert and Ullrich Köthe},
booktitle = {Proceedings of the 43rd International Conference on Machine Learning (ICML)},
year = {2026},
eprint = {2602.08885},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2602.08885},
}
% Optionally
@software{simplipy-2026,
author = {Paul Saegert},
title = {Efficient Simplification of Mathematical Expressions},
year = 2026,
publisher = {GitHub},
version = {0.14.0},
url = {https://github.com/psaegert/simplipy}
}
Metadata
Release files for simplipy 0.14.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simplipy-0.14.7.tar.gz | 3.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| simplipy-0.14.7-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| simplipy-0.14.7-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| simplipy-0.14.7-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| simplipy-0.14.7-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
| simplipy-0.14.7-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 10.2 MB
Release files / simplipy-0.14.7.tar.gz
| Download URL | simplipy-0.14.7.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0d21bf410288af46eae9142703d02c39ab2fc4b70a3a60e406e599fb6cb215a
|
|
BLAKE2b-256 checksum How to use checksums |
3fa04565c86add9c842035a24048d860109355af983f0d21292950ca10c66021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / simplipy-0.14.7-cp312-abi3-win_amd64.whl
| Download URL | simplipy-0.14.7-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5c5ca4d6974f3b555127c84abe2951c0d16393a213164c317a4f4add358c9417
|
|
BLAKE2b-256 checksum How to use checksums |
e6209fc9b2351274398d255f6aea602146f7b1bf228d7b11121b17d6f28520d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / simplipy-0.14.7-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | simplipy-0.14.7-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
054b15cb79e84daa9cab26c2a9435e0df1eae783e7bc9c356aa3418699555750
|
|
BLAKE2b-256 checksum How to use checksums |
47351f479187b71eb1d03feffa7e095b69b793dfc6a78afd21f0345f26cdfe55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / simplipy-0.14.7-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | simplipy-0.14.7-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
cde6e350d3c77be8929aec7c18d80707584155513bf73da5e445182c294e8272
|
|
BLAKE2b-256 checksum How to use checksums |
5fe14a60e677866f54284ebe8c18ac96b4b6464bfe399c6781504f80d169bcad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / simplipy-0.14.7-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | simplipy-0.14.7-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3c953a4aed6f813ea0c1d4588172d55ec28d117ea63332f61d3eb4c922780e76
|
|
BLAKE2b-256 checksum How to use checksums |
0c442083a9f777c06fb7121bd42c741a8c1f0332f40917233d06cb0357911d2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / simplipy-0.14.7-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | simplipy-0.14.7-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
6edebc43077ce8cc31485e4877f4a637c8e6dd5c7a28caca181671cc7ea3d22c
|
|
BLAKE2b-256 checksum How to use checksums |
ee5df96619ba4427dcd1f9bd638a96807aef6fd8ef8be24f5ab98f5920bbab8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log