Live data from Hacker News

All elementary functions from a single binary operator

arxiv.org

131–140 of 317 posts

Re: All elementary functions from a single binary operator

#131

Earlier quoted context omitted.

What are you responding to?

I think that you may have replied before I saved my entire response, so I am not sure how much of it you had read before replying yourself. I have replied to your last statement: > "you can use the second parameter of a binary function to identify a unary function just as you can use the fourth parameter of a quaternary function to identify a trinary one." As I have explained above, what you propose does not work. It…

> As I have explained above, what you propose does not work. It works in functions with 3 or more parameters, but it does not work in binary functions, because you cannot make binary functions from unary functions (without using some auxiliary binary functions).

I have no idea what you're trying to say. If you can use one parameter to identify a desired function, then obviously you can use a function of arity n+1 to define as many functions of arity n as you want, and it doesn't matter what the value of n is.

For example:

selector(3, "sin") = sin 3

selector(3, "log2") = log₂ 3

This works going from arity 4 to arity 3, and it also works going from arity 2 to arity 1. Your "response" talks about going from arity 1 to arity 2, a non sequitur.

Re: All elementary functions from a single binary operator

#132

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…

> Once I told it that ChatGPT have already done this, finished successfully. TIL you can taunt LLMs. I guess they exhibit more competitive spirit than I thought.

[dead]

Re: All elementary functions from a single binary operator

#133

Earlier quoted context omitted.

> Once I told it that ChatGPT have already done this, finished successfully. TIL you can taunt LLMs. I guess they exhibit more competitive spirit than I thought.

Opus seems to be wired currently to get you to spend more money. Once you tell it "Stop defrauding me, just get to the right solution" it often gets it.

I am like "Yeah ok, use the Arcee Trinity models!" and its like, you got it boss, 3 opus agents in parallel, got it!

Re: All elementary functions from a single binary operator

#134
The paper somehow seems to be missing the most interesting part, i.e. the optimal constructions of functions from eml in a readable format.

Here is my attempt. I think they should be optimal up to around 15 eml.nodrs, the latter might not be:

# 0

1=1

# 1

exp(x)=eml(x,1)

e-ln(x)=eml(1,x)

e=exp(1)

# 2

e-x=e-ln(exp(x))

# 3

0=e-e

ln(x)=e-(e-ln(x))

exp(x)-exp(y)=eml(x,exp(exp(y)))

# 4

id(x)=e-(e-x)

inf=e-ln(0)

x-ln(y)=eml(ln(x),y)

# 5

x-y=x-ln(exp(y))

-inf=e-ln(inf)

# 6

-ln(x)=eml(-inf,x)

ln(ln(x))=ln(ln(x))

# 7

-x=-ln(exp(x))

-1=-1

x^-1=exp(-ln(x))

ln(x)+ln(y)=e-((e-ln(x))-ln(y))

ln(x)-ln(y)=ln(x)-ln(y) # using x - ln(y)

# 8

xy=exp(ln(x)+ln(y))

x/y=exp(ln(x)-ln(y))

# 9

x + y = ln(exp(x))+ln(exp(y))

2 = 1+1

# 10

ipi = ln(-1)

# 13

-ipi=-ln(-1)

x^y = exp(ln(x)y)

# 16

1/2 = 2^-1

# 17

x/2 = x/2

x2 = x2

# 20

ln(sqrt(x)) = ln(x)/2

# 21

sqrt(x) = exp(ln(sqrt(x)))

# 25

sqrt(xy) = exp((ln(x)+ln(y))/2)

# 27

ln(i)=ln(sqrt(-1))

# 28

i = sqrt(-1)

-pi^2 = (ipi)(ipi)

# 31

pi^2 = (ipi)(-ipi)

# 37

exp(xi)=exp(xi)

# 44

exp(-xi)=exp(-(xi))

# 46

pi = (ipi)/i

# 90+x?

2cos(x)=exp(xi)+exp(-xi))

# 107+x?

cos(x) = (2cos(x))/2

# 118+x?

2sin(x)=(exp(x*i)-exp(-xi))/i # using exp(x)-exp(y)

# 145+x?

sin(x) = (2sin(x))/2

# 217+3x?

tan(x) = 2sin(x)/(2cos(x))

Re: All elementary functions from a single binary operator

#135
post #57

This is neat, but could someone explain the significance or practical (or even theoretical) utility of it?

From the paper: > Everyone learns many mathematical operations in school: fractions, roots, logarithms, and trigonometric functions (+, −, ×, /, sqrt, sin, cos, log, …), each with its own rules and a dedicated button on a scientific calculator. Higher mathematics reveals that many of these are redundant: for example, trigonometric ones reduce to the complex exponential. How far can this reduction go? We show that it…

Actually we know this for a long time. The universal approximation theorem states that any arbitrary function can be modelled through a nonlinear basis function so long as capacity is big enough. The practical bit here is knowing how many basis functions can be approximated with a two operators. That’s new!

Re: All elementary functions from a single binary operator

#136
post #41

I don't mean to shit on their interesting result, but exp or ln are not really that elementary themselves... it's still an interesting result, but there's a reason that all approximations are done using series of polynomials (taylor expansion).

> but there's a reason that all approximations are done using series of polynomials (taylor expansion). "All" is a tall claim. Have a look at https://perso.ens-lyon.fr/jean-michel.muller/FP5.pdf for example. Jump to slide 18: > Forget about Taylor series > Taylor series are local best approximations: they cannot compete on a whole interval. There is no need to worry about "sh-tt-ng" on their result when there is so m…

Padé approximations are not discussed as much, but they are much more stable than Taylor series approximations.

Re: All elementary functions from a single binary operator

#137
post #43

Earlier quoted context omitted.

In general, no.

It's about symbolic computation more than calculations.

Yes, and it's not all that useful there either.

Eg ln is a rather complicated construct, it's not even a function. That's because for complex numbers, e^x is not bijective, and thus its inverse ain't a function.

So using that complicated construct to define something simpler like addition invites extra complexity.

Re: All elementary functions from a single binary operator

#138
post #46

EDIT: please change the article link to the most recent version (as of now still v2), it is currently pointing to the v1 version which misses the figures. I'm still reading this, but if this checks out, this is one of the most significant discoveries in years. Why use splines or polynomials or haphazardly chosen basis functions if you can just fit (gradient descent) your data or wave functions to the proper computati…

From my experience of working in this problem domain for the last year, I'd say it is pretty powerful but the "too good to be true part" comes from that EML buys elegance through exponential expression blow-up. Multiplication alone requires depth-8 trees with 41+ leaves i.e. minimal operator vocabulary trades off against expression length. There's likely an information-theoretic sweet spot between these extremes. It'…

Yeah, seems like classic representation vs traversal complexity trade-off a la David Marr.

Re: All elementary functions from a single binary operator

#139
post #46

EDIT: please change the article link to the most recent version (as of now still v2), it is currently pointing to the v1 version which misses the figures. I'm still reading this, but if this checks out, this is one of the most significant discoveries in years. Why use splines or polynomials or haphazardly chosen basis functions if you can just fit (gradient descent) your data or wave functions to the proper computati…

From my experience of working in this problem domain for the last year, I'd say it is pretty powerful but the "too good to be true part" comes from that EML buys elegance through exponential expression blow-up. Multiplication alone requires depth-8 trees with 41+ leaves i.e. minimal operator vocabulary trades off against expression length. There's likely an information-theoretic sweet spot between these extremes. It'…

Its not too good to be trough...

Its a way to make mathematical formulas completely unreadable. Its a way to spend more time on computing functions like log (3 ems reqd) while using more precision. Its a way to blow the mind of muggles reading hacker news.

Post reply on HN