Live data from Hacker News

All elementary functions from a single binary operator

arxiv.org

281–290 of 317 posts

Re: All elementary functions from a single binary operator

#281

I’d be really interested in an analysis of tau in light of this discovery. Would tau fit more naturally here than pi, as it does in other examples?

The construction so far uses ln(-1) to get to pi - so far no easy way to tau.

So, to follow up I'd say in the context of EML I think ln(-1) = pi*i is the natural fit. Pi and Tau are both more advanced constructs.

Re: All elementary functions from a single binary operator

#282

Earlier quoted context omitted.

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.…

yes, and even this search doesn't actually require trillions of parameters, since the switching parameters will be sparse, which means you can apply a FakeParameter trick: suppose I want a trillion sparse parameters, thats a million by a million. Let's just model those parameters as inner products of a million vectors each of some dimension N. Now its in the regime of megabytes or a GB.

For extreme regularization, one can even go down to 10 arbitrary precision numbers: if we have a single vector of 10 dimensions, we can re-order the components 10! different ways.

10! = 3 628 800

so we can retrieve ~3M vectors from it, and we can form about 10 T inner products.

Re: All elementary functions from a single binary operator

#284

Earlier quoted context omitted.

You're completely missing the point here. You can reduce all Boolean logic to NAND, but that doesn't actually mean that semiconductor fabs translate their HDL to NAND gates, because it is possible to build complex gates that directly implement higher level operations in a single gate. Your "cost of computation" objection can be easily resolved by adding more operators, which makes it boring from a research perspectiv…

Show me a way to physically compute exp or ln that is less gates than add. More gates means costlier in $, more energy in compute, and for these functions, higher latency. You don’t get to make up free ops, claim there is no cost in reality, and hand wave away reality. There are infinitely many ways to do what the paper did. There’s no gain other than it’s pretty. It loses on every practical front to simply using cur…

> Show me a way to physically compute exp or ln that is less gates than add.

IIRC a resistor in series to a capacitor does the trick, for exp.

Re: All elementary functions from a single binary operator

#285

Earlier quoted context omitted.

They are not infinite series per se. They can be represented by infinite series in several ways but there are standard ways to define them that do not involve infinite series. The logarithm in particular is not even represented by an infinite series (in form of Taylor expansion) defined in the whole complex plane. And knowledge/use of trigonometric functions greatly precedes such infinite series representations. More…

Any transcendental function can be produced by arithmetic, since its complete for R. Go ahead and show how to compute exp or ln without an infinite series without circular reasoning. You can’t, since they’re transcendental. There are infinitely many ways to make these binary operators. Picking extremely high compute cost ones really doesn’t make a good basis for computation.

> Any transcendental function can be produced by arithmetic, since its complete for R.

Not without some form of limit process or construction. You can approximate e with the basic arithmetic operations but not actually get an exact form in finite steps. And you definitely cannot transverse an infinite binary tree, so the main point of the result in the article is missed by your arguments.

Again, you are mixing separate things. Nobody said that eml is some way to approximate elementary functions more efficiently. It is a way to express elementary functions in a finite amount of operations. Meaning, computing symbolically, not numerically. Eg I may care that exp(3)*exp(2)=exp(5) without caring to approximate exp(5) numerically. The paper is literally under "Computer Science > Symbolic Computation", not "numerical analysis" or "engineering" after all.

And to be precise:

> Go ahead and show how to compute exp or ln without an infinite series without circular reasoning. You can’t, since they’re transcendental.

You don't necessarily need "infinite series", you need some limit process. A basic example is that exp(x) can be approximated by (1 + x/n)^n for large n. For the logarithm you can use a formula involving the arithmetic–geometric mean which you can approximate using an iterative process/recursion without infinite series. You can also approximate the exponential by using Newton's method together with that, see [0].

[0] Fast Computations of the Exponential Function https://link.springer.com/chapter/10.1007/3-540-49116-3_28

Re: All elementary functions from a single binary operator

#286

Earlier quoted context omitted.

I think the point is that it is _finite_. if you allow infinite expressions then the basic monomial basis or quotients thereof are “even simpler”

It’s only finite by putting the infinite series into an operation. And the basic monomial basis is not a single binary operation capable of reproducing the set of basic arithmetic ops. If you want trivial and basic, pick Peano postulates. But that’s not what this thread was about.

well, the statement is: is there a single operation, built from elementary operations, such that all _other_ elementary operations have finite representations.

this preprint answers that in the affirmative

otoh, (x, y) -> 1/(x-y) does not answer this question at all. you can argue that the preprint does so "via the infinite series in an operation" (which I have no idea what that means; surely if exp(x) qualifies then so must 1/(x-y) if we pick a monomial basis?) but ¯\_(ツ)_/¯

now, do I think that this is groundbreaking magical research (as I'm currently seeing on twitter) no... But it's neat!

Re: All elementary functions from a single binary operator

#287

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…

this should be a tangential proof for the dying bunch of people who still believe that LLMs are just parrots. EML are literally a new invention

Re: All elementary functions from a single binary operator

#288
post #280

Earlier quoted context omitted.

> 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.

Well, the paper explicitly takes the principal branch to solve this. So it isn't exploiting the branching for computation.

I agree, as the sibling comment there are two different things that are named "branches". Anyway, to get the principal branch in the microprocessor it's necessary to implement "atan2" that has a lot of special cases.

For example, IIRC ln( -inf.0 + y * i ) = ´+inf.0 + pi * sign(y)

Re: All elementary functions from a single binary operator

#289

Earlier quoted context omitted.

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)).

Agreed on integrals, but the derivative is relatively simple? If f(x) = exp(x) - ln(x) then f’(x) = exp(x) - 1/x, which is representable in eml form as well. To the overall point though, I don’t think it helps make derivatives easier though. To refactor a function to eml’s is far more work than refactoring into something that’s trivially differentiable with the product rule and chain rule.

You mean

  f'(x) = eml(x,x) + eml(1,eml(eml(1,x)),1) + eml(eml(1, exp(eml(1, 1))),-eml(1, eml(eml(1, x))),1)
and I still have to macroexpand a few

  x-y = eml(eml(1, exp(eml(1, x))), eml(y,1)) 
but I got really bored

Re: All elementary functions from a single binary operator

#290
post #284

Earlier quoted context omitted.

Show me a way to physically compute exp or ln that is less gates than add. More gates means costlier in $, more energy in compute, and for these functions, higher latency. You don’t get to make up free ops, claim there is no cost in reality, and hand wave away reality. There are infinitely many ways to do what the paper did. There’s no gain other than it’s pretty. It loses on every practical front to simply using cur…

> Show me a way to physically compute exp or ln that is less gates than add. IIRC a resistor in series to a capacitor does the trick, for exp.

No, it approximates exp poorly over an infinitesimally small interval compared to exp. Resistors and capacitors are no where ideal components, which is why they have spec sheets to show how quickly they diverge.

If we’re making sloppy approximations to a tiny range of exp, then I too can do it with a few terms.

Post reply on HN