ABSTRACT (original preprint): A single two-input gate suffices for all of Boolean logic in digital hardware. No comparable primitive has been known for continuous mathematics: computing elementary functions such as sin, cos, sqrt, and log has always required multiple distinct operations. Here I show that a single binary operator,
eml(x,y)=exp(x)-ln(y)
, together with the constant 1, generates the standard repertoire of a scientific calculator. This includes constants such as e, pi, and i; arithmetic operations including addition, subtraction, multiplication, division, and exponentiation as well as the usual transcendental and algebraic functions. For example,
exp(x)=eml(x,1)
,
ln(x)=eml(1,eml(eml(1,x),1))
, and likewise for all other operations. That such an operator exists was not anticipated; I found it by systematic exhaustive search and established constructively that it suffices for the concrete scientific-calculator basis. In EML (Exp-Minus-Log) form, every such expression becomes a binary tree of identical nodes, yielding a grammar as simple as
S→1|eml(S,S)
. This uniform structure also enables gradient-based symbolic regression: using EML trees as trainable circuits with standard optimizers (Adam), I demonstrate the feasibility of exact recovery of closed-form elementary functions from numerical data at shallow tree depths up to 4. The same architecture can fit arbitrary data, but when the generating law is elementary, it may recover the exact formula. CITATION (original preprint): Andrzej Odrzywołek (2026), All elementary functions from a single binary operator, arXiv:2603.21852. https://doi.org/10.48550/arXiv.2603.21852​
​Full code and files: https://github.com/VA00/SymbolicRegressionPackage​
​https://doi.org/10.5281/zenodo.19183007
This notebook is demonstrating brute-force symbolic regression through exhaustive search over expression trees built from user-specified mathematical primitives. It serves as the practical implementation guide and computational proof for the above research article.
The package SymbolicRegressionPackage is designed to identify analytic formulas for numeric values, univariate data, and integer sequences using RecognizeConstant, RecognizeFunction, and RecognizeSequence, which search in order of growing Kolmogorov complexity. Furthermore, RandomExpression and EnumerateExpressions generate random or exhaustive mathematical expression trees, while VerifyBaseSet performs a bootstrapping completeness check to verify if given primitives can reconstruct all standard elementary functions.
The package’s VerifyBaseSet procedure enables systematic ablation testing on standard mathematical operations, a computational process that led to the discovery of the Exp-Minus-Log (EML) operator,
eml(x,y)=exp(x)−ln(y)
. The notebook demonstrates how this single continuous operator, paired with the constant 1, constructs the entire algorithmic repertoire of a scientific calculator and forms uniform binary trees that facilitate exact gradient-based symbolic regression.
Examples of binary EML trees equivalent to few important simplest formulas

About SymbolicRegressionPackage

Wolfram Mathematica package for brute-force symbolic regression: exhaustive search over expression trees built from user-specified constants, unary functions, and binary operations.

Core functionality

