jongkwan.dev
Development · Essay №076

Generating Every Elementary Function from a Single Operator — EML

Just as NAND generates all of Boolean algebra, Odrzywolek's result shows that eml(x,y) = exp(x) - ln(y) together with the constant 1 is enough to build every real elementary function

Jongkwan Lee2026년 4월 17일8 min read
Contents

The constant 1 and a single binary operator are enough to rebuild an entire scientific calculator.

One luxury digital logic enjoys

Boolean circuits have a well-known property: a single NAND gate suffices to build every logic function, AND, OR, NOT, and XOR included. The property of one operator generating an entire system is called the Sheffer property, and such an operator is a Sheffer operator. It is exactly this property that lets digital hardware implement countless functions out of a uniform array of gates.

Continuous mathematics had no comparable primitive for a long time. A scientific calculator has separate buttons for exponential, logarithm, sine, cosine, and square root, and each function is implemented with its own rules and algorithms.

That these functions overlap heavily is of course well known. They reduce to one another, as in sinx=cos(xπ/2)\sin x = \cos(x - \pi/2), x=x1/2\sqrt{x} = x^{1/2}, and tanx=sinx/cosx\tan x = \sin x / \cos x. Bring in Euler's formula eiφ=cosφ+isinφe^{i\varphi} = \cos\varphi + i\sin\varphi and the trigonometric functions too become variations on the exponential and the logarithm. But the question of where the most compressed endpoint lies had never been pursued systematically.

Andrzej Odrzywolek's "All elementary functions from a single binary operator" (arXiv:2603.21852), released in March 2026, identifies that endpoint. It is a constructive proof that all real elementary functions can be built from a single binary operator and a single constant.

Defining the EML operator

EML stands for Exp-Minus-Log and is defined as follows.

eml(x,y)=exp(x)ln(y)\mathrm{eml}(x, y) = \exp(x) - \ln(y)

The generating basis contains nothing beyond this operator except the constant 1. The constant is needed to neutralize the logarithm term. Because ln1=0\ln 1 = 0, fixing the second argument at 1 degenerates EML into the exponential function.

eml(x,1)=exp(x)ln1=ex\mathrm{eml}(x, 1) = \exp(x) - \ln 1 = e^x

So exe^x comes out as a depth-1 EML tree. The computation is carried out over the complex numbers, because constants such as π\pi and ii appear partway through the representations. For instance, ii can be pulled out as an EML tree by using the fact that ln(1)\ln(-1) evaluates to iπi\pi on the principal branch.

The definition alone does not immediately reveal that EML is a Sheffer operator. Odrzywolek designed a search procedure that systematically enumerates candidate operators. For each candidate the procedure checks whether the list of elementary functions (the 36 entries of Table 1) can be reconstructed iteratively. EML is the first success that procedure turned up.

How every elementary function is recovered

The search algorithm works by bootstrapping. Starting from a verified basis SiS_i, it takes an element from the target list CiC_i that the basis alone can express and moves it into Si+1S_{i+1}. When CiC_i is empty, the proof is complete.

  1. Initial basis S0={1,eml}S_0 = \{1, \mathrm{eml}\}, target list C0={π,e,i,1,,exp,ln,+,,×,}C_0 = \{\pi, e, i, -1, \ldots, \exp, \ln, +, -, \times, \ldots\}.
  2. Find the first element the current basis can express, e=eml(1,1)e = \mathrm{eml}(1, 1), and move it into the basis.
  3. Use the newly extended basis to express the next element (say π\pi or ii). Repeat until Ci=C_i = \emptyset.

A few of the representative expressions the procedure finds are these.

  • e=eml(1,1)e = \mathrm{eml}(1, 1)
  • ex=eml(x,1)e^x = \mathrm{eml}(x, 1) — depth 1
  • lnz=eml(1,eml(eml(1,z),1))\ln z = \mathrm{eml}\bigl(1, \mathrm{eml}(\mathrm{eml}(1, z), 1)\bigr) — depth 3

Unpack the internal structure of that logarithm expression. The innermost eml(1,z)=elnz\mathrm{eml}(1, z) = e - \ln z holds lnz\ln z as a complement relative to the constant ee, and the application around it produces eelnze^{e - \ln z}. The outermost layer applies eln()e - \ln(\cdot) once more to isolate the desired lnz\ln z. Getting a single logarithm requires nesting EML three times. Because EML mixes the exponential and the logarithm into one expression, isolating one of the terms means stacking up cancellation structure.

The four arithmetic operations reduce the same way. Combining the two exponent laws and their inverses yields multiplication and addition naturally.

x×y=elnx+lny,x+y=ln(exey)x \times y = e^{\ln x + \ln y}, \qquad x + y = \ln(e^x \cdot e^y)

Each of these can in turn be rewritten as an EML tree. According to the paper, the shortest representations found by direct search put multiplication at depth 8, with most elementary functions deeper still. The representations are not compact, but they are uniform: every node is identical, and only constants and variables enter as leaves.

Grammar and structure

The grammar of EML expressions fits on one line.

Seml(S,S)1xS \to \mathrm{eml}(S, S) \mid 1 \mid x

