NAND equivalent for elementary functions paper

Apr 15, 2026 Last reply: 3 months ago 9 Replies
formatting link

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


I wonder how long it took the author to notice that he had a belly button?

RL

Haha yes, the Apollo Guidance Computer was pretty much entirely built out of NOR gates 60+ years ago.

So was the Cray-1 supercomputer, 200,000 gates and only 4 gate types. Back when it came out and the joke was that it was so fast it could do an infinite loop in 4 seconds (:-)) I had always heard NAND gates but according to Wikipedia there are sources that say NOR gates instead, but then they point out that the same gate is either a NAND or NOR depending on whether you are using a positive or negative logic convention so it's really a wash.

That reminds me of the Whitespace programming language.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

I mean yeah it's obvious that you can derive e.g. trig functions from appropriate manipulation of exps and logs, but has anyone spelled out a completeness proof and what the equivalent to NAND is, in the space of continuous elementary functions (I guess eml(x, y))?

Yes, I believe the interesting thing is the _completeness_ of the "eml" operator, kind of like a one-instruction set computer.

Not that NAND is boolean complete or that we can make trig functions from exponentials, etc. which we knew already.

That function has been suggested as the basis for a 2-button calculator.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

The ancient Sumerians make an account for positional notation of numbers after _increment_ what makes addition.

The ancient Egyptians make an account for ratios as fractions of whole numbers after _partition_ what makes division.

So, it's sort of having those as two different operations instead as multiplication after addition then inverses.

So, "long subtraction", in a sense.

The idea is that partition works on the _big_ end while increment works on the _little_ end.

Why make a two-button calculator when all that is is an arbitrarily long slide-rule?

Yeah, about that "analog ideal divider" to go next to the "adder" (accumulator), ....

... is some comment about the idea of various number formats with regards to machine integers and machine numbers vis-a-vis "scientific numbers" and "significant digits" or "extended-precision" and "the interval arithmetic", or IEEE 754/854 and why languages without exception handling aren't too keen on "zero" whenever division's around, then about even for usual people who figure there are operations of mathematics on numbers: the Sumerians and the Egyptians are basically a sort of "little-endian" versus "big-endian" account, here that usually being about bit-order or byte-order, though instead about "the operations on the integers between zero and infinity, inclusive".

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required