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}
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplipy-0.14.0.tar.gz.
File metadata
- Download URL: simplipy-0.14.0.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9d5559dc2fde5a1a50503785b691b0aed5b16c8447dd86c518732f6d15c1d43
|
|
| MD5 |
4ee6e99e3826faaea7c1d0a8348e1bf3
|
|
| BLAKE2b-256 |
885901952ea8d92fc3007864c90fb212222b8e6a0359bc3b70f8b743033f6a4c
|
Provenance
The following attestation bundles were made for simplipy-0.14.0.tar.gz:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0.tar.gz -
Subject digest:
e9d5559dc2fde5a1a50503785b691b0aed5b16c8447dd86c518732f6d15c1d43 - Sigstore transparency entry: 2652226455
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.14.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: simplipy-0.14.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
238cbbf428158fad0fde0f02e83f34753ee72f0894695c7ed17cb6163d6301d2
|
|
| MD5 |
fe589a4891e69f23b9bbb58ce94abd63
|
|
| BLAKE2b-256 |
938ef72d4d548c42b4f7a0adab60f1b87c07d98f2e472314375cf1347a4e9fdc
|
Provenance
The following attestation bundles were made for simplipy-0.14.0-cp312-abi3-win_amd64.whl:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0-cp312-abi3-win_amd64.whl -
Subject digest:
238cbbf428158fad0fde0f02e83f34753ee72f0894695c7ed17cb6163d6301d2 - Sigstore transparency entry: 2652226609
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.14.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: simplipy-0.14.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16b028f7fe92ecd780a5c8b89dc756b68cdcba17eb65385bf5af9209716af532
|
|
| MD5 |
34e167ae2e8bf44a140a5bea04385a42
|
|
| BLAKE2b-256 |
d13241f42f14a719a6d192c3c7e9c204c7f972c295242e711b36e5bf242adc3a
|
Provenance
The following attestation bundles were made for simplipy-0.14.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
16b028f7fe92ecd780a5c8b89dc756b68cdcba17eb65385bf5af9209716af532 - Sigstore transparency entry: 2652226471
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.14.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: simplipy-0.14.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
462865e9da1c99269f16bab2c78228895f9125d66a7ec0e9e852992aea7492d5
|
|
| MD5 |
f2c0589764970d7947d31b945b44d4d8
|
|
| BLAKE2b-256 |
e18a5d6e24dc6774a50745e2d8d2cacf2cc06c60d2c51723a43322650bb440de
|
Provenance
The following attestation bundles were made for simplipy-0.14.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
462865e9da1c99269f16bab2c78228895f9125d66a7ec0e9e852992aea7492d5 - Sigstore transparency entry: 2652226521
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.14.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: simplipy-0.14.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30f2fd2ace53359a9d183ff7d712d3f8428eae3f5fa1db1136dcdca7f91b131
|
|
| MD5 |
2af1a04fe42332ac6b909355a1f1d91d
|
|
| BLAKE2b-256 |
8a2220163d529cb31ac6fe3bf62afaca45b4c178f955c9687bbae45b7c6bcdb0
|
Provenance
The following attestation bundles were made for simplipy-0.14.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
d30f2fd2ace53359a9d183ff7d712d3f8428eae3f5fa1db1136dcdca7f91b131 - Sigstore transparency entry: 2652226648
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.14.0-cp312-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: simplipy-0.14.0-cp312-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f40cdff5155fa51efd0fd6b8b490d58f3a7555cd09d9d5b84e1d47ce5520aa
|
|
| MD5 |
daee22a2304dd0bdae54ffb66c6a33cd
|
|
| BLAKE2b-256 |
c527eb9e5cc27f08088e8e4c79624bbd5f3dfbfa7620b00c72b629b0719aae34
|
Provenance
The following attestation bundles were made for simplipy-0.14.0-cp312-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on psaegert/simplipy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simplipy-0.14.0-cp312-abi3-macosx_10_12_x86_64.whl -
Subject digest:
10f40cdff5155fa51efd0fd6b8b490d58f3a7555cd09d9d5b84e1d47ce5520aa - Sigstore transparency entry: 2652226556
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@54c074a8debadebe3f073116a03578005efbaa08 -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54c074a8debadebe3f073116a03578005efbaa08 -
Trigger Event:
release
-
Statement type: