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×

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}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplipy-0.14.4.tar.gz (3.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

simplipy-0.14.4-cp312-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12+Windows x86-64

simplipy-0.14.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

simplipy-0.14.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

simplipy-0.14.4-cp312-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

simplipy-0.14.4-cp312-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file simplipy-0.14.4.tar.gz.

File metadata

  • Download URL: simplipy-0.14.4.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

Hashes for simplipy-0.14.4.tar.gz
Algorithm Hash digest
SHA256 f301b1e2afb5fb6b6d059f66c58d0d63308b63d0f5817b03d6c03b7c208c6e63
MD5 3338f33f01ff7e1b997a1c716c653142
BLAKE2b-256 793aa19704cf5efc3e7921333ec960fd6bafbaa908aadfac51164fc36b959463

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4.tar.gz:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simplipy-0.14.4-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: simplipy-0.14.4-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

Hashes for simplipy-0.14.4-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ad986e5c7f36fb2d4f26a268ea9d8f78e68746af71525a9a819997e24d2d6f14
MD5 504e0b07bbded5c2e0c4732dea7f4cc2
BLAKE2b-256 87e47f409ee01efaf6dbb08162f7ea74f1fb723112cf12079566f3b50553e54d

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4-cp312-abi3-win_amd64.whl:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simplipy-0.14.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for simplipy-0.14.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7b2e1658ca07c93185d5e30d0a9bcb9c4d3f94c22a100bbab52f324a9f56e3b
MD5 d08b5d43d929a71e2bfe0a7da96dbc97
BLAKE2b-256 99e4868677aec569ac463172bebd66b43eef64e237663d7facfca06d49e003ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simplipy-0.14.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for simplipy-0.14.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 55333e483a39afeb775153c96ba30cc944dd27fe64695f707444ce0412187b7e
MD5 84a3c35a7a6dd57ffd884a3a9df389d1
BLAKE2b-256 6003f1e69909d3b55f8a387edc8c121a412d9da063595df1e0a508a56ba7492b

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simplipy-0.14.4-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simplipy-0.14.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba248aa1c386651d0a0bb06a5ce76e73480a177ea4a5c620c18f1444a403faf8
MD5 21d7b5cc1ab515360c026cafc1ae1921
BLAKE2b-256 cb6ec490b5d66623241f5cbc425adf05d2b4ad65c2e831579ec38202dd88407e

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simplipy-0.14.4-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for simplipy-0.14.4-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4ae77a9fd66a3cec002dc393545ca0d985e0a9fd3a26f39ff5edeccf5275800e
MD5 f86f6a2491850f9e155981ca715553d7
BLAKE2b-256 bcc4ba097a0083eb7382f1c719dd817b657f57e0fce92f244d01d23998df7cf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.14.4-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on psaegert/simplipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.14.6

6 files

0.14.5

6 files

This release

0.14.4 This release

6 files

0.14.2

6 files

0.14.1

6 files

0.14.0

6 files

0.13.1

6 files

0.13.0

6 files

0.12.0

6 files

0.11.0

6 files

0.10.1

6 files

0.10.0

6 files

0.9.1

6 files

0.9.0

6 files

0.8.0

6 files

0.7.1

6 files

0.7.0

6 files

0.4.2

6 files

0.4.1

6 files

0.4.0

6 files

0.3.1

6 files

0.3.0

6 files

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.0

2 files

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