Issues with the EML Function
I have recently been made aware of a paper that describes a single bivariate function that, when composed with itself, can recreate all elementary functions.1 It is described like this:
Both inputs
and the logarithm on the principle branch:
The derivation of
I'm not enough of an expert in the areas of the EML function's applications to comment on the implications of it if it were fully sound. This post will go through a major issue I found with the construction and I will explain it in a way that is hopefully understandable to people without a knowledge of complex analysis.
Background
To understand why the EML function has problems, we first should talk about the complex logarithm. If we think about the real-valued logarithm, there are many properties that mathematicians like. Namely, we have
where
where
where
So
This is the core of why a "universal" complex logarithm does not exist.
Which is clearly impossible.
The Solution
In order to still have some sort of logarithm for complex numbers,
mathematicians instead construct "local" logarithms. Their construction is
somewhat complicated, but the core idea is that if we restrict the angle
For example, if we restrict
The branch of the logarithm that restricts
and where
The Issue with EML
I mentioned earlier that EML is defined like this:
and
To illustrate that this is a problem for the
import cmath
def eml(x, y):
return cmath.exp(x) - cmath.log(y)
print(eml(1, cmath.exp(complex(0, cmath.pi / 2))))
print(eml(1, cmath.exp(complex(0, (cmath.pi / 2) + 2 * cmath.pi))))
You should see roughly the same complex number printed. This is because
def ln(x):
return eml(1, eml(eml(1, x), 1))
def e(x):
return eml(x, 1)
def identity(x):
return ln(e(x))
This should be the identity function. But now try a non-trivial input:
print(identity(complex(1, 4)))
This is not the identity function! There are many other constructions in the paper that fail because of this behavior.
Wrap Up
I hope this post gave you a more informed understanding of
¬NAND
I also have seen a lot of comparison between NAND and EML online. I don't think this is totally accurate: EML as a construction already involves evaluating the complex exponential and the complex logarithm. NAND can be expressed as a simple truth table.
This opinion is more philosophical than mathematical, but I still don't think
the comparison is fair because evaluating
Many have made the comparison between this function and the NAND logical gate. I don't think this comparision is very accurate, though. More on that later. ↩︎
Do not be worried if you don't understand what this means! This post is meant for people without knowledge of things like the complex logarithm. ↩︎
This is obviously a massive simplification of how "local" logarithms are defined. If you want a deeper mathematical explanation, I recommend Stein's Complex Analysis chapter 3. ↩︎