Skip to main content

Exp-Minus-Log Mathematics: the EML Sheffer operator eml(x,y)=exp(x)−ln(y). Slim core: expression trees, symbolic regression, flow-diagram renderer. (Algebras + GR live in the sister package eml-spectral.)

Project description

EML-Math

EML Mathematics — a universal real-valued foundation for elementary mathematics, built from a single binary operator.

PyPI Python 3.11+ License: MIT

Repo: https://github.com/andrewkwatts-maker/EML-Math

Created by Andrew K Watts. Based on the EML Sheffer operator established by Andrzej Odrzywolek: arXiv:2603.21852v2 (CC BY 4.0).


The core idea

A single binary operator generates every elementary function:

eml(x, y) = exp(x) − ln(y)

This is the EML Sheffer operator — the continuous analog of the NAND gate for Boolean logic. From it the 36 standard elementary functions (+, , ×, /, exp, ln, sin, cos, tan, π, e, …) can all be reconstructed as composed expression trees.

EMLPoint is the operator's computation node — simultaneously a mathematical state and a composable expression-tree leaf:

from eml_math import EMLPoint
import math

EMLPoint(1, 1).tension()                                  # e   = eml(1, 1)
EMLPoint(2, 1).tension()                                  # exp(2)
EMLPoint(1, EMLPoint(EMLPoint(1, math.e), 1)).tension()   # ln(e) = 1.0

What's in v1.2.0 — the slim core

eml-math v1.2.0 is the pure-EML universal-math toolkit: the operator, expression trees, symbolic regression, the elementary-function operator library, the famous-equations registry, and the flow-diagram renderer. Nothing else.

Module Purpose
EMLPoint, _VarNode The EML node, with variable-leaf support for symbolic work
tree Expression-tree parser, renderer, JSON-array compact form
operators The 36 elementary functions as ready-made EML trees
evaluator Parse and evaluate EML formula strings
symbols Named-symbol registry (e, π, φ, √2, …)
discover compress, recognize, Searcher — symbolic regression
famous Registered classic equations (Pythagoras, Euler, Einstein, …)
flow + flow_layout SVG / PNG / PDF / HTML flow-diagram renderer
web Bundled eml_flow.js UMD bundle for browser-side rendering

Algebras and physics are now in eml-spectral — the sister package. EML-tree representations of Clifford algebras, octonions, exceptional algebras (E7/E8/Freudenthal), Lorentz-invariant spacetime ops, and named GR metrics all live there. v1.2.0 split them out so the eml-math core has zero physics narrative.


Installation

pip install eml-math               # core
pip install eml-math[ext]          # + numpy, sympy
pip install eml-math[precision]    # + mpmath
pip install eml-math[dev]          # + pytest, ruff, mypy

For the algebras / physics layer:

pip install eml-spectral           # transitively pulls in eml-math

Quickstart — symbolic regression

Searcher finds an EML expression that matches a target numeric value:

from eml_math import Searcher

s = Searcher(target=2.71828)
result = s.search()
print(result.formula)      # 'eml(1, 1)'   (i.e. e)

compress and recognize go in the other direction:

from eml_math import compress, recognize

print(recognize(3.14159))         # ('π', 3.141592653589793, 0.0)
print(compress("exp(x) - ln(y)")) # SearchResult: matches the EML primitive itself

Quickstart — flow-diagram renderer

from eml_math import EMLPoint, flow_svg, flow_png

# c² = a² + b² — Pythagoras
expr = "sqrt(add(pow(a, 2), pow(b, 2)))"

flow_png(expr, "pythagoras.png", style="organic", width=1200, height=900)
flow_svg(expr, "pythagoras.svg", style="formal")

Available styles:

Style Path Joint Look
formal continuous continuous symmetric tree, top-down
organic continuous continuous branching, depth-aware angle
gentle continuous (large bend) continuous long flowing sweeps
tree continuous (small bend) continuous balanced upright

The layout-intermediate JSON lets you inspect or post-process the geometry before rendering:

from eml_math import to_layout, render_layout_svg, organic_layout

layout = to_layout(expr, width=1200, height=900)
layout = organic_layout(layout, branch_jitter=0.15, trunk_pull=0.3)
svg = render_layout_svg(layout)

The bundled UMD bundle (eml_math.web.FLOW_JS_PATH) renders the same JSON in a browser:

<script src="eml_flow.js"></script>
<script>
  const layout = /* JSON from to_layout(...) */;
  document.body.innerHTML = EMLFlow.renderSVG(layout);
</script>

Famous-equations registry

from eml_math import all_famous_equations, get_famous

print([eq.name for eq in all_famous_equations()])
# ['Pythagoras', 'Euler identity', 'E = mc²', 'Schrödinger', ...]

einstein = get_famous("einstein_e_mc2")
print(einstein.eml_formula)    # the EML-tree form

Rust accelerator (optional)

The wheel bundles a Rust extension exposing Rayon-parallel batch operators (exp_n, ln_n, add_n, mul_n, sin_n, tension_n, …):

from eml_math.eml_core import tension_n
import numpy as np

xs = np.linspace(0, 5, 1_000_000)
ys = np.ones_like(xs)
out = tension_n(xs.tolist(), ys.tolist())   # parallel

A C/C++/Rust shared-library API lives under c_api/ for embedding the operator into other languages. Build it with:

cargo build --release -p eml_c_api

Project layout

eml-math/                           # this repo
├─ src/eml_math/                    # Python sources (the slim core)
├─ rust/eml_core/                   # Rust accelerator (PyO3 module)
├─ c_api/                           # C/C++/Rust shared-library bindings
└─ tests/                           # pytest suite (~1500 tests)

