Live data from Hacker News

All elementary functions from a single binary operator

arxiv.org

191–200 of 317 posts

Re: All elementary functions from a single binary operator

#191

This makes a good benchmark LLMs: ``` look at this paper: https://arxiv.org/pdf/2603.21852 now please produce 2x+y as a composition on EMLs ``` Opus(paid) - claimed that "2" is circular. Once I told it that ChatGPT have already done this, finished successfully. ChatGPT(free) - did it from the first try. Grok - produced estimation of the depth of the formula. Gemini - success Deepseek - Assumed some pre-existing knowl…

meta.ai in instant mode gets it first try too (I think?)

``` 2x + y = \operatorname{eml}\Big(1,\; \operatorname{eml}\big(\operatorname{eml}(1,\; \operatorname{eml}(\operatorname{eml}(1,\; \operatorname{eml}(\operatorname{eml}(L_2 + L_x, 1), 1) \cdot \operatorname{eml}(y,1)),1)\big),1\big)\Big) ```

for me Gemini hallucinated EML to mean something else despite the paper link being provided: "elementary mathematical layers"

Re: All elementary functions from a single binary operator

#192
post #172

Stupid question maybe (I am no mathematician), but aren't exp and ln really primitives? Aren't they implemented in terms of +,-,/,* etc? Or do we assume that we have an infinite lookup table for all possible inputs?

I think the point here is to explore the reduction of these functions to finite binary trees using a single binary operator and a single stopping constant. The operator used could be arbitrarily complex; the objective is to prove that other expressions in a certain family — in this case, the elementary functions — can be expanded as a finite (often incomplete) binary tree of that same operation. In other words, this…

I think there is still an implicit restriction on the complexity of the operator for this to be interesting. Otherwise you could design an operator which accepts a pair x,y and performs one of 2^k elementary binary operations by reading off the first k bits of x and applying the specified operation on the remainder of x and y. (This is kind of like how real-valued computational models become too powerful for complexity theory to work if you allow bitwise operations.)

Re: All elementary functions from a single binary operator

#193

I couldn't find any information on this, but is it possible that given how nicely exponentiation and logarithms differentiate and integrate, is it possible that this operator may be useful to simplify the process of finding symbolic solutions to integrals and derivatives?

It transform a simple expression like x+y into a long chain of "eml" applications, so:

Derivatives: No. Exercise: Write the derivative of f(x)=eml(x,x)

Integrals: No. No. No. Integrals of composition are a nightmare, and here they use long composition chain like g(x)=eml(1,eml(eml(1,x),1)).

Re: All elementary functions from a single binary operator

#194

Earlier quoted context omitted.

Where do you see exponential blow-up? If you replace every function in an expression tree with a tree of eml functions, that is a size increase by a constant factor. And the factor does not seem unreasonable but in the range 10 to 100.

The exponential blowup is in the symbolic regression section, where to search among depth K trees requires 2^K parameters. As an example, searching for sqrt(x) would require a tree of depth ~40 which is in the trillion-parameter regime.

But that is not an increase in the expression size, that is the effort for searching for an expression tree that fits some target function. And that is no different from searching an expression based on common functions, that is of course also exponential in the expression tree height. The difference is that a eml-based tree will have a larger height - by some constant factor - than a tree based on common functions. On the other hand each vertex in an eml-tree can only be eml, one, or an input variable whereas in a tree based on common functions each vertex can be any of the supported basis functions - counting constants and inputs variables as nullary functions.

Re: All elementary functions from a single binary operator

#195
post #96

Earlier quoted context omitted.

Are you under the impression that CPUs are made exclusively from NAND gates? You can't be serious.

Might’ve gotten mixed up with CMOS dominance, or I’m ignorant.

https://en.wikipedia.org/wiki/Mead%E2%80%93Conway_VLSI_chip_...

I'm guessing is what they're really talking about. Which is not about NAND gates.

Re: All elementary functions from a single binary operator

#197
post #192
post #172

Earlier quoted context omitted.

I think the point here is to explore the reduction of these functions to finite binary trees using a single binary operator and a single stopping constant. The operator used could be arbitrarily complex; the objective is to prove that other expressions in a certain family — in this case, the elementary functions — can be expanded as a finite (often incomplete) binary tree of that same operation. In other words, this…

