How a single binary operator — eml(x,y) = exp(x) − ln(y) — can generate every elementary function a scientific calculator knows, from addition to trigonometry.

·9 min read

When I first read this paper, what immediately caught my attention was a specific question: does the uniform tree structure reveal an opportunity for computer algebra systems — something that could help solve integrals or differential equations algebraically? I built the playground at the bottom of this article to develop some intuition. I haven't found anything obvious yet, but the investigation itself was interesting enough to write up.

In digital electronics, a single two-input gate — NAND — is all you need. Every Boolean circuit in every chip ever made can be built from nothing but NAND gates. No AND, no OR, no XOR: just the one primitive, repeated.

For continuous mathematics no such primitive was known. A scientific calculator needs dozens of buttons: addition, subtraction, multiplication, division, exponentiation, square root, sine, cosine, logarithm… They feel irreducibly diverse.

Until now.

The EML Operator

In a 2026 paper, Andrzej Odrzywołek (Jagiellonian University) showed that a single binary operator

eml(x,y)=exlny\operatorname{eml}(x,\, y) = e^x - \ln y

together with the constant 1, generates the full repertoire of a scientific calculator. Every elementary function — every constant, every arithmetic operation, every transcendental — can be written as a nested tree of eml calls applied to 1 and the input variables.

That includes: ee, π\pi, ii, integers, rationals, radicals, ++, -, ×\times, ÷\div, exponentiation, exp\exp, ln\ln, sin\sin, cos\cos, tan\tan, sinh\sinh, cosh\cosh, tanh\tanh, arcsin\arcsin, arccos\arccos, arctan\arctan, … all of them.

The Simplest Identities

The most immediate identity is exponential:

ex=eml(x,  1)e^x = \operatorname{eml}(x,\; 1)

because exln1=ex0=exe^x - \ln 1 = e^x - 0 = e^x. From there the Euler number follows immediately:

e=eml(1,  1)e = \operatorname{eml}(1,\; 1)

The natural logarithm is only one level deeper:

lnx=eml ⁣(1,  eml(eml(1,x),  1))\ln x = \operatorname{eml}\!\bigl(1,\; \operatorname{eml}(\operatorname{eml}(1, x),\; 1)\bigr)

You can verify this by expanding from inside out:

eml(1,x)=elnxeml(elnx,  1)=eelnx=eexeml ⁣(1,  eex)=eln ⁣eex=e(elnx)=lnx  \operatorname{eml}(1, x) = e - \ln x \qquad \operatorname{eml}(e - \ln x,\; 1) = e^{e - \ln x} = \frac{e^e}{x} \qquad \operatorname{eml}\!\left(1,\; \frac{e^e}{x}\right) = e - \ln\!\frac{e^e}{x} = e - (e - \ln x) = \ln x \;\checkmark

A Uniform Grammar

Once you have exp and ln, the standard arithmetic and transcendental functions follow by bootstrapping:

ExpressionEML depthNotes
exe^x1eml(x, 1)
lnx\ln x3see above
003ln1=0\ln 1 = 0
x-x5via 0x0 - x
1/x1/x7via elnxe^{-\ln x}
xyx \cdot y9via elnx+lnye^{\ln x + \ln y}
x+yx + y≈ 13via ln(exey)\ln(e^x \cdot e^y)

The key structural insight: every elementary expression becomes a binary tree of identical nodes. The grammar could not be simpler:

S    1    eml(S,  S)S \;\to\; \mathbf{1} \;\mid\; \operatorname{eml}(S,\; S)

This is a context-free language isomorphic to full binary trees (Catalan structures). There are no heterogeneous node types, no special cases — just one repeated element, exactly like a digital circuit built from NAND gates.

Why It Works

EML bundles the two fundamental operations of the exp-log world — exponentiation and logarithm — into a single asymmetric gate:

  • The left input passes through exp\exp
  • The right input passes through ln\ln
  • The outputs are subtracted

The non-commutativity is essential: it provides both "tree growth" (exp inflates, ln deflates) and inversion capability (swapping inputs inverts the sense of the operation).

EML is not unique. Close cousins exist: EDL(x,y)=ex/lny(x,y) = e^x / \ln y (with constant ee) and eml(y,x)=lnxey-\operatorname{eml}(y,x) = \ln x - e^y (with constant -\infty). The paper also hints at a ternary variant that requires no distinguished constant at all.

The result was not guessed — it was found by systematic exhaustive search. Odrzywołek built a bootstrapping verifier (VerifyBaseSet) that, starting from a candidate primitive set, repeatedly searches for expressions that compute each target operation, growing the known set until all 36 primitives in his scientific-calculator basis are covered.

The search proceeds iteratively:

  1. Start with S0={1,eml}S_0 = \{1, \operatorname{eml}\} and target list C0={e,π,i,exp,ln,+,,×,}C_0 = \{e, \pi, i, \exp, \ln, +, -, \times, \dots\}
  2. Find any expression over SiS_i that equals some target in CiC_i
  3. Move it from CiC_i to Si+1S_{i+1}
  4. Repeat until Ci=C_i = \emptyset

A Rust reimplementation runs the full check in ~35 seconds (vs ~40 minutes in Mathematica). The code is open-source at VA00/SymbolicRegressionPackage.

An Analog Circuit Perspective

The authors also note a hardware angle. An eml gate can be built from two analog components (an exp-amplifier and a log-amplifier) and a subtractor. Since every elementary function is a tree of identical gates, you can implement any mathematical function in analog hardware using a single type of circuit element — a continuous analogue of building digital circuits from transistors.