◼
  • RecognizeConstant[x] — identify an analytic formula for a numeric value, searching in order of growing Kolmogorov complexity.
  • ◼
  • RecognizeFunction, RecognizeSequence — same idea for univariate data and integer sequences.
  • ◼
  • RandomExpression[], EnumerateExpressions[] — generate random or exhaustive expression trees from given building blocks.
  • ◼
  • VerifyBaseSet[constants, functions, operations] — bootstrapping completeness check: given a set of primitives, verify whether elementary functions can be reconstructed from given primitives.
  • Importing package

    Package file is attached at the end of this post.
    In[]:=
    Import[NotebookDirectory[]<>"SymbolicRegression.m"]
    Alternatively
    (*Import["https://raw.githubusercontent.com/VA00/SymbolicRegressionPackage/master/SymbolicRegression.m"]*)

    Examples

    Generate random function
    RandomExpression[]
    Out[]=
    -
    π
    (
    x
    (-1)
    )
    (
    x
    (-1)
    +π)
    List first functions
    EnumerateExpressions[]
    Out[]=
    -1,x,,π,Log[x],1,-2,-1+x,2x,-1+,+x,2,-x,
    2
    x
    ,-,x,
    2
    
    ,
    x
    (-1)
    ,
    
    (-1)
    ,
    1
    x
    ,
    x
    x
    ,
    
    x
    ,
    1
    
    ,
    x
    
    ,
    
    
    
    List all expression up to tree level 2, starting with x and - 1, no univariate functions, and division
    EnumerateExpressions[2,{x,-1},{},{Divide}]
    Out[]=
    x,-1,1,-x,-
    1
    x
    ,-
    2
    x
    ,
    1
    x
    ,
    2
    x
    ,-
    1
    2
    x
    ,
    1
    2
    x
    
    Enumerate expressions using RPN calculator buttons pressed 2 times
    EnumerateExpressionsRPN[2]
    Out[]=
    π,
    π
    2
    ,1,Log[π],Log[2]
    Random function of three variables up to tree level 4
    RandomExpression[4,{x,y,z}]
    Out[]=
    y+
    y
    (
    z
    z
    )
    z
    y
    +
    y
    (
    z
    z
    )
    z
    Find some simple solution to ordinary differential equation
    Select[EnumerateExpressions[3,{x},{Sin,Cos},{Plus,Times}],D[#,x,x]+#0&]
    Out[]=
    {Sin[x],Cos[x],2Sin[x],Cos[x]+Sin[x],2Cos[x],3Sin[x],Cos[x]+2Sin[x],4Sin[x],2Cos[x]+Sin[x],Cos[x]+3Sin[x],2Cos[x]+2Sin[x],3Cos[x],3Cos[x]+Sin[x],4Cos[x]}
    Generate some expression using user - defined or unnamed functions
    In[]:=
    Suc[x_]:=x+1
    In[]:=
    Inv[x_]:=1/x
    head must be ‘ Symbol` ! E . g . THIS IS WRONG -> Inv = 1/# &
    Head[Inv]
    Out[]=
    Symbol
    Generate some fractions via continued fraction starting from 1
    EnumerateExpressions[6,{1},{Suc,Inv},{}]
    Out[]=
    1,2,3,
    1
    2
    ,4,
    3
    2
    ,
    1
    3
    ,5,
    5
    2
    ,
    4
    3
    ,
    1
    4
    ,
    2
    3
    ,6,
    7
    2
    ,
    7
    3
    ,
    5
    4
    ,
    5
    3
    ,
    1
    5
    ,
    2
    5
    ,
    3
    4
    ,7,
    9
    2
    ,
    10
    3
    ,
    9
    4
    ,
    8
    3
    ,
    6
    5
    ,
    7
    5
    ,
    7
    4
    ,
    1
    6
    ,
    2
    7
    ,
    3
    7
    ,
    4
    5
    ,
    3
    5
    
    Generate random easy rational integration stuff for first year students
    Table[RandomExpression[3,{x,-1,2},{},{Plus,Times,Divide}],12]//DeleteDuplicates
    Out[]=
    -2+x,
    2
    3
    ,
    x
    4
    ,
    8
    x
    ,0,x,2+
    x
    -1+2x
    ,1,-2x,2,2+4x,
    2
    x
    
    In[]:=
    Integrate[%,x]
    Out[]=
    -2x+
    2
    x
    2
    ,
    2x
    3
    ,
    2
    x
    8
    ,8Log[x],0,
    2
    x
    2
    ,2x+
    1
    4
    (-1+2x)+
    1
    4
    Log[-1+2x],x,-
    2
    x
    ,2x,2x+2
    2
    x
    ,
    3
    x
    3
    
    Something to make good students busy
    In[]:=
    Table[RandomExpression[8,{x,-1},{},{Plus,Times,Divide}],22]//Together//Sort//Last(*somethingtomakegoodstudentsbusy*)
    Out[]=
    -2x(1+
    3
    x
    )
    In[]:=
    Integrate[%,x]
    Out[]=
    -2
    2
    x
    2
    +
    5
    x
    5
    Recognize some unknown constant, roughly 30 seconds, disable typical harmless error messages
    In[]:=
    Off[Power::infy,Power::indet]​​Off[Infinity::indet]​​Off[General::ovfl,General::munfl,General::unfl]​​Off[N::meprec]
    In[]:=
    RecognizeConstant[1.301209891047537845074285665241638476828187582300230737]//AbsoluteTiming
    n=
    SymbolicRegression`Private`n$31827
    k=
    SymbolicRegression`Private`k$31827
    SymbolicRegression`Private`code$31827
    Out[]=
    24.2773,
    1+Log[2]
    ,0,{,2,Log,2,-1,Power,Power,Plus,Abs},1.30120989104753784507428566524163847682818758230023074
    Recognize constant composed of known subexpressions, roughly 0.01 s
    In[]:=
    RecognizeConstant[1.301209891047537845074285665241638476828187582300230737,{1,2},{Log,Sqrt},{Plus},DisplayProgress->False]//AbsoluteTiming
    Out[]=
    0.004844,
    1+Log[2]
    ,0,{1,2,Log,Plus,Sqrt,Abs},1.30120989104753784507428566524163847682818758230023074
    Recognize function from some “experimental” data
    In[]:=
    RecognizeFunction[{{0,0},{1,1},{2,1.4142135623730951}}]
    n=
    SymbolicRegression`Private`n$32305
    k=
    SymbolicRegression`Private`k$32305
    SymbolicRegression`Private`code$32305
    2026-04-16T19:59:45{x} err=0.343146 n=1 k=0 x
    2026-04-16T19:59:45{x,2,Log,Times} err=0.0949381 n=4 k=5 xLog[2]
    2026-04-16T19:59:45{x,2,Log,Power} err=0.041044 n=4 k=5
    Log[2]
    x
    2026-04-16T19:59:45{x,,-1,Power,Power} err=0.0153163 n=5 k=8
    1
    
    x
    2026-04-16T19:59:45{x,2,-1,Power,Power} err=0. n=5 k=8
    x
    Recognize integer sequence
    Try to find integrand for which Mathematica Integrate fails
    Check if Mathematica indeed is able to compute all elementary functions? Of course it is ...)
    Sample part of the output

    Discovery of EML operator candidate

    Re-creation of the original run, which led to discovery of EML operator candidate.
    Last lines of the output

    CITE THIS NOTEBOOK

    All elementary functions from a single binary operator​
    by Andrzej Odrzywołek​
    Wolfram Community, STAFF PICKS, April 17, 2026
    ​https://community.wolfram.com/groups/-/m/t/3694198