License

MIT, © Andrew K Watts.

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

eml_math-1.2.0.tar.gz (87.3 kB view details)

Uploaded Source

Built Distributions

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

eml_math-1.2.0-cp313-cp313-win_amd64.whl (372.8 kB view details)

Uploaded CPython 3.13Windows x86-64

eml_math-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl (579.5 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

eml_math-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (522.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

eml_math-1.2.0-cp313-cp313-macosx_11_0_arm64.whl (458.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

eml_math-1.2.0-cp312-cp312-win_amd64.whl (373.5 kB view details)

Uploaded CPython 3.12Windows x86-64

eml_math-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (580.2 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

eml_math-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (523.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

eml_math-1.2.0-cp312-cp312-macosx_11_0_arm64.whl (458.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

eml_math-1.2.0-cp311-cp311-win_amd64.whl (375.0 kB view details)

Uploaded CPython 3.11Windows x86-64

eml_math-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl (581.4 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

eml_math-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (524.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

eml_math-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (460.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file eml_math-1.2.0.tar.gz.

File metadata

  • Download URL: eml_math-1.2.0.tar.gz
  • Upload date:
  • Size: 87.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eml_math-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f286cb5ba4d353e196cb426a14ebfdbd799eb77ed35abb897f8274bbe11fc610
MD5 e36688bddc07309d943848fad122076a
BLAKE2b-256 ce80ef5c78220edc2a21841f49f65abd87808c549461216be18af16537f4a3ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0.tar.gz:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: eml_math-1.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 372.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eml_math-1.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9ebe7baa31a86c0d0e45a7f82c9c59dec4d4a1919aec647d5821f42bd5dc414b
MD5 81d808f2b45ab10eb1329b1d7b57278f
BLAKE2b-256 ab7d37f4d557869b25efded464e968d33fba8f4435a784fc39f4cca921239e36

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp313-cp313-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 56ca991a8da8267adda340c599434f64e26127801d65255ab4f5470417894332
MD5 c88dae064f3ea3200c13f282c222d687
BLAKE2b-256 ff2597c79642e89357c628cbe8c9ace4f6933b6fd8cdff1d7a39b0cbc553f60f

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 621bee09d5af08f048f6a0e28af4f0c28b2724386b27d46a3390310e4b964737
MD5 74e8aeb1095efa7f5c93c1ac66b75c3f
BLAKE2b-256 ee98703a2dc021ba0b0cf24d5b485130b8677ff769b0e6bca4676975e0591aeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6d6d1e9cdcd9dcffd6377174d4f8200a26d13043e2bd6a1eaabb0c4293426fe
MD5 e22315b7eeb7d1a47ac795b01ee55ea5
BLAKE2b-256 9cd667c5338236d08f098d991e8fe8e5e277ea549c991bc3f94ecbd64afc0da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: eml_math-1.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 373.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eml_math-1.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a50faff10ac15a8b51a5b7d03f25e142f94c27a1aead449ec62fca15081e0368
MD5 06d39eaab676d91933533709699f4271
BLAKE2b-256 94dd3c5024f9aefe89e503bdb67fa2b194e2c5e5a05095da52289448cdb3f765

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp312-cp312-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 64382f74123950f7affd52ef00fe4270cd92818f7cba804d7897c67346a4e8a6
MD5 ea8177ede24a4cb55b95841c5447fe62
BLAKE2b-256 1e8b53a7fe42b90d7d004c24c68bf6cafb9a4e554d7a732f05d1c551848b2ee7

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18eed84a511b470c78a2dd3d29d4dc104c2a22583a286c296ba712ef711f765f
MD5 3bcf33a7dcce0c51f2404ac789779a1c
BLAKE2b-256 c6d3b9ac78aa70839f444f538e2c412d93fade504afa298067bc13eb1678434d

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e8f84c9073503e0e7c9cb7edad31df9f9b5a15a34ad78624e015c7847a688c0
MD5 8894704ada8622852ee17826920fc510
BLAKE2b-256 26d2a09a2a0589ce5da527f456e996a972d2f5fba50798a72437eaa6bdf1fa07

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: eml_math-1.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 375.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eml_math-1.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 684caa2c00d23ec68f7e4668597f1905cd78a8ea3c14c524f1b5aff1483b0389
MD5 bf683a10463c6f1196097f5f253bccfd
BLAKE2b-256 0b24fe5de8db31b9ea19026db1e1d5fed01a76f8644169af2c350aeaf3e94286

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp311-cp311-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ee211092e87ff639df80ebc27de13abf5c142fd9c1421e4ae5389196716eb6d2
MD5 ddd307b8cc4aedbf021a5c8275c9c879
BLAKE2b-256 3784f813c833724d8349ed0d6aa041f9e0b91a0dde6bcfe6687c7818075a2ef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a3ac5a791cbf99c94169c06c63f5d4c2a532a3fbb36fdc1d7c2ec018aa197bc
MD5 bc1783924041028578a4fc90cc2180bf
BLAKE2b-256 0c89670fc4ac7aa79091f0bd036b3549600570bd600a26c7686bd78d9154430d

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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

File details

Details for the file eml_math-1.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eml_math-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6c6269e1321933d200ae1c8a5b0a512ec7bb942095aa0424f4c356415c9c972
MD5 52cfeec3a8c11f664b1c75e3c54f62ce
BLAKE2b-256 f6046388922dd36685d0e6bc97c01944aacd307b81c0ffe40db5ac7c5ee58989

See more details on using hashes here.

Provenance

The following attestation bundles were made for eml_math-1.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/EML-Math

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