SimpliPy:
Efficient Simplification of Mathematical Expressions
Publications
- Saegert & Köthe 2026, Breaking the Simplification Bottleneck in Amortized Neural Symbolic Regression (preprint, under review) 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.11, 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("dev_7-3", install=True)
# Simplify prefix expressions
engine.simplify(('/', '<constant>', '*', '/', '*', 'x3', '<constant>', 'x3', 'log', 'x3'))
# > ('/', '<constant>', 'log', 'x3')
# Simplify infix expressions
engine.simplify('x3 * sin(<constant> + 1) / (x3 * x3)')
# > '<constant> / x3'
Normalization
The root-exported normalize_skeleton, normalize_expression, and
normalize_variable_token helpers (also available as simplipy.normalization)
canonicalize a prefix token sequence so that two expressions that are "the same"
up to variable renaming / constant values compare equal. They are pure-string
helpers with no engine state, so consumers such as holdout matching and
symbolic-recovery scoring share identical behavior by construction.
import simplipy as sp
# Skeleton form: variables -> x{n}, numeric literals -> <constant>
sp.normalize_skeleton(['+', 'v1', '2.5'])
# > ['+', 'x1', '<constant>']
# Expression form: variables canonicalized, numeric literals kept intact
sp.normalize_expression(['+', 'V1', '2.5'])
# > ['+', 'x1', '2.5']
# 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
As of 0.6.0 the simplify hot path defers match-time certificates to completed matches
(memoized generationally, never stopping memoization), memoizes whole fixpoint passes and
rule-normal subtrees, and runs on interned token ids (~20× fewer allocations per call) —
all at byte-identical outputs. On a 65,536-expression training-prior benchmark, large
certificate-bearing rulesets simplify ~59× faster than 0.5.0 and certificate-free
rulesets ~2.3× faster; see the CHANGELOG
for details. As of 0.7.0 there is a single engine line; to reproduce the historical
dev_7-3 / v23.0-era behavior byte-for-byte, install simplipy<=0.6.0. The comparison
below dates from the 0.3.0 Rust cutover:
|
Top row: SimpliPy |
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
@misc{saegert2026breakingsimplificationbottleneckamortized,
title = {Breaking the Simplification Bottleneck in Amortized Neural Symbolic Regression},
author = {Paul Saegert and Ullrich Köthe},
year = {2026},
eprint = {2602.08885},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2602.08885},
}
% Optionally
@software{simplipy-2025,
author = {Paul Saegert},
title = {Efficient Simplification of Mathematical Expressions},
year = 2026,
publisher = {GitHub},
version = {0.7.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.9.0.tar.gz.
File metadata
- Download URL: simplipy-0.9.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
003d23813e015182c155a2d6b04c1209f19580d629a9e1c3180ade477dddd4b8
|
|
| MD5 |
084a86bdd3397aa516864d59634dc263
|
|
| BLAKE2b-256 |
71086719b472679a99eb00743e823436ee918b5a68b1372b9b1724a2902bf8a9
|
Provenance
The following attestation bundles were made for simplipy-0.9.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.9.0.tar.gz -
Subject digest:
003d23813e015182c155a2d6b04c1209f19580d629a9e1c3180ade477dddd4b8 - Sigstore transparency entry: 2232934820
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.9.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: simplipy-0.9.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 873.7 kB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a3e6ce1576fc2f0eef9715c91e337b6e199926b9d2990079480ea59c7845972
|
|
| MD5 |
3ce025543331894a3b8df6d54bf901af
|
|
| BLAKE2b-256 |
6189d8917dce8ed05d663a6397e1b9fdcb60740fc7220171d872d905a2e609a2
|
Provenance
The following attestation bundles were made for simplipy-0.9.0-cp311-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.9.0-cp311-abi3-win_amd64.whl -
Subject digest:
0a3e6ce1576fc2f0eef9715c91e337b6e199926b9d2990079480ea59c7845972 - Sigstore transparency entry: 2232937876
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.9.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: simplipy-0.9.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f72fdf04f7a6f293eb278d1d015b684cdd0300369760883baf5aba245a2071
|
|
| MD5 |
66c659560557414288e2b0329d4bad7e
|
|
| BLAKE2b-256 |
a36214067dea31bd12c7f928cdda1cf525f0c837ecb5fcdc2b93e167745f2b83
|
Provenance
The following attestation bundles were made for simplipy-0.9.0-cp311-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.9.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
64f72fdf04f7a6f293eb278d1d015b684cdd0300369760883baf5aba245a2071 - Sigstore transparency entry: 2232936265
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.9.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: simplipy-0.9.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 965.2 kB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb17697df2a548de3ae13a68e0790d5ec054657f96ed9fc2f6bdf0ecd3ddf0a
|
|
| MD5 |
b15650f4852a47687886cf1c9d1a8d42
|
|
| BLAKE2b-256 |
3eccc00a90724b92d93f3c985f1bcedb7640d4acfca2b0214c563c3ab17c181f
|
Provenance
The following attestation bundles were made for simplipy-0.9.0-cp311-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.9.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
afb17697df2a548de3ae13a68e0790d5ec054657f96ed9fc2f6bdf0ecd3ddf0a - Sigstore transparency entry: 2232935459
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.9.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: simplipy-0.9.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 908.3 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c59ae408e9f8f5ca3eeed51a868cc7e1e4bea73cd9f5006583b639e282571851
|
|
| MD5 |
1e4cf360d1e12cb1a991e7dc15231817
|
|
| BLAKE2b-256 |
d278048bb5190924990f6d269b9ee7bed5e5858f4768cb4acd90722f82be2b42
|
Provenance
The following attestation bundles were made for simplipy-0.9.0-cp311-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.9.0-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
c59ae408e9f8f5ca3eeed51a868cc7e1e4bea73cd9f5006583b639e282571851 - Sigstore transparency entry: 2232938414
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simplipy-0.9.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: simplipy-0.9.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 943.9 kB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
438c93041eebf9359c352cdd2cf57c45ef1af51de5eee9dabadf3a9f0b0434dd
|
|
| MD5 |
ef9fa481af70ad5711155c4f540efc5b
|
|
| BLAKE2b-256 |
cddee40f7f5abc4c31843a1bf4bb3d4ac03bf3a314714b0ffe6034cf83af9da3
|
Provenance
The following attestation bundles were made for simplipy-0.9.0-cp311-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.9.0-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
438c93041eebf9359c352cdd2cf57c45ef1af51de5eee9dabadf3a9f0b0434dd - Sigstore transparency entry: 2232936760
- Sigstore integration time:
-
Permalink:
psaegert/simplipy@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6acfd5b124dccbd2be860b950f4d55e7f08289b3 -
Trigger Event:
release
-
Statement type: