13 ms·
All elementary functions from a single binary operator
- BobbyTables2 6mo agoHow does one actually add with this?
- bzax 6mo agoWell, once you've derived unary exp and ln you can get subtraction, which then gets you unary negation and you have addition.
- freehorse 6mo agoAnd then by using the fact that the exponential turns addition into multiplication, you get multiplication (and subtraction gives division).
- nick238 6mo agoDon't know adding, but multiplication has diagram on the last page of the PDF. xy = eml(eml(1, eml(eml(eml(eml(1, eml(eml(1, eml(1, x)), 1)), eml(1, eml(eml(1, eml(y, 1)), 1))), 1), 1)), 1) From Table 4, I think addition is slightly more complicated?
- Charon77 6mo agox+y = ln(exp(x) * exp(y)) exp(a) = eml(a, 1) ln(a)=eml(1,eml(eml(1,a),1)) Plugging those in is an excercise to the reader
- simplesighman 6mo agoThanks for posting that. You had a transcribing typo which was corrected in the ECMAScript below. Here's the calculation for 5 x 7: const eml = (x,y) => Math.exp(x) - Math.log(y); const mul = (x,y) => eml(eml(1,eml(eml(eml(1,eml(eml(1,eml(1,x)),1)),eml(1,eml(eml(1,eml(y,1)),1))),1)),1); console.log(mul(5,7)); > 35.00000000000001 For larger or negative inputs you get a NaN because ECMAScript has limited precision and doesn't handle imaginary numbers.
- xigoi 6mo ago> For larger or negative inputs you get a NaN because ECMAScript has limited precision and doesn't handle imaginary numbers. This also shows why EML is not practical for computation.
- curtisf 6mo agoIt's basically using the "-" embedded in the definition of the eml operator. Table 4 shows the "size" of the operators when fully expanded to "eml" applications, which is quite large for +, -, ×, and /. Here's one approach which agrees with the minimum sizes they present: eml(x, y ) = exp(x) − ln(y) # 1 + x + y eml(x, 1 ) = exp(x) # 2 + x eml(1, y ) = e - ln(y) # 2 + y eml(1, exp(e - ln(y))) = ln(y) # 6 + y; construction from eq (5) ln(1) = 0 # 7 After you have ln and exp, you can invert their applications in the eml function eml(ln x, exp y) = x - y # 9 + x + y Using a subtraction-of-subtraction to get addition leads to the cost of "27" in Table 4; I'm not sure what formula leads to 19 but I'm guessing it avoids the expensive construction of 0 by using something simpler that cancels: x - (0 - y) = x + y # 25 + {x} + {y}
- deleted 6mo ago[deleted]
- peterlk 6mo agoReminds me a bit of the coolest talk I ever got to see in person: https://youtu.be/FITJMJjASUs?si=Fx4hmo77A62zHqzy https://youtu.be/FITJMJjASUs?si=Fx4hmo77A62zHqzy It’s a derivation of the Y combinator from ruby lambdas
- thaumasiotes 6mo agoHave you gone through The Little Schemer? More on topic: > 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. I was taught that these were all hypergeometric functions. What distinction is being drawn here?
- adrian_b 6mo agoHypergeometric functions are functions with 4 parameters. When you have a function with many parameters it becomes rather trivial to express simpler functions with it. You could find a lot of functions with 4 parameters that can express all elementary functions. Finding a binary operation that can do this, like in TFA, is far more difficult, which is why it has not been done before. A function with 4 parameters can actually express not only any elementary function, but an infinity of functions with 3 parameters, e.g. by using the 4th parameter to encode an identifier for the function that must be computed.
- thaumasiotes 6mo ago> Hypergeometric functions are functions with 4 parameters. Granted, but the claim in the abstract says: >> computing elementary functions such as sin, cos, sqrt, and log has always required multiple distinct operations And I don't see how this is true as to hypergeometric functions in a way that isn't shared by the approach in the paper. > Finding a binary operation that can do this, like in TFA, is far more difficult, which is why it has not been done before. > A function with 4 parameters can actually express not only any elementary function, but an infinity of functions with 3 parameters, e.g. by using the 4th parameter to encode an identifier for the function that must be computed. These statements seem to be in direct conflict with each other; 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.
- selcuka 6mo agoSo, like brainf*ck (the esoteric programming language), but for maths?
- Lerc 6mo agoBut even tighter. With eml and 1 you could encode a funtion in rpn as bits. Although you also need to encode where to put the input. The real question is what emoji to use for eml when written out.
- zephen 6mo ago> The real question is what emoji to use for eml when written out. Some Emil or another, I suppose. Maybe the one from Ratatouille, or maybe this one: https://en.wikipedia.org/wiki/Emil_i_L%C3%B6nneberga https://en.wikipedia.org/wiki/Emil_i_L%C3%B6nneberga
- Charon77 6mo agoNot brainf*ck. This is the SUBLEQ equivalent of math https://en.wikipedia.org/wiki/One-instruction_set_computer#Subtract_and_branch_if_less_than_or_equal_to_zero https://en.wikipedia.org/wiki/One-instruction_set_computer#S...
- zephen 6mo agoDid you maybe mean to respond to the parent of my comment?
- selcuka 6mo agoSo brainf*ck in binary? I'm kidding, of course. You can encode anything in bits this way.
- vintermann 6mo agoIn rpn notation you just put the input on the stack, right? The encodings seems like they could get pretty big, and encodings certainly wouldn't be unique, but you should be able to encode pretty much any constant you could think of.
- nonfamous 6mo agoHow would an architecture with a highly-optimized hardware implementation of EML compare with a traditional math coprocessor?
- wildzzz 6mo agoDreadfully slow for integer math but probably some similar performance to something like a CORDIC for specific operations. If you can build an FPU that does exp() and ln() really fast, it's simple binary tree traversal to find the solution.
- AlotOfReading 6mo agoYou already have an FPU that approximates exp() and ln() really fast, because float<->integer conversions approximate the power 2 functions respectively. Doing it accurately runs face-first into the tablemaker's dilemma, but you could do this with just 2 conversions, 2 FMAs (for power adjustments), and a subtraction per. A lot of cases would be even faster. Whether that's worth it will be situational.
- xpe 6mo agoWhat are some of your favorite sources to dig into this field as a whole?
- AlotOfReading 6mo agoAnything discussing fast inverse sqrt will go over the logarithmic side [0], as it's the key insight behind that code. Exp is just the other direction. It's not widely documented in text otherwise, to my knowledge. [0] https://github.com/francisrstokes/githublog/blob/main/2024/5/29/fast-inverse-sqrt.md https://github.com/francisrstokes/githublog/blob/main/2024/5...
- wildzzz 6mo agoRight, I meant to say fast and accurate. You could run into quite a lot of floating point error using this for everything.
- supermdguy 6mo agoNext step is to build an analog scientific calculator with only EML gates
- jekude 6mo agoWhat would physical EML gates be implemented in reality? Posts like these are the reason i check HN every day
- DoctorOetker 6mo agoprobably with op-amps
- KK7NIL 6mo agoBoth BJTs and FETs have intrinsic exponential/logarithmic behaviors (at low biases) due to charge density being given by the Fermi-Dirac distribution since electrons are fermions.
- tripdout 6mo agoInteresting, but is the required combination of EML gates less complex than using other primitives?
- eru 6mo agoIn general, no.
- notorandit 6mo agoIt's about symbolic computation more than calculations.
- eru 6mo agoYes, 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.
- jedimastert 6mo agoDepends on how you define complexity? Like when the Apollo guidance computer was made, the bottleneck was making integrated chips so they only made one, the NOR gate, and a whackton of routing to build out an entire CPU. Horribly complex routing, very simplified integrated circuit construction
- hyperhello 6mo ago> eml(x,y)=exp(x)-ln(y) Exp and ln, isn't the operation its own inverse depending on the parameter? What a neat find.
- thaumasiotes 6mo ago> isn't the operation its own inverse depending on the parameter? This is a function from ℝ² to ℝ. It can't be its own inverse; what would that mean?
- hyperhello 6mo agoeml(1,eml(x,1)) = eml(eml(1,x),1) = exp(ln(x)) = ln(exp(x)) = x
- thaumasiotes 6mo agoBut f(x) = eml(1, x) and g(x) = eml(x, 1) are different operations. What operation are you saying is supposed to be its own inverse?
- freehorse 6mo agoeml(1,eml(x,1)) = e + x and eml(eml(1,x),1) = e^e * x
- hyperhello 6mo agoOkay, I’m tired. Not quite inverse but per the title , must be a way.
- freehorse 6mo agoI was mistaken above in the first identity, it is eml(1,eml(x,1)) = e - x Which then if you iterate gives x (ie is inverse of itself). eml(1,eml(eml(1,eml(x,1)),1)) = x
- deleted 6mo ago[deleted]
- zephen 6mo agoJudging by the title, I thought I would have a good laugh, like when the doctor discovered numerical integration and published a paper. But no... This is about continuous math, not ones and zeroes. Assuming peer review proves it out, this is outstanding.
- paulpauper 6mo agoI don't think this is ever making it past the editor of any journal, let alone peer review. Elementary functions such as exponentiation, logarithms and trigonometric functions are the standard vocabulary of STEM education. Each comes with its own rules and a dedicated button on a scientific calculator; What? and No comparable primitive has been known for continuous mathematics: computing elementary functions such as sin, cos, √ , and log has always required multiple distinct operations. Here we show that a single binary operator Yeah, this is done by using tables and series. His method does not actually facilitate the computation of these functions. There is no such things as "continuous mathematics". Maybe he meant to say continuous function? Looking at page 14, it looks like he reinvented the concept of the vector valued function or something. The whole thing is rediscovering something that already exists.
- traes 6mo agoThis preprint was written by a researcher at an accredited university with a PhD in physics. I'm sure they know what a vector valued function is. The point of this paper is not to revolutionize how a scientific calculator functions overnight, its to establish a single binary operation that can reproduce the rest of the typical continuous elementary operations via repeated application, analogous to how a NAND or NOR gate creates all of the discrete logic gates. Hence, "continuous mathematics" as opposed to discrete mathematics. It seems to me you're being overly negative without solid reasoning.
- paulpauper 6mo agoits to establish a single binary operation that can reproduce the rest of the typical continuous elementary operations via repeated application, But he didn't show this though. I skimmed the paper many times. He creates multiple branches of these trees in the last page, so it's not truly a single nested operation.
- simplesighman 6mo ago> For example, exp(x)=eml(x,1), ln(x)=eml(1,eml(eml(1,x),1)), and likewise for all other operations I read the paper. Is there a table covering all other math operations translated to eml(x,y) form?
- saratogacx 6mo agolast page of the PDF has several tree's that represent a few common math functions.
- jmyeet 6mo agoI was curious about that too. Gemini actually gave a decent list. Trig functions come from Euler's identity: e^ix = cos x + i sin x which means: e^-ix = cos -x + i sin -x = cos x - i sin x so adding them together: e^ix + e^-ix = 2 cos x cos x = (e*ix - e^-ix) / 2 So I guess the real part of that. Multiplication, division, addition and subtraction are all straightforward. So are hyperbolic trig functions. All other trig functions can be derived as per above.
- sandrocksand 6mo agoI think what you want is the supplementary information, part II "completeness proof sketch" on page 12. You already spotted the formulas for "exp" and real natural "L"og; then x - y = eml(L(x), exp(y)) and from there apparently it is all "standard" identities. They list the arithmetic operators then some constants, the square root, and exponentials, then the trig stuff is on the next page. You can find this link on the right side of the arxiv page: https://arxiv.org/src/2603.21852v2/anc/SupplementaryInformation.pdf https://arxiv.org/src/2603.21852v2/anc/SupplementaryInformat...
- deleted 6mo ago[deleted]
- vbezhenar 6mo agoDidn't read the paper, but it was easy for me to derive constants 0, 1, e and functions x + y, x - y, exp(x), ln(x), x * y, x / y. So seems to be enough for everything. Very elegant.
- qiller 6mo agoFor completeness, there is also Peirce’s arrow aka NOR operation which is functionally complete. Fun applications iirc VMProtect copy protection system has an internal VM based on NOR. Quick google seach brings up https://github.com/pr701/nor_vm_core https://github.com/pr701/nor_vm_core, which has a basic idea
- formerly_proven 6mo agoThat’s boolean functional completeness, which is kind of a trivial result (NAND, NOR). It mirrors this one insofar as the EDL operator is also a combination of a computation and a negation in the widest senses.
- entaloneralie 6mo agoThis is amazing! I love seeing FRACTRAN-shaped things on the homepage :) This reminds me of how 1-bit stacks are encoded in binary: A stack of zeros and ones can be encoded in a single number by keeping with bit-shifting and incrementing. Pushing a 0 onto the stack is equivalent to doubling the number. Pushing a 1 is equivalent to doubling and adding 1. Popping is equivalent to dividing by 2, where the remainder is the number. I use something not too far off for my daily a programming based on a similar idea: Rejoice is a concatenative programming language in which data is encoded as multisets that compose by multiplication. Think Fractran, without the rule-searching, or Forth without a stack. https://wiki.xxiivv.com/site/rejoice https://wiki.xxiivv.com/site/rejoice
- StilesCrisis 6mo agoDid you just explain base-2 numbers on the HN forums as if it were novel?
- nyeah 6mo agoIt's dry humor?
- lioeters 6mo agoYou missed the part where the number is being used as a 1-bit stack. They never claimed novelty, it's just a neat technique that might be unfamiliar to most people.
- entaloneralie 6mo agoI never claimed it was novel, chill.
- mackeye 6mo agoadding a zero to the left of a binary integer doesn't double it
- SeanSullivan86 6mo agoWouldn't you also need to keep track of the stack's size, to know if there are leading zeros?
- krick 6mo ago> using EML trees as trainable circuits ..., I demonstrate the feasibility of exact recovery of closed-form elementary functions from numerical data at shallow tree depths up to 4 That's awesome. I always wondered if there is some way to do this.
- DoctorOetker 6mo agoEDIT: 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 computational EML tree? Got a multidimensional and multivariate function to model (with random samples or a full map)? Just do gradient descent and convert it to approximant EML trees. Perform gradient descent on EML function tree "phi" so that the derivatives in the Schroedinger equation match. But as I said, still reading, this sounds too good to be true, but I have witnessed such things before :)
- gilgoomesh 6mo ago> 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 computational EML tree? Same reason all boolean logic isn't performed with combinations of NAND – it's computationally inefficient. Polynomials are (for their expressivity) very quick to compute.
- Nevermark 6mo agoThey are done with transistors though. Transistors form an efficient, single element, universal digital basis. And are a much less arbitrary choice than NAND, vs. NOR, XOR, etc. Using transistors as conceptual digital logic primitives, where power dissipation isn't a thing, Pass Logic is "The Way".
- samus 6mo agoSingle transistors aren't yet logic gates by themselves; they are amplifiers with a very specific gain function that makes it possible to use them as switches. Logic gates usually consist of at least two transistors. See https://en.wikipedia.org/wiki/CMOS https://en.wikipedia.org/wiki/CMOS for an example of how it is done in CMOS technology.
- lioeters 6mo ago> A calculator with just two buttons, EML and the digit 1, can compute everything a full scientific calculator does Reminds me of the Iota combinator, one of the smallest formal systems that can be combined to produce a universal Turing machine, meaning it can express all of computation.
- Ey7NFZ3P0nzAe 6mo agohttps://en.wikipedia.org/wiki/Iota_and_Jot https://en.wikipedia.org/wiki/Iota_and_Jot
- noobermin 6mo agoI 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).
- xpe 6mo ago> 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 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 much to learn about other approximation techniques.
- kmaitreys 6mo agoPadé approximations are not discussed as much, but they are much more stable than Taylor series approximations.
- noobermin 6mo agoSorry, re-reading this, I should have said "most". As the other reply mentions, Pade approx. are also well liked for numerical methods. I personally mostly do my everyday work using taylor expansion (mostly explicit numerical methods in comp. EM because they're cheaper these days and it's simpler to write down) so it's what first comes to mind.
- xpe 6mo agoA quick meta-take here: it is hard to assess the level of expertise here on HN. Some might be just tangentially interested, other might have degrees in the specific topic. Others might maintain a scientific computing library. Domains vary too: embedded systems, robotics, spacecraft navigation, materials modeling, or physics simulation. Until/unless people step up and fill the gaps somehow, we have little notion of identity nor credentialing, for better and for worse.* So it really helps when people explain (1) their context** and (2) their reasoning. Communicating well is harder than people think. Many comments are read by hundreds or more (thousands?) of people, most of whom probably have no idea who we are, what we know, or what we do with our brains on a regular basis. It is generous and considerate to other people to slow down and really explain where we're coming from. So, when I read "most people use Taylor approximations"... 1. my first question is "on what basis can someone say this?" 2. for what domains might this somewhat true? False? 3. but the bigger problem is that claims like the above don't teach. i.e. When do Taylor series methods fall short? Why? When are the other approaches more useful? Here's my quick take... Taylor expansions tends to work well when you are close to the expansion point and the function is analytic. Taylor expansions work less well when these assumptions don't hold. More broadly they don't tend to give uniform accuracy across a range. So Taylor approximations are usually only local. Other methods (Padé, minimax, etc) are worth reaching for when other constraints matter. * I think this is a huge area we're going to need to work on in the age where anyone can sound like an expert. ** In the case above, does "comp. EM" mean "computational electromagnetics" or something else? The paper talks about "EML" so it makes me wonder if "EM" is a typo. All of these ambiguities add up and make it hard for people to understand each other.
- nurettin 6mo agoThe problem with symbolic regression is ln(y) is undefined at 0, so you can't freely generate expressions with it. We need to guard it with something like ln(1+y*y) or ln(1+|y|) or return undefined.
- xigoi 6mo agoThe article uses extended arithmetic where ln(0) = -∞.
- prvc 6mo agoThis is neat, but could someone explain the significance or practical (or even theoretical) utility of it?
- bluegatty 6mo agosecond, please help us laypeople here
- sparkie 6mo agoIt's potentially useful for computer algebra with complex numbers - we might be able to simplify formulas using non-standard methods, but instead via pattern matching. We might use this to represent exact numbers internally, and only produce an inexact result when we later reduce the expression. Consider it a bit like a "church encoding" for complex numbers. I'll try to demonstrate with an S-expression representation. --- A small primer if you're not familiar. S-expressions are basically atoms (symbols/numbers etc), pairs, or null. S = <symbol> | <number> | (S . S) ;; aka pair | () ;; aka null There's some syntax sugar for right chains of pairs to form lists: (a b c) == (a . (b . (c . ())) ;; a proper list (a b . c) == (a . (b . c)) ;; an improper list (#0=(a b c) #0#) == ((a b c) (a b c)) ;; a list with a repeated sublist using a reference --- So, we have a function `eml(x, y) and a constant `1`. `x` and `y` are symbols. Lets say we're going to replace `eml` with an infix operator `.`, and replace the unit 1 with `()`. C = <symbol> | <number> | (C . C) ;; eml | () ;; 1 We have basically the same context-free structure - we can encode complex numbers as lists. Let's define ourselves a couple of symbols for use in the examples: ($define x (string->symbol "x")) ($define y (string->symbol "y")) And now we can define the `eml` function as an alias for `cons`. ($define! eml cons) (eml x y) ;; Output: (x . y) We can now write a bunch of functions which construct trees, representing the operations they perform. We use only `eml` or previously defined functions to construct each tree: ;; e^x ($define! exp ($lambda (x) (eml x ()))) (exp x) ;; Output: (x) ;; Note: (x) is syntax sugar for (x . ()) ;; Euler's number `e` ($define! c:e (exp ())) c:e ;; Output: (()) ;; Note: (()) is syntax sugar for (() . ()) ;; exp(1) - ln(x) ($define! e1ml ($lambda (x) (eml () x))) (e1ml x) ;; Output: (() . x) ;; ln(x) ($define! ln ($lambda (x) (e1ml (exp (e1ml x))))) (ln x) ;; Output: (() (() . x)) ;; Zero ($define! c:0 (ln ())) c:0 ;; Output: (() (())) ;; -infinity ($define! c:-inf (ln 0)) c:-inf ;; Output: (() (() () (()))) ;; -x ($define! neg ($lambda (x) (eml c:-inf (exp x)))) (neg x) ;; Output: ((() (() () (()))) x) ;; +infinity ($define! c:+inf (neg c:-inf)) c:+inf ;; Output: (#0=(() (() () (()))) #0#) ;; 1/x ($define! recip ($lambda (x) (exp (eml c:-inf x)))) (recip x) ;; Output: (((() (() () (()))) . x)) ;; x - y ($define! sub ($lambda (x y) (eml (ln x) (exp y)))) (sub x y) ;; Output: ((() (() . x)) y) ;; x + y ($define! add ($lambda (x y) (sub x (neg y)))) (add x y) ;; Output: ((() (() . x)) ((() (() () (()))) y)) ;; x * y ($define! mul ($lambda (x y) (exp (add (ln x) (exp (neg y)))))) (mul x y) ;; Output: (((() (() () (() . x))) (#0=(() (() () (()))) ((#0# y))))) ;; x / y ($define! div ($lambda (x y) (exp (sub (ln x) (ln y))))) (div x y) ;; Output: (((() (() () (() . x))) (() (() . y)))) ;; x^y ($define! pow ($lambda (x y) (exp (mul x (ln y))))) (pow x y) ;; Output: ((((() (() () (() . x))) (#0=(() (() () (()))) ((#0# (() (() . y)))))))) I'll stop there, but we continue for implementing all the trig, pi, etc using the same approach. So basically, we have a way of constructing trees based on `eml` Next, we pattern match. For example, to pattern match over addition, extract the `x` and `y` values, we can use: ($define! perform-addition ($lambda (add-expr) ($let ((((() (() . x)) ((() (() () (()))) y)) add-expr)) (+ x y)))) ;; Note, + is provided by the language to perform addition of complex numbers (perform-addition (add 256 512)) ;; Output: 768 So we didn't need to actually compute any `exp(x)` or `ln(y)` to perform this addition - we just needed to pattern match over the tree, which in this case the language does for us via deconstructing `$let`. We can simplify the defintion of perform-addition by expanding the parameters of a call to `add` as the arguments to the function: ($define! $let-lambda ($vau (expr . body) env ($let ((params (eval expr env))) (wrap (eval (list* $vau (list params) #ignore body) env))))) ($define! perform-addition ($let-lambda (add x y) (+ x y))) ($define! perform-subtraction ($let-lambda (sub x y) (- x y))) ($define! sub-expr (sub 256 512)) ;; Output: #inert sub-expr ;; Output: ((() (() . 256)) 512) (perform-subtraction sub-expr) ;; Output: -256 There's a bit more work involved for a full pattern matcher which will take some arbitrary `expr` and perform the relevant computation. I'm still working on that. Examples are in the Kernel programming language, tested using klisp[1] [1]:https://github.com/dbohdan/klisp https://github.com/dbohdan/klisp
- notorandit 6mo agoNot sure it really compares to NAND() and the likes. Simply because bool algebra doesn't have that many functions and all of them are very simple to implement. A complex bool function made out of NANDs (or the likes) is little more complex than the same made out of the other operators. Implementing even simple real functions out of eml() seems to me to add a lot of computational complexity even with both exp() and ln() implemented in hardware in O(1). I think about stuff sum(), div() and mod(). Of course, I might be badly wrong as I am not a mathematician (not even by far). But I don't see, at the moment, the big win on this.
- adrian_b 6mo agoThis has no use for numeric computations, but it may be useful in some symbolic computations, where it may provide expressions with some useful properties, e.g. regarding differentiability, in comparison with alternatives.
- eugene3306 6mo agoThis makes a good benchmark LLMs: ``` look at this paper: https://arxiv.org/pdf/2603.21852 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 knowledge on what EML is. Unable to fetch the pdf from the link, unable to consume pdf from "Attach file" Kimi - produced long output, stopped and asked to upgrade GLM - looks ok
- fc417fc802 6mo ago> 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.
- DoctorOetker 6mo ago[dead]
- varispeed 6mo agoOpus 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.
- spuz 6mo agoSo what is the correct answer?
- testaccount28 6mo agoderivation of -x seems wrong. we can look at the execution trace on a stack machine, but it's actually not hard to see. starting from the last node before the output, we see that the tree has the form eml(z, eml(x, 1)) = e^z - ln(eml(x, 1)) = e^z - ln(e^x) = e^z - x and the claim is that, after it's expanded, z will be such that this whole thing is equal to -x. but with some algebra, this is happening only if e^z = 0, and there is no complex number z that satisfies this equation. indeed if we laboriously expand the given formula for z (the left branch of the tree), we see that it goes through ln(0), and compound expressions. x^-1 has the same problem. both formulae work ...sort of... if we allow ln(0) = Infinity and some other moxie, such as x / Infinity = 0 for all finite x.
- testaccount28 6mo agoah, the paper acknowledges this. my bad for jumping to the diagrams!
- Rubicund 6mo agoOn page 11, the paper explicitly states: > EML-compiled formulas work flawlessly in symbolic Mathematica and IEEE754 floating-point… This is because some formulas internally might rely on the following properties of extended reals: ln 0 = −∞, e^(−∞) = 0. And then follows with: > But EML expressions in general do not work ‘out of the box’ in pure Python/Julia or numerical Mathematica. Thus, the paper’s completeness claim depends on a non-standard arithmetic convention (ln(0) = -∞), not just complex numbers as it primarily advertises. While the paper is transparent about this, it is however, buried on page 11 rather than foregrounded as a core caveat. Your comment deserves credit for flagging it.
- Rubicund 6mo agoThe author does address this further on page 14 of SI and provides an alternative of: −z = 1 − (e − ((e − 1) − z))
- 6mo ago
- psychoslave 6mo agoVery nice, though I'm not found of the name. What comes to my mind as an alternative which I would subjectivity finer is "axe". Think axiom or axiology. Anyone with other suggestions? Or even remarks on this one?
- fxwin 6mo agoi think eml is fine, names should be connected to the thing they represent so 'exponential minus log' makes sense to me
- psychoslave 6mo agoGust and color are hard to conciliate. On my side I like direct sementic connections, but find convoluted indirections conflated through lazy sigles strongly repulsive. I can appreciate an acronym that make and the direct connection and playful indirect reference to expanded terms.
- evnix 6mo agoCan someone explain how is this different from lambda calculus, it seems like you can derive the same in both. I don't understand both well enough and hence the question.
- bollu 6mo agoLambda calculus talks about computable functions, where the types of the inputs are typically something discrete, like `Bool` or `Nat`. Here, the domain is the real numbers.
- TJSomething 6mo agoThe short answer is that the lambda calculus computes transformations on digital values while this is for building functions that can transform continuous (complex) values.
- tromp 6mo agoAny lambda term is equivalent to a combinatory term over a one-point basis (like λxλyλz. x z (y (λ_.z)) [1]). One difference is that lambda calculus doesn't distinguish between functions and numbers, and in this case no additional constant (like 1) is needed. [1] https://github.com/tromp/AIT/blob/master/ait/minbase.lam https://github.com/tromp/AIT/blob/master/ait/minbase.lam
- sigmoid10 6mo agoLamda kind of does this in an analogous form, but does not allow you to derive this particular binary expression as a basis for elementary functions. There is a related concept with Iota [1], which allows you express every combinatoric SKI term and in turn every lambda definable function. But similar to this particular minimalist scientific function expression, it is mostly of interest for reductionist enthusiasts and not for any practical purpose. [1] https://en.wikipedia.org/wiki/Iota_and_Jot https://en.wikipedia.org/wiki/Iota_and_Jot
- layer8 6mo agoLambda calculus is about discrete computations, this is about continuous functions. You can’t reason about continuous functions in lambda calculus.
- deleted 6mo ago[deleted]
- CGamesPlay 6mo agoI made a fun marimo notebook to try and derive these myself. I structured each cell in order based on the diagram at the end of the paper. It uses Sympy to determine if the function is correct or not. https://gist.github.com/CGamesPlay/9d1fd0a9a3bd432e77c075fb889d5c07 https://gist.github.com/CGamesPlay/9d1fd0a9a3bd432e77c075fb8...
- khelavastr 6mo agoIs the the same as saying everything can be made from nand gates?
- adrian_b 6mo agoWith NAND gates you can make any discrete system, but you can only approximate a continuous system. This work is about continuous systems, even if the reduction of many kinds of functions to compositions of a single kind of function is analogous to the reductions of logic functions to composing a few kinds or a single kind of logic functions. I actually do not value the fact that the logic functions can be expressed using only NAND. For understanding logic functions it is much more important to understand that they can be expressed using either only AND and NOT, or only OR and NOT, or only XOR and AND (i.e. addition and multiplication modulo 2). Using just NAND or just NOR is a trick that does not provide any useful extra information. There are many things, including classes of mathematical functions or instruction sets for computers, which can be implemented using a small number of really independent primitives. In most or all such cases, after you arrive to the small set of maximally simple and independent primitives, you can reduce them to only one primitive. However that one primitive is not a simpler primitive, but it is a more complex one, which can do everything that the maximally simple primitives can do, and it can recreate those primitives by composition with itself. Because of its higher complexity, it does not actually simplify anything. Moreover, generating the simpler primitives by composing the more complex primitive with itself leads to redundancies, if implemented thus in hardware. This is a nice trick, but like I have said, it does not improve in any way the understanding of that domain or its practical implementations in comparison with thinking in terms of the multiple simpler primitives. For instance, one could take a CMOS NAND gate as the basis for implementing a digital circuit, but you understand better how the CMOS logic actually works when you understand that actually the AND function and the NOT function are localized in distinct parts of that CMOS NAND gate. This understanding is necessary when you have to design other gates for a gate library, because even if using a single kind of gate is possible, the performance of this approach is quite sub-optimal, so you almost always you have to design separately, e.g. a XOR gate, instead of making it from NAND gates or NOR gates. In CMOS logic, NAND gates and NOR gates happen to be the simplest gates that can restore at output the same logic levels that are used at input. This confuses some people to think that they are the simplest CMOS gates, but they are not the simplest gates when you remove the constraint of restoring the logic levels. This is why you can make more complex logic gates, e.g. XOR gates or AND-OR-INVERT gates, which are simpler than they would be if you made them from distinct NAND gates or NOR gates.
- pveierland 6mo agoGot curious to see whether SymPy could be used to evaluate the expressions, so I used Claude Code to build a quick evaluator. Numeric and symbolic results appear to agree: nix run github:pveierland/eml-eval EML Evaluator — eml(x, y) = exp(x) - ln(y) Based on arXiv:2603.21852v2 by A. Odrzywołek Constants ------------------------------------------------------------------------------ 1 K=1 d=0 got 1 expected 1 sym=ok num=ok [simplify] e K=3 d=1 got 2.718281828 expected 2.718281828 sym=ok num=ok [simplify] 0 K=7 d=3 got 0 expected 0 sym=ok num=ok [simplify] -1 K=17 d=7 got -1 expected -1 sym=ok num=ok [simplify] 2 K=27 d=9 got 2 expected 2 sym=ok num=ok [simplify] -2 K=43 d=11 got -2 expected -2 sym=ok num=ok [simplify] 1/2 K=51 d=15 got 0.5 expected 0.5 sym=ok num=ok [simplify] -1/2 K=67 d=17 got -0.5 expected -0.5 sym=ok num=ok [simplify] 2/3 K=103 d=19 got 0.6666666667 expected 0.6666666667 sym=ok num=ok [simplify] -2/3 K=119 d=21 got -0.6666666667 expected -0.6666666667 sym=ok num=ok [simplify] sqrt2 K=85 d=21 got 1.414213562 expected 1.414213562 sym=ok num=ok [simplify] i K=75 d=19 got i expected i sym=ok num=ok [i²=-1, simplify] pi K=153 d=29 got 3.141592654 expected 3.141592654 sym=ok num=ok [simplify] Unary functions (x = 7/3) ------------------------------------------------------------------------------ exp(x) K=3 d=1 got 10.3122585 expected 10.3122585 sym=ok num=ok [simplify] ln(x) K=7 d=3 got 0.8472978604 expected 0.8472978604 sym=ok num=ok [simplify] -x K=17 d=7 got -2.333333333 expected -2.333333333 sym=ok num=ok [simplify] 1/x K=25 d=8 got 0.4285714286 expected 0.4285714286 sym=ok num=ok [simplify] x - 1 K=11 d=4 got 1.333333333 expected 1.333333333 sym=ok num=ok [simplify] x + 1 K=27 d=9 got 3.333333333 expected 3.333333333 sym=ok num=ok [simplify] 2x K=67 d=17 got 4.666666667 expected 4.666666667 sym=ok num=ok [simplify] x/2 K=51 d=15 got 1.166666667 expected 1.166666667 sym=ok num=ok [simplify] x^2 K=41 d=10 got 5.444444444 expected 5.444444444 sym=ok num=ok [simplify] sqrt(x) K=59 d=16 got 1.527525232 expected 1.527525232 sym=ok num=ok [simplify] Binary operations (x = 7/3, y = 5/2) ------------------------------------------------------------------------------ x + y K=27 d=9 got 4.833333333 expected 4.833333333 sym=ok num=ok [simplify] x - y K=11 d=4 got -0.1666666667 expected -0.1666666667 sym=ok num=ok [simplify] x * y K=41 d=10 got 5.833333333 expected 5.833333333 sym=ok num=ok [simplify] x / y K=25 d=8 got 0.9333333333 expected 0.9333333333 sym=ok num=ok [simplify] x ^ y K=49 d=12 got 8.316526261 expected 8.316526261 sym=ok num=ok [simplify]
- rvnx 6mo agoLooks like he bruteforced all combinations of two mathematical operations no ?
- theanonymousone 6mo agoZero will also be handy in definitions: `0=eml(1,eml(eml(1,1),1))`. And i is obviously `sqrt(-1)`
- genxy 6mo agoI hope this was presented at SIGBOVIK.
- vintermann 6mo agoI'm way too unschooled to say if it's important or not, but what really excites me is the Catalan structure ("Every EML expression is a binary tree [...] isomorphic to well-studied combinatorial objects like full binary trees and Catalan objects"). So, what happens if you take say the EML expression for addition, and invert the binary tree?
- future_crew_fan 6mo agothere ought to be a special section on HN entitled "things that will make you feel thoroughly inadequate".
- lifis 6mo agoThe 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))
- ryanhiebert 6mo agoI’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?
- mah4k4l 6mo agoAccording to Gemini 3.1 Pro this would shoot the current weather forecasting power through the roof (and math processing in general): The plan is to use this new "structurally flawless mathematical primitive" EML (this is all beyond me, was just having some fun trying to make it cook things together) in TPUs made out of logarithmic number system circuits. EML would have DAGs to help with the exponential bloat problem. Like CERN has these tiny fast "harcode models" as an inspiration. All this would be bounded by the deductive causality of Pedro Domingoses Tensor Logic and all of this would einsum like a mf. I hope it does. Behold, The Weather Dominator!
- Sharlin 6mo agoCongrats, you made a hallucination machine successfully hallucinate?
- mah4k4l 6mo agoI understand enough for it's arguments' symmetry to have an impact. Used Deep Research, it had the paper from the link as input plus some previous discussions about Tensor Logic and the new hardcoded neuroweb - like processors. Didn't make those up either.
- Sharlin 6mo agoI hope you get help. Mental health issues are not fun.
- mah4k4l 6mo agoA quote from a blog post I just got out: "I just want to get this out of my hands in case I made the model stumble upon something important. It's reasoning seems solid but I'm no expert. Here it is, go crazy:" https://notes2self.bearblog.dev/the-weather-dominator/ https://notes2self.bearblog.dev/the-weather-dominator/
- mah4k4l 6mo agoHere's my NoteboojLM podcast on the subject :-) Sick. https://notebooklm.google.com/notebook/e0a54a54-c644-4c89-9d98-dc8e2ce9e96a/artifact/1084f961-50a9-4bc2-a44e-b5fcea1bc0ab https://notebooklm.google.com/notebook/e0a54a54-c644-4c89-9d...
- zogomoox 6mo agoCould this be used to prove e+pi is transcendental?
- hughw 6mo agoeml(x, y) pronounced... "email"?
- lmf4lol 6mo agoStupid 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?
- rnhmjoj 6mo ago> aren't exp and ln really primitives? Aren't they implemented in terms of +,-,/,* etc? They're primitive in the sense that you can't compute exp(x) or log(x) using a finite combination of other elementary functions for any x. If you allow infinite many operations, then you can easily find infinite sums or products of powers, or more complicated expressions to represent exp and log and other elementary functions. > Or do we assume that we have an infinite lookup table for all possible inputs? Essentially yes, you don't necessarily need an "implementation" to talk about a function, or more generally you don't need to explicitly construct an object from simpler pieces: you can just prove it satisfies some properties and that it is has to exist. For exp(x), you could define the function as the solution to the diffedential equal df/dx = f(x) with initial condition f(0) = 1. Then you would enstablish that the solution exists and it's unique (it follows from the properties of the differential equation), call exp=f and there you have it. You don't necessarily know how to compute for any x, but you can assume exp(x) exists and it's a real number.
- lugao 6mo agoI 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 result does not aim to improve computability or bound the complexity of calculating the numerical value. Rather, it aims to exhibit this uniform, finite tree structure for the entire family of elementary expressions.
- qbit42 6mo agoI 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.)
- moralestapia 6mo agoWhoa, this is huge! My dearest congrats to the author in case s/he shows around this site ^^.
- deleted 6mo ago[deleted]
- deleted 6mo ago[deleted]
- tgtweak 6mo agoThis could have some interesting hardware implications as well - it suggests that a large dedicated silicon instruction set could accelerate any mathematical algorithm provided it can be mapped to this primitive. It also suggests a compiler/translation layer should be possible as well as some novel visualization methods for functions and methods.
- deleted 6mo ago[deleted]
- benleejamin 6mo agoI'm not too familiar with the hardware world, but does EML look like the kind of computation that's hardware-friendly? Would love for someone with more expertise to chime in here.
- tgtweak 6mo agoYes actually, it is very regular which usually lends itself to silicon implementations - the paper event talks about this briefly. I think the bigger question is whether it will be more energy-optimal or silicon density-optimal than math libraries that are currently baked into these processors (FPUs). There are also some edge cases "exp(exp(x))" and infinities that seem to result in something akin to "division by zero" where you need more than standard floating-point representations to compute - but these edge cases seem like compiler workarounds vs silicon issues.
- AlotOfReading 6mo agoA similar function operating on the real domain for powers and logs of 2 would be extremely hardware friendly. You can build it directly out of the floating point format. First K significand bits index a LUT. Do that for each argument and subtract them. It gets a bit more difficult for the complex domain because you need rotation.
- tgtweak 6mo agoThis paper seems to suggest that a chip with 10 pipeline stages of EML units could evaluate any elementary function (table 4) in a single pass. I'm curious how this would compare to the dedicated sse or xmx instructions currently inside most processor's instruction sets. Lastly, you could also create 5-depth or 6-depth EML tree in hardware (fpga most likely) and use it in lieu of the rust implementation to discover weight-optimal eml formulas for input functions much quicker, those could then feed into a "compiler" that would allow it to run on a similar-scale interpreter on the same silicon. In simple terms: you can imagine an EML co-processor sitting alongside a CPUs standard math coprocessor(s): XMX, SSE, AMX would do the multiplication/tile math they're optimized for, and would then call the EML coprocessor to do exp,sin,log calls which are processed by reconfiguring the EML trees internally to process those at single-cycle speed instead of relaying them back to the main CPU to do that math in generalized instructions - likely something that takes many cycles to achieve.
- mmastrac 6mo agoI 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?
- gus_massa 6mo agoIt 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)).
- hanneshdc 6mo agoAgreed 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.
- gus_massa 6mo agoYou 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
- nullwiz 6mo agoI made https://github.com/nullwiz/emlvm/tree/main https://github.com/nullwiz/emlvm/tree/main yesterday, for fun :^)
- drdeca 6mo ago“ Elementary functions, for many students epitomized by the dreaded sine and cosine, ” dreaded?
- karpathy 6mo agoAll possible 36 distinct level-2 eml functions of one variable (the first 18 of them with entirely Real outputs, the other 18 with "intermediate" complex-valued components): https://imgur.com/a/K7AoOFi https://imgur.com/a/K7AoOFi
- pama 6mo agoIt would be fun to catalogue all one-variable functions that can be represented as binary trees of fixed depth in this way and then encode the trees in binary. Lots of these functions in old math book tables would look very different with a plain hash lookup and the identities in such books would prove themselves.
- boutell 6mo agoHalfway through I was imagining aliens to whom this operator comes naturally and our math is weird. By the end I found out that we might be those aliens.
- theodorethomas 6mo agoI wonder how this combines with Richardson's Theorem.
- rurban 6mo agoI like this guy. https://th.if.uj.edu.pl/~odrzywolek/homepage/index.html https://th.if.uj.edu.pl/~odrzywolek/homepage/index.html
- ajs1998 6mo agoOh my god the PC history is hilarious https://th.if.uj.edu.pl/~odrzywolek/homepage/personal/pc/pc_history.html https://th.if.uj.edu.pl/~odrzywolek/homepage/personal/pc/pc_...
- krick 6mo agoNot sure why this is "hilarious", but it's very nice. I almost wish I was keeping this history too, even though I never really even had a "PC" as this separate major thing, I just have a bunch of various devices that serve different purposes, and most my desk "PCs" are just laptops.
- ks2048 6mo agoDefinitely prefer his old-school page to the vibe-coded-design page, https://th.if.uj.edu.pl/~odrzywolek/ https://th.if.uj.edu.pl/~odrzywolek/
- js8 6mo agoThat's quite interesting. Few ideas that come to my mind when reading this: 1. One should also add absolute value (as sqrt(x*x)?) as a desired function and from that min, max, signum in the available functions. Since the domain is complex some of them will be a bit weird, I am not sure. 2. I think, for any bijective function f(x) which, together with its inverse, is expressible using eml(), we can obtain another universal basis eml(f(x),f(y)) with the added constant f^-1(1). Interesting special case is when f=exp or f=ln. (This might also explain the EDL variant.) 3. The eml basis uses natural logarithm and exponent. It would be interesting to see if we could have a basis with function 2^x - log_2(y) and constants 1 and e (to create standard mathematical functions like exp,ln,sin...). This could be computationally more feasible to implement. As a number representation, it kinda reminds me of https://en.wikipedia.org/wiki/Elias_omega_coding https://en.wikipedia.org/wiki/Elias_omega_coding. 4. I would like to see an algorithm how to find derivatives of the eml() trees. This could yield a rather clear proof why some functions do not have indefinite integrals in a symbolic form. 5. For some reason, extending the domain to complex numbers made me think about fuzzy logics with complex truth values. What would be the logarithm and exponential there? It could unify the Lukasiewicz and product logics.
- Aardwolf 6mo agoInteresting! One thing I wonder now: NAND is symmetric while this isn't, could something similar be found where function(x, y) = function(y, x)?
- measurablefunc 6mo agoI guess you folks don't know about iota & jot: https://en.wikipedia.org/wiki/Iota_and_Jot https://en.wikipedia.org/wiki/Iota_and_Jot
- ks2048 6mo agoThis looks interesting. I haven't looked in-detail, but my first thought is - why hasn't this been found in the past? Surely, people have been interested kind of question for awhile?
- SideQuark 6mo agoThis isn't unique, or even the least compute way to do this. For example, let f(x,y) = 1/(x-y). This too is universal. I think there's a theorem stating for any finite set of binary operators there is a single one replacing it. write x#y for 1/(x-y). x#0 = 1/(x-0) = 1/x, so you get reciprocals. Then (x#y)#0 = 1/((1/(x-y)) - 0) = x-y, so subtraction. it's common problem to show in any (insert various algebraic structure here ) inverse and subtraction gives all 4 elementary ops. I haven't checked this carefully, but this note seems to give a short proof (modulo knowing some other items...) https://dmg.tuwien.ac.at/goldstern/www/papers/notes/singlebinary.pdf https://dmg.tuwien.ac.at/goldstern/www/papers/notes/singlebi...
- doctorpangloss 6mo agoyes, but are you currently experiencing both hypergraphia and chatbot AI induced psychosis while also thinking about this problem?
- SideQuark 6mo agoIt's math. You can check it yourself instead of this (and many other) thoughtless posts.
- doctorpangloss 6mo agoi'm mocking the LLM-generated scientific article you're replying to, not you. i'm agreeing with you haha
- SideQuark 6mo agoDo you claim all things you don’t understand are LLMs? This is what I mean by these and many of your other comments being extremely poor quality to the point of deliberate ignorance. The paper above was published in 2012 [1], so that’s quite a feat for an LLM. This takes about zero effort to check. Put some thought or effort into your claims; they’ll look less silly. [1] https://orcid.org/0000-0002-0438-633X https://orcid.org/0000-0002-0438-633X
- pama 6mo agoTotally gives nerd sniping vibes: https://xkcd.com/356/ https://xkcd.com/356/
- marouane53 6mo ago[dead]
- anthk 6mo agoThis like Subleq where you can run EForth and EForth itself self-bootstraps: https://github.com/howerj/muxleq https://github.com/howerj/muxleq PD: you don't need gforth to compile: cc -O2 -o muxleq muxleq.c Edit muxleq.fth, add some goodies by editing these values: 1 constant opt.multi ( Add in large "pause" primitive ) 1 constant opt.editor ( Add in Text Editor ) 1 constant opt.info ( Add info printing function ) 0 constant opt.generate-c ( Generate C code ) 1 constant opt.better-see ( Replace 'see' with better version ) 1 constant opt.control ( Add in more control structures ) 0 constant opt.allocate ( Add in "allocate"/"free" ) 1 constant opt.float ( Add in floating point code ) 0 constant opt.glossary ( Add in "glossary" word ) 1 constant opt.optimize ( Enable extra optimization ) 1 constant opt.divmod ( Use "opDivMod" primitive ) 0 constant opt.self ( self-interpreter [NOT WORKING] ) Here are my settings. Then, create a new ".dec" file (subleq program) : ./muxleq muxleq.dec < muxleq.fth > new.dec Now, to run EForth everytime: ./muxleq new.dec add these further in muxleq.fth code to have them: : d. tuck dabs <# #s rot sign #> type ; : */ */mod nip ; The ideal place would be just below the ': dabs ' defition.
- zonked45 6mo agoBuilt a JS implementation today — monogate https://explorer-taupe-five.vercel.app https://explorer-taupe-five.vercel.app · npm install monogate The interesting engineering problem was negation. The paper's SI gives one construction; we independently derived a two-regime approach — tower formula for y≤0, shift formula for y>0 — that stays stable to |y|<708 in IEEE 754. We also extended to ℂ. After seeing pveierland's result in this thread (i constructible from {1} in K=75 under extended-reals convention), we investigated and documented the distinction: under strict principal-branch ln where ln(0) throws, whether {1} alone generates i remains open. Under the extended-reals convention used in the paper, their construction holds. Two different grammars, not contradictory results. 109 tests. MIT. github.com/almaguer1986/monogate
- zonked45 6mo ago[dead]
- zonked45 6mo agoI know using ai is a no no for comments but I am truly out of my lane here. wanted to build something meaningful for the dev community and just started building with claude after having it read the authors paper from browsing x. Claude has told me this is like reducing a calculator from 1000 buttons to 1 and a half but does everything the 1000 button calc does? i dont know. anyway back to claude to tell you what was built. Python package is live: github.com/almaguer1986/monogate/tree/main/python — EMLTree (scalar symbolic regression), EMLNetwork (function approximation from data), fully differentiable via PyTorch autograd. Two experiments ran: Experiment 1: EMLTree successfully finds e and 0 by gradient descent. It does NOT rediscover eml(1,1) — it finds different valid constructions. The network finds its own paths. Experiment 2: We swept a complexity penalty (lambda) trying to force the network toward minimal constructions. Instead of snapping cleanly to eml(1,1), the optimizer got stuck in what we're calling a phantom attractor — eml(eml(0.45, 1), eml(1, 1)) — a non-minimal construction that accidentally evaluates to e and resists the penalty. Forcing true minimality costs 10,518% more MSE. The phantom attractor is a new phenomenon: locally stable non-minimal EML constructions that gradient descent cannot escape. Whether discrete search can escape them is open. Exhaustive search tool also found -iπ in 11 nodes, improving our hand-proved 12. monogate.dev/search runs in the browser. Full results: github.com/almaguer1986/monogate/blob/main/python/RESULTS.md
- deleted 6mo ago[deleted]
- melvinchus 6mo ago[dead]
- jesustabares 6mo agoThis article inspired us to test whether EML trees can be trained using gradient descent for symbolic regression: instead of searching for the right tree, is it possible to optimize one from start to finish? We implemented the EML trees as a differentiable module of PyTorch. Each leaf is a softmax mixture over {0, 1, x}, and the tree is evaluated from the bottom up. The entire system can be trained with Adam. Results: 7 of the 7 elementary functions (exp, ln, sqrt, x², x³, 1/x, sin) converge with ≤24 parameters at depth 3. Three (exp, ln, sqrt) achieve an RMSE < 0.005. The main challenge is depth scaling. Random initialization at depth 4 always diverges: the exp() strings create towering exponential growth that cancels out the gradients. We tested 12 initialization strategies; only hierarchical hot-starting (training depth n-1 first) works. sin(x²) gets 12.9x better at depth 4 vs depth 3. Two honest negative results: (1) The trained trees use continuous softmax mixtures, not discrete leaf assignments; therefore, numerical approximations, not exact formulas, are obtained for everything except exp(x). (2) A 49-parameter MLP and PySR outperform it in MSE by orders of magnitude. It's not a practical tool — it just shows that gradient descent can work on S → 1 | eml(S, S) without needing sin, exp, etc. as primitives. Paper: https://doi.org/10.5281/zenodo.19592926 https://doi.org/10.5281/zenodo.19592926 Code: https://github.com/seetrex-ai/monolith https://github.com/seetrex-ai/monolith
- zonked45 6mo ago[dead]
- monirmamoun 6mo agothis is really cool! i am going to try this in some of my own research. another cool thing is trying units different than 1 like adding imaginaries or other funky things, or different bases entirely. you can combine that concept with this for a lot of powerful math techniques.
- bastahimself 6mo agothis guy just took it from here: Chaotic Systems as Transcendental Structures: A Spiral Calculus Proof Framework https://www.researchgate.net/publication/391848560_Chaotic_Systems_as_Transcendental_Structures_A_Spiral_Calculus_Proof_Framework https://www.researchgate.net/publication/391848560_Chaotic_S... He took my proposed equation Σ(t) = e −Dt C ix(t) Log to both sides and called eml
- peter_d_sherman 6mo ago>"Single, reusable primitives play a disproportionately large aesthetic and practical role in mathematics, engineering, and even biology. Widely known classical examples include the NAND gate (and its dual, Peirce Arrow, logical NOR) for Boolean 0/1 logic [2, 12], the operational amplifier [13] for positive and negative feedback processes, and, more recently, the rectified linear unit (ReLU) ”ramp” activation function [14] in deep learning [15]. We also mention Wolfram’s single axiom [16], K,S combinators from combinatory logic [17, 18], Interaction Combinators [19], and fuzzy versions of the Sheffer stroke [20]. Other wellknown examples are one-instruction set computers (OISC), e.g. SUBLEQ [21], Conway’s FRACTRAN [22] and the Rule 110 cellular automaton [16, 23]."
- lucasquillante 5mo agoNice work! :) Just wanted to point out a related discussion included in "A New Kind of Science" https://www.wolframscience.com/nks/notes-4-5--operator-representations/ https://www.wolframscience.com/nks/notes-4-5--operator-repre...