Skip to main content

Efficient Simplification of Mathematical Expressions

Project description

SimpliPy:
Efficient Simplification of Mathematical Expressions

PyPI version PyPI license Documentation Status

pytest quality checks CodeQL Advanced

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

More examples can be found in the documentation.

Performance

Original vs Simplified Length and Simplification Time

Left: Empirical Cumulative Distribution Functions (ECDFs) of simplification wall-clock time. Our SimpliPy rewriting engine (shades of blue, varying Lmax) operates in the low to moderate millisecond regime, orders of magnitude faster than the SymPy [Meurer et al. 2017] baseline (orange, red). Right: ECDF of the simplification ratio |τ ∗|/|τ |. The inset highlights the tail of the distribution. Our method with Lmax ≥ 5 achieves simplification ratios comparable to the SymPy baseline while maintaining high throughput.
Source expressions are sampled with 0 to 17 unique variables and 1 to 35 symbols [Saegert & Köthe 2026]

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 = 2025,
    publisher = {GitHub},
    version = {0.2.14},
    url = {https://github.com/psaegert/simplipy}
}

Project details


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.2.14.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

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

simplipy-0.2.14-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplipy-0.2.14.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simplipy-0.2.14.tar.gz
Algorithm Hash digest
SHA256 fab56366b93ebc0ab9129b30a25d109f34b6f5bc7d538e08d0ee94087b551a7c
MD5 6814c08e122f17499efe78c46ad45481
BLAKE2b-256 3d06f332febd427ae48da90b26b8a1d3051b0b64a9d7cfc9e66807d5103e9ef3

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.2.14.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.2.14-py3-none-any.whl.

File metadata

  • Download URL: simplipy-0.2.14-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simplipy-0.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 2339cb8b7b9bb2d3539ae90cc9d41ae01e95e6374d7b7848242be78f83fc616c
MD5 570140a12599f70526c5834d54c15b5f
BLAKE2b-256 354ddbecd7be0db72fcdefb08e1ccd8e88ac70854988ad05ceb97d2991af9f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplipy-0.2.14-py3-none-any.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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page