All elementary functions from a single binary operator
51 points by fanf
51 points by fanf
in the paper they claim ln (z) = eml (1, eml[eml(1, z), 1]), but this is wrong for e.g -1
am i missing something?
Page 11:
Because the simplest form of the natural logarithm, (5), obtained from EML, (3), is equivalent to ln z = e − log(exp(e)/z), using the standard choice of principal branch for complex logarithm, we obtain a jump of 2πi for the negative real axis, due to the 1/z term. This prevents use of e.g. some standard formulas for i, relying on ln(−1) = iπ, for which we get the wrong sign. A solution working for all real x ̸= 0 is to redefine the branch for EML itself in such a way that ln z (and everything derived from it, cf. Fig. 1) follows standard implementation of principal branch. Another option, used in EML compiler, is to manually correct i sign.
I'm curious as to whether the edl "cousin" variant (4b) (edl(x, y) = exp(x)/ln(y), constant e) would be better in this regard given that both division and ln are discontinuous at zero?
I wonder if it works with other exponent bases, or just the natural log?
I'd guess so, by the inclusion of a constant, eg log(x) = C ln(x)
log_base(x) = ln(x)/ln(base)
If base is 10, then C is just 1/ln(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)