EML for Symbolic Regression

The uniform tree structure has a machine-learning payoff. In standard symbolic regression, the search space mixes heterogeneous operators (sin, cos, +, exp, …). With EML, the search space is parameterized by a single architecture:

F(x)=eml[α1+β1x+γ1eml(),  α2+β2x+γ2eml()]F(x) = \operatorname{eml}[\alpha_1 + \beta_1 x + \gamma_1\operatorname{eml}(\dots),\; \alpha_2 + \beta_2 x + \gamma_2 \operatorname{eml}(\dots)]

At each internal node, the two inputs are soft-gated linear combinations of 1, the variable xx, and the node's children. Gradient descent (Adam) can then train these parameters continuously. When the generating law is elementary, the weights can "snap" to exact rational values, recovering the closed-form formula exactly.

The authors demonstrate exact recovery of formulas like exe^x, lnx\ln x, sinhx\sinh x, and x2x^2 from numerical data, at tree depths up to 4.

Applications: CAS, Integration, and Differential Equations?

The uniform tree grammar raises an intriguing question: could EML serve as a canonical representation inside a computer algebra system?

Today's CAS tools (Mathematica, SymPy, Maple) maintain a heterogeneous internal AST with dozens of node types — Add, Mul, Pow, Exp, Sin, and so on. Every transformation rule must handle the full combinatorial cross-product of node pairs. EML collapses that zoo into a single node type. In principle:

  • Pattern matching becomes structurally uniform — every rewrite rule operates on the same shape of tree.
  • Integration might benefit: an indefinite integral fdx\int f\,dx could be searched as a tree of bounded depth, since the antiderivative of an elementary function is (when it exists) also elementary. The EML search algorithm Odrzywołek used to rediscover the operator could be adapted here.
  • ODEs: the solution landscape of elementary ODEs is similarly constrained. A depth-bounded search over EML trees could, in theory, enumerate candidate closed-form solutions.

None of this is proven, and the trees grow quickly in depth — xyx \cdot y already takes ~41 nodes. But the idea is at least coherent in a way it never was with a heterogeneous operator set.

Differentiation as a Graph Transformation

My main motivation for building the playground was to look at how the EML tree changes under differentiation. The question I kept asking was: if ff and ff' share large substructures in EML form, does that tell us something useful? Could a CAS exploit it — recognising that parts of the derivative are literally subtrees of the original function, and reusing them rather than recomputing?

To explore this I built a simple shared-subgraph detector. Take ff and ff' as EML trees, run this algorithm, and see what they have in common:

  1. Canonicalise every subtree as a string key via a bottom-up structural hash: a leaf 1 maps to "1", a variable x maps to "x", and any internal node maps to "(L|R)" where L and R are the keys of its children.
  2. Count how many times each unique key appears in ff, and separately in ff'.
  3. Intersect the two multisets: any key present in both trees corresponds to a shared subtree.
  4. Filter for size ≥ 2 (isolated leaf matches are trivial) and rank by node count — larger shared structures first.

The playground runs this live — switch to the Shared tab after differentiating to see the largest common subgraph highlighted in both trees, with a ranked table below.

The results are interesting but I haven't found an obvious practical application yet. The sharing is often large (the chain rule predictably re-uses subexpressions from ff inside ff'), but translating that structural observation into a CAS algorithm for, say, solving an ODE symbolically is a much harder step that I haven't cracked.

Interactive Playground

Try it yourself. Type any elementary expression below and see it compiled into pure EML form, along with a rendering of the binary tree.

Supported syntax: exp(x), ln(x), log(x), sqrt(x), cbrt(x), sinh(x), cosh(x), tanh(x), x + y, x - y, x * y, x / y, x ^ y, eml(x, y), inv(x), neg(x), pow(x, y).

EML Playground

Compile and differentiate math expressions in pure eml(x,y) = exp(x) − ln(y) form.

Mode:

EML form:

eml(1, eml(eml(1, x), 1))
depth
3
nodes
7
leaves
4

Binary tree (E = eml node, 1/var = terminal)

ff(x) = ln(x)E1EE1x1eml(·,·)terminal (1 or var)

Note that sin() and cos() produce EML trees over C\mathbb{C} (they require i=1i = \sqrt{-1}) and are not shown here — the compiler flags them with an explanation. The hyperbolic variants sinh, cosh, tanh work entirely over the reals and compile cleanly.

Significance

For centuries the scientific-calculator basis felt irreducibly complex. We knew many reductions (e.g. tanx=sinx/cosx\tan x = \sin x / \cos x, coshx=cos(ix)\cosh x = \cos(ix)) but a single sufficient primitive seemed impossible. EML shows the reduction goes all the way.

This is more than a mathematical curiosity. It reveals that:

  • Elementary functions form a far simpler class than previously recognised
  • A uniform, grammar-regular search space for symbolic regression exists
  • Analog computing can be built from a single reusable element

The paper ends with open questions — most tantalizingly, the existence of a binary operator that generates all constants from arbitrary input (no distinguished terminal needed), and of a unary operator that retains all good properties of neural-net activations while enabling exact elementary-function evaluation.

Further Reading

Related Articles

·17 min read

Automatic Differentiation

A deep-dive into automatic differentiation: symbolic vs. numerical vs. AD, AST transformation, dual numbers, tapes, hybrid methods, and a generic C++ implementation that computes gradients and solves optimisation problems.