I think there is still an implicit restriction on the complexity of the operator for this to be interesting. Otherwise you could design an operator which accepts a pair x,y and performs one of 2^k elementary binary operations by reading off the first k bits of x and applying the specified operation on the remainder of x and y. (This is kind of like how real-valued computational models become too powerful for complexi…

Exactly! If you didn't strictly limit the operator's complexity, you could just smuggle a Turing machine in via bitwise logic and turn the whole thing into a parlor trick. The beauty here is that eml(x,y) is a pure, continuous analytical function with no hidden branching whatsoever.

To clarify my earlier point: the author isn't trying to build a practical calculator or generate human-readable algebra. Using exp and ln isn't a cheat code because the goal is purely topological. The paper just proves that this massive, diverse family of continuous math can be mapped perfectly onto a uniform binary tree, without secretly burying a state machine inside the operator.

Re: All elementary functions from a single binary operator

#198
post #197
post #192

Earlier quoted context omitted.

I think there is still an implicit restriction on the complexity of the operator for this to be interesting. Otherwise you could design an operator which accepts a pair x,y and performs one of 2^k elementary binary operations by reading off the first k bits of x and applying the specified operation on the remainder of x and y. (This is kind of like how real-valued computational models become too powerful for complexi…

Exactly! If you didn't strictly limit the operator's complexity, you could just smuggle a Turing machine in via bitwise logic and turn the whole thing into a parlor trick. The beauty here is that eml(x,y) is a pure, continuous analytical function with no hidden branching whatsoever. To clarify my earlier point: the author isn't trying to build a practical calculator or generate human-readable algebra. Using exp and l…

> The beauty here is that eml(x,y) is a pure, continuous analytical function with no hidden branching whatsoever.

They use the complex version of logarithm, that has a lot of branching problems.

Re: All elementary functions from a single binary operator

#199

How would an architecture with a highly-optimized hardware implementation of EML compare with a traditional math coprocessor?

It would almost always be much, much worse. Practical numerical libraries (whether implemented in hardware or software) contain lots of redundancy, because their goal is to give you an optimized primitive as close as possible to the operation you actually want. For example, the library provides an optimized tan(x) to save you from calling sin(x)/cos(x), because one nasty function evaluation (as a power series, lookup…

I actually don't think this is true -

Traditional processors, even highly dedicated ones like TMUs in gpus, still require being preconfigured substantially in order to switch between sin/cos/exp2/log2 function calls, whereas a silicon implementation of an 8-layer EML machine could do that by passing a single config byte along with the inputs. If you had a 512-wide pipeline of EML logic blocks in modern silicon (say 5nm), you could get around 1 trillion elementary function evaluations per second on 2.5ghz chip. Compare this with a 96 core zen5 server CPU with AVX-512 which can do about 50-100 billion scalar-equivalent evaluations per second across all cores only for one specific unchanging function.

Take the fastest current math processors: TMUs on a modern gpu: it can calculate sin OR cos OR exp2 OR log2 in 1 cycle per shader unit... but that is ONLY for those elementary functions and ONLY if they don't change - changing the function being called incurs a huge cycle hit, and chaining the calculations also incurs latency hits. An EML coprocessor could do arcsinh(x² + ln(y)) in the same hardware block, with the same latency as a modern cpu can do a single FMA instruction.

Re: All elementary functions from a single binary operator

#200
post #58

Earlier quoted context omitted.

> Multiplication alone requires depth-8 trees with 41+ leaves i.e. minimal operator vocabulary trades off against expression length. That is sort of comparable to how NAND simplify scaling. Division is hell on gates. The single component was the reason scaling went like it did. There was only one gate structure which had to improve to make chips smaller - if a chip used 3 different kinds, then the scaling would've re…

I'm not sure what you mean by this? It's true that any Boolean operation can be expressed in terms of two-input NAND gates, but that's almost never how real IC designers work. A typical standard cell library has lots of primitives, including all common gates and up to entire flip-flops and RAMs, each individually optimized at a transistor level. Realization with NAND2 and nothing else would be possible, but much less…

Yeah, what you're going to get is more efficient proofs: you can do induction on one case to get results about elementary functions. Not sure where anyone's getting computational efficiency thoughts from this.
Post reply on HN