This grammar corresponds one-to-one with complete binary trees. A complete binary tree of depth nn has 2n2^n leaves and 2n12^n - 1 internal nodes, and the number of such trees is counted by the Catalan numbers. In other words, searching for elementary functions reduces to a search problem over Catalan structures.

This structural uniformity is the same advantage NAND arrays have in hardware. With only one kind of node, parsers, compilers, optimizers, and visualization tools all get simpler. The tree below corresponds to lnx\ln x.

text
        eml
       /   \
      1    eml
           /   \
         eml    1
         /  \
        1    x

In the same way, x-x, x1x - 1, xyx \cdot y, and the rest are represented as trees of identical nodes with differing depths and shapes.

Application to symbolic regression

The practical payoff of a single-operator representation shows up in symbolic regression (SR), the problem of finding a closed-form expression from numerical data. Existing SR tools search by composing a heterogeneous operator set (addition, multiplication, trigonometric functions, exponential, logarithm, and so on). An incomplete choice of operators then risks leaving the correct expression unrepresentable.

EML trees sidestep that problem. A parameterized complete binary EML tree of depth nn is complete by construction for every elementary function at or below that depth. Each leaf is parameterized as one of three candidates.

  • Constant: αi\alpha_i
  • Scaled input variable: βix\beta_i x
  • A nested EML expression: γieml(,)\gamma_i \cdot \mathrm{eml}(\cdot, \cdot)

For example, the single-variable master formula at depth 2 looks like this.

text
F(x) = eml(
  α1 + β1·x + γ1·eml(α3 + β3·x, α4 + β4·x),
  α2 + β2·x + γ2·eml(α5 + β5·x, α6 + β6·x)
)

This formula has 14 free parameters. Setting α1=0,β1=1,γ1=0,α2=1\alpha_1 = 0, \beta_1 = 1, \gamma_1 = 0, \alpha_2 = 1 and the rest to zero yields exp(x)\exp(x). Setting α1=α2=1\alpha_1 = \alpha_2 = 1 and the rest to zero yields the constant ee. A softmax normalizes logits into a probability distribution. Reparameterizing onto a simplex, or handling the parameters with a softmax, makes the tree trainable with standard gradient-based optimizers such as Adam.

Odrzywolek presents an experiment fitting a depth-3 binary tree to numerical data generated from lnx\ln x. After a simplex reparameterization cut the degrees of freedom from 34 to 20, snapping the weights to 0 or 1 recovered exactly lnx\ln x. Extrapolation outside the fitting range was near-perfect as well. When the generating law really is an elementary function, an EML tree can return the closed form itself rather than an approximation.

EML is not unique

EML is not the only continuous Sheffer operator. The paper already presents two cousins.

  • edl(x,y)=exp(x)/ln(y)\mathrm{edl}(x, y) = \exp(x) / \ln(y), requiring the constant ee.
  • eml(y,x)=ln(x)exp(y)\mathrm{eml}(y, x) = \ln(x) - \exp(y), a variant with the arguments swapped, requiring the constant -\infty.

A ternary candidate appears too. T(x,y,z)=ex/lnx×lnz/eyT(x, y, z) = e^x / \ln x \times \ln z / e^y satisfies T(x,x,x)=1T(x, x, x) = 1, which gives it the distinctive property of not needing a separate distinguished constant. The author has announced a follow-up paper covering that direction.

The EML family does have one inconvenience relative to NAND. NAND can generate both 0 and 1 on its own (1NAND(x,NAND(x,x))1 \equiv \mathrm{NAND}(x, \mathrm{NAND}(x, x))), whereas EML cannot produce a constant independent of its inputs. A separate constant (1, ee, -\infty, and so on) must be supplied as a terminal. Whether a continuous binary Sheffer operator exists that works without any constant remains an open problem.

Even a simple necessary condition can be a trap. B(x,y)=(xy)/2B(x, y) = (x - y)/2 satisfies B(x,x)=xB(x, x) = x, but B(B(x,x),x)=0B(B(x, x), x) = 0, so it loses information. Traps like this are why systematic search is essential.

Summary

EML is the first concrete continuous-mathematics counterpart to NAND, a single primitive operator for the continuous setting. One line, exp(x)ln(y)\exp(x) - \ln(y), generates the four arithmetic operations, the transcendental and algebraic functions, and every constant needed. The representations get long, but in exchange you get structural uniformity: every representation is a binary tree of identical nodes.

That uniformity is not merely aesthetic; it pays off in practice. The moment a fully parameterized tree becomes trainable by gradient-based optimization, symbolic regression can sidestep the chronic incompleteness of operator-set selection. The most interesting implication of EML is that generating elementary functions and inferring them back from data both reduce to search over the same Catalan structure.

References

  • Andrzej Odrzywolek, All elementary functions from a single binary operator, arXiv:2603.21852 [cs.SC], submitted 2026-03-23 (v2 revised 2026-04-04). https://arxiv.org/abs/2603.21852
  • Andrzej Odrzywolek, A ternary Sheffer operator for elementary functions?, Acta Physica Polonica B, 2026 (in preparation).