Skip to main content

SimpliPy:
Efficient Simplification of Mathematical Expressions

PyPI version PyPI license Documentation Status

pytest quality checks CodeQL Advanced

Publications

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, so pip install simplipy does 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 raises ImportError.

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×

Compression on the SR benchmark

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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplipy 0.14.8
File Size Uploaded Provenance Actions
simplipy-0.14.8.tar.gz 3.2 MB With provenance Details for simplipy-0.14.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for simplipy 0.14.8
File Actions
simplipy-0.14.8-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for simplipy-0.14.8-cp312-abi3-win_amd64.whl
simplipy-0.14.8-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for simplipy-0.14.8-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
simplipy-0.14.8-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for simplipy-0.14.8-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
simplipy-0.14.8-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for simplipy-0.14.8-cp312-abi3-macosx_11_0_arm64.whl
simplipy-0.14.8-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for simplipy-0.14.8-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 10.3 MB

Release files / simplipy-0.14.8.tar.gz

Download URL simplipy-0.14.8.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
240ed6176e57485423b9746470c60db96fef7db1e2e5124d49a6aca7f0138df6
BLAKE2b-256 checksum
How to use checksums
fc58482b6daed65f36abe21c096bd68374375ce67dc2fb529fbb7568c0eaac6d
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 Nov 27, 2026.

Transparency log

Release files / simplipy-0.14.8-cp312-abi3-win_amd64.whl

Download URL simplipy-0.14.8-cp312-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
792b22b7eeab3fcc269414f99c0f02bd0b9570cf5a6e741ccc333acfe603af3d
BLAKE2b-256 checksum
How to use checksums
2a64bba0805bf5bdd4fee957ecc7759f2e2cf861dbd1d46ce6dba52140803c4a
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 Nov 27, 2026.

Transparency log

Release files / simplipy-0.14.8-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL simplipy-0.14.8-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_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
aab0ce068b2fc0fbcf7a4c5f46d8fead3b4436ceddc2bf1d1da78a9d9870b33a
BLAKE2b-256 checksum
How to use checksums
b1527cdd526b5212963c1e404e7c17ad07635260fe25cbbb6a92b0d129ed518a
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 Nov 27, 2026.

Transparency log

Release files / simplipy-0.14.8-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL simplipy-0.14.8-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3aa5b36e83f33dd541c02841886b4071db9b7fd7d9bc7778d32414a3b6ba6bcb
BLAKE2b-256 checksum
How to use checksums
207004cf73e9faac22123da53d3e9907904fb56a10cb5788619752fe4003ea84
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 Nov 27, 2026.

Transparency log

Release files / simplipy-0.14.8-cp312-abi3-macosx_11_0_arm64.whl

Download URL simplipy-0.14.8-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
d0e8aaf6bbbd600fde4633bde49a6419049221a9c1ff9af2a048b44be9ebe53f
BLAKE2b-256 checksum
How to use checksums
f7be5713f8852a72dd9589c79ce3d60972205349564f130b0289e3971119bffa
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 Nov 27, 2026.

Transparency log

Release files / simplipy-0.14.8-cp312-abi3-macosx_10_12_x86_64.whl

Download URL simplipy-0.14.8-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8c301e4912a3a53238d65253f43409f8ed3c65e89de1a45cc2cd176d3749f169
BLAKE2b-256 checksum
How to use checksums
9e5a37cbe4fd1ee86f913ecde8c9fee0f90ebd3ca254b8fc7881bba80916bc7a
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 Nov 27, 2026.

Transparency log

Security for simplipy 0.14.8

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for simplipy-0.14.8.tar.gz

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 Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.14.8 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page