One Operator to Rule Them All: The EML Operator and the NAND Gate of Continuous Mathematics

A while back I came across a paper on arXiv that stopped me dead in my tracks

The title was unassuming — All elementary functions from a single operator. The author is Andrzej Odrzywolek, a theoretical physicist at Jagiellonian University in Poland, and what he found is this:

A single binary operator eml(x, y) = exp(x) − ln(y), together with the constant 1, can construct every function on a scientific calculator

sin, cos, tan, log, sqrt, addition, subtraction, multiplication, division, exponentiation, inverse trig, hyperbolic functions — all of them

This is essentially saying that the 36 buttons on your scientific calculator? You only actually need 2

Why this is non-trivial

Anyone who’s taken a digital logic course knows about the NAND gate. In the world of Boolean logic, NAND is a “universal gate”: AND, OR, NOT, XOR… every logical operation can be built from NAND alone. This is the foundation of digital circuits and the reason a chip can use a single transistor structure to build arbitrarily complex logic

But in the world of continuous mathematics, nobody had ever found anything like this

We’ve long known that many functions are redundant — tan = sin/cos, √x = x^(1/2), sinh and cosh can be expressed through exp, and Euler’s formula unifies trigonometric and exponential functions. Historically, the invention of logarithms reduced multiplication to addition, and Euler’s formula further established exp and ln as the core primitives. But once you reduce everything down to exp and ln, that’s where it always stalled

For centuries, nobody took it one step further

What Odrzywolek did was use systematic exhaustive search to whittle down the 36 basic elements of a scientific calculator (constants, functions, operators) step by step — from 36 to Wolfram Mathematica’s 7, then to 6, 4, 3, and finally down to just 2: one operator EML, one constant 1

How EML works

The definition is almost absurdly simple:

$$\text{eml}(x, y) = e^x - \ln(y)$$

A few intuitive examples:

  • e = eml(1, 1), because e¹ − ln(1) = e − 0 = e
  • exp(x) = eml(x, 1), because eˣ − ln(1) = eˣ
  • ln(x) = eml(1, eml(eml(1, x), 1)) — and this is where it starts getting counterintuitive

By the time you reach multiplication and trigonometric functions, EML expressions can be 8 layers deep or more. The paper includes a complete derivation chain (Figure 1) that builds upward from eml and 1: e → exp → ln → 0 → −1 → minus → i → π → addition → subtraction → multiplication → division → exponentiation → all trigonometric functions

The grammar for the entire chain is breathtakingly simple: S → 1 | eml(S, S). That’s it — a single context-free grammar generates every elementary mathematical function

The search process itself is fascinating

The paper includes a small example that perfectly illustrates why problems like this can’t be solved by intuition alone

Suppose you only have three operations: suc(x) = x + 1, pre(x) = x − 1, inv(x) = 1/x. How do you compute −x?

The answer:

$$\text{suc}(\text{inv}(\text{pre}(\text{inv}(\text{suc}(\text{inv}(x)))))) = -x$$

Depth-5 nesting, completely counterintuitive. The EML construction process is full of expressions like this with Kolmogorov complexity between 7 and 9 — utterly impossible to arrive at through human intuition alone

Odrzywolek’s approach is hybrid: first substitute algebraically unrelated transcendental constants (like the Euler-Mascheroni constant) into variables, use numerical computation to screen candidate formulas, then verify with symbolic computation. The whole search was initially implemented in Mathematica, then translated to Rust using GPT Codex, achieving a three-orders-of-magnitude speedup

Why I think this matters enormously for quantitative trading and deep learning

This is what I really want to talk about

Symbolic regression: discovering exact formulas from data

There’s a core problem in quantitative trading and scientific modeling — you have a pile of data and you want to find the exact mathematical formula behind it. This is the domain of symbolic regression

Traditional symbolic regression methods, whether genetic algorithms or more modern approaches, all face a fundamental difficulty: the search space is heterogeneous. You need to simultaneously search for which operators to use (+, −, ×, sin, log…) and how to combine them, making the search space both enormous and irregular

EML completely changes the game

Because every elementary function can be expressed through the same operator, the search space becomes a homogeneous binary tree. Every node is eml, every leaf is either 1 or an input variable x. You don’t need to decide “should this be sin or log” — you only need to determine the tree structure and the value at each leaf

More crucially, this tree is differentiable. The paper demonstrates a “master formula” concept: at each input position in the tree, place a linear combination αᵢ + βᵢx + γᵢf, where α, β, γ are trainable parameters, then run gradient descent with Adam optimizer. After training, snap the weights to the nearest 0 or 1 to recover an exact symbolic expression

The experimental results show that on depth-2 trees starting from random initialization, 100% of experiments recover the correct formula. Depth 3-4 achieves about 25%, and depth 5+ gets quite difficult. But here’s the key point: when you start near the correct solution, even depths 5 and 6 converge back 100% of the time. This means the correct basin of attraction exists — the problem is just how to find it

What this means for quantitative trading

In quantitative trading we constantly need to extract predictive factors or formulas from market data. The traditional approach is either manual factor construction (relying on domain knowledge and intuition) or black-box machine learning models (effective but uninterpretable)

EML offers a middle path: using gradient descent to search for exact mathematical formulas

Imagine feeding price series, volume, volatility and other data into an EML tree. After training, what you get isn’t an opaque neural network weight matrix — it’s a mathematical formula that can be written in closed form. You can directly examine the mathematical structure of the factor, understand why it works, and judge whether it’s overfitting or genuinely capturing some market regularity

The value this brings to risk management and model auditing is immense

What this means for deep learning

The paper makes a brilliant observation: any conventional neural network is a special case of an EML tree

Because standard activation functions (ReLU, sigmoid, tanh…) are themselves elementary functions, any neural network built with these activations can theoretically be expressed as an EML tree. But the reverse doesn’t hold — EML trees can express things that conventional neural networks cannot

More importantly, there’s interpretability. After training a conventional neural network, what you get is a pile of floating-point weights that nobody can extract physical meaning from. But after training an EML tree, if the weights can be snapped to exact values, what you get is a readable mathematical formula — a form of interpretability that conventional architectures fundamentally cannot provide

In the paper’s own words:

When this succeeds, the discovered circuits are legible as elementary function expressions — a form of interpretability unavailable to conventional architectures.

Open questions

What excites me most about this paper is actually what it hasn’t solved yet

EML requires a specific constant 1 as a starting point. NAND gates don’t — they can generate 0 and 1 from arbitrary inputs. So is there a continuous binary operator that can generate all elementary functions without any specific constant? Odrzywolek is looking for one. He’s already found a ternary version T(x, y, z) = eˣ/ln(x) × ln(z)/eʸ, satisfying T(x, x, x) = 1, but full verification is still underway

Another question: is there a unary Sheffer — that is, an activation function that can both serve in a neural network like ReLU and exactly compute all elementary functions? If such a thing exists, the entire landscape of deep learning architecture design could be rewritten

Final thoughts

This paper reminds me of how I felt when I first read about twelve-tone equal temperament. On the surface it’s a pure mathematical discovery, but what it touches is a deeply fundamental structural question: the world we thought required many different tools to describe might only need one

From 36 buttons to 2 buttons — this isn’t just a mathematical parlor trick. It reveals that the redundancy among elementary functions far exceeds what we ever imagined, and once that redundancy is properly exploited, it opens up entirely new computational paradigms

The paper’s arXiv ID is 2603.21852. Code and verification tools are open-sourced on GitHub. If you’re interested in symbolic regression or mathematical foundations, this one is worth reading end to end