[Question]
  [
Wouldn't it be neat if programming functions could be inverted, just like the mathematical function they implement? 
Write a function (or program) that takes one input `x` in any form, that outputs `ln(x)`.  
When the bytes of the program are reordered/reversed so that the first byte now is the last byte, it should take one input `x` in any form and output `e^x` instead.
* Your answer must have at least 3 correct significant figures.
* Approximations are fine, as long as they have at least 3 correct significant figures.
* Your code must be in the same programming language both forwards and backwards.
Let's say this program implements `ln(x)`:
```
abc‰Ω†Â•Ω
```
Then this program has to implement `e^x`:
```
\xBD\xA5\xE5\xA0\xBD\xE4cba
```
Gold star if you use a language without float support.
This is a weird form of code-golf, so the shortest program wins.
  
[Answer]
## Haskell, 11 bytes
```
f=log
pxe=f
```
and in reverse order:
```
f=exp
gol=f
```
This works without the "comment" trick. Instead each version defines an additional, but unused function (`pxe`/ `gol`). 
[Answer]
# APL, 3 bytes
```
*‚ä£‚çü
```
This is a function train. Monadic `*` returns `e^x`, monadic `‚çü` returns `ln(x)`. `‚ä£` is a dyadic function that returns its left argument. Thus, `*‚ä£‚çü` is equivalent to just `*`, and the reverse `‚çü‚ä£*` is equivalent to just `‚çü`.
[Answer]
## Jelly, ~~5~~ 4 bytes
Yay, my first Jelly answer. :) Input is via command-line argument.
Jelly [has its own code page](https://github.com/DennisMitchell/jelly/blob/master/docs/code-page.md) so each character is one byte.
```
e√Ü√Ül
```
[Try it online!](http://jelly.tryitonline.net/#code=ZcOGw4Zs&input=&args=NQ)
Reversed:
```
l√Ü√Üe
```
[Try it online!](http://jelly.tryitonline.net/#code=bMOGw4Zl&input=&args=NQ)
### Explanation
The `√Ü` on its own is an unrecognised token, so it acts the same as a linefeed. That means in either case the main link is only `√Ül` or `√Üe` which is the 2-character built-in for `exp()` or `ln()` and is by default performed on the first command-line argument.
[Answer]
## Javascript, 18 bytes
```
Math.log//pxe.htaM
```
[Answer]
## Seriously, 5 bytes
```
,_.e,
```
Input, ln, output, then exp on an empty stack (does nothing), and input (does nothing since input is exhausted). [Try it online!](http://seriously.tryitonline.net/#code=LF8uZSw&input=Mi43MTgyODE4Mjg0NTkwNDUyMzUzNjAyODc0NzEzNTI2NjI0OTc3NTcyNDcwOTM2OTk5NQ)
Reversed:
```
,e._,
```
[Try it online!](http://seriously.tryitonline.net/#code=LGUuXyw&input=MQ)
[Answer]
# Mathematica, 19 bytes
```
1&#@pxE+0&0+Log@#&1
```
Reversed:
```
1&#@goL+0&0+Exp@#&1
```
This was interesting to golf! Mathematica has *no* line comments / implicit string endings, so I couldn't take the simple route. Instead, I used the fact that `0 + x == x`, `0 x == 0`, and that `1 x == x`, no matter what `x` is! Testing:
```
In[1]:= (1&#@pxE+0&0+Log@#&1)[x]
Out[1]= Log[x]
In[2]:= (1&#@goL+0&0+Exp@#&1)[x]
         x
Out[2]= E
```
[Answer]
# Julia, 7 bytes
```
log#pxe
```
This is an anonymous function. Assign it to a variable to call it. Evaluates to builtins `log` or `exp` plus a comment.
[Answer]
# Python2, 73 bytes
io: stdin/stdout
```
from math import*;print log(input())#))(tupni(pxe tnirp;*tropmi htam morf
```
inverse:
```
from math import*;print exp(input())#))(tupni(gol tnirp;*tropmi htam morf
```
[Answer]
## CJam, 11 bytes
```
rdmle#eemdr
```
[Test it here.](http://cjam.aditsu.net/#code=rdmle%23eemdr&input=5)
Reversed:
```
rdmee#elmdr
```
[Test it here.](http://cjam.aditsu.net/#code=rdmee%23elmdr&input=5)
Basically the same comment-trick as the OP's Python answer. `e#` starts a comment. `rd` reads the input and `ml` or `me` computes the logarithm or exponential.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 3 bytes
```
*‚ÇÅ‚â°
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3wX@tRU@OjzoX//0cb6hjpGOmZG1oYWYCwiamlgYmpjnEsAA "Brachylog ‚Äì Try It Online")
Initially, I had hoped to use `~*`, but although `*~` computes `e^x` and successfully ignores the trailing tilde, `~*` fails for all integer inputs and hits a float overflow on most non-integer inputs.
Forwards:
```
       The output
  ‚â°    is
*‚ÇÅ     the natural logarithm of
       the input.
```
Backwards:
```
       The output is
  *    Euler's number to the power of
       the input
‚â°      passed through the identity predicate
 ‚ÇÅ     with an extraneous subscript.
```
This uses the identity predicate because, although trailing tildes are tolerated, leading subscripts are not. (If they were, the Brachylog answer would be `*‚ÇÅ` alone, which is just the normal builtin for natural log.)
[Answer]
# Vitsy, 5 bytes
This is a program that exits on an error.
```
EL^rE
E   E  Push java.lang.Math.E
 L     Push log_(top) (input) (ln(input))
  ^    Push (top)^(input)  (e^(input))
   r   Reverse the stack
```
This program exits on an error with ln(input) on the stack.
[Try it online!](http://vitsy.tryitonline.net/#code=RUxOXkU&input=&args=Mi43MTgyODE4Mjg0NTkwNDUyMzUzNjAyODc0NzEzNTI2NjI0OTc3NTcyNDcwOTM2OTk5NQ) (note that I have put `N` to have visible output)
Then it's inverse:
```
Er^LE
```
This program exits on an error with e^(input) on the stack.
[Try it online!](http://vitsy.tryitonline.net/#code=RXJeTkxF&input=&args=MQ)
[Answer]
# Fuzzy Octo Guacamole, 7 bytes
non-competing, FOG is newer than the challenge
```
EZO@pZE
```
This is the equivalent of a function in FOG. It assumes the input is on the stack. This can be assigned to a function by the code `"EZO@pZE""f"o`, where `f` is any single-char name you want to assign. Then use it like any other command. Example: `"EZO@pZE"'f'o^f`.
Explanation:
```
EZO@pZE
E       # Push E (2.718....)
 Z      # Reverse stack (it is now [e, input])
  O     # log(x, y) which is ln(input)
   @    # Exit. (implicit output) Nothing after this gets run.
    p   # x^y (power function)
     Z  # Reverse stack
      E # Push E.
```
Reversed:
```
EZp@OZE
E       # Push E (2.718....)
 Z      # Reverse stack (it is now [e, input])
  O     # x^y (power function)
   @    # Exit. (implicit output) Nothing after this gets run.
    p   # log(x, y) which is ln(input)
     Z  # Reverse stack
      E # Push E.
```
[Answer]
# Matl, 5 bytes
```
Yl%eZ
```
`Yl`: log
`Ze`: exp
`%`: comment
[Answer]
# Pyth, 12 bytes
Finds `ln(input())`
```
.lQ) " Q1n.^
```
Finds `e^input()`
```
^.n1Q " )Ql.
```
Spaces stop implicit printing of strings, each version calculates it then creates a string with the remaining characters.
[`ln(x)` mode here](http://pyth.herokuapp.com/?code=.lQ%29+%22+Q1n.%5E&input=2&debug=0)
[`e^x` mode here](http://pyth.herokuapp.com/?code=%5E.n1Q+%22+%29Ql.&input=1&debug=0)
[Answer]
# ùîºùïäùïÑùïöùïü, 8 chars / 10 bytes
```
–ú≈¨√Ø//√Ø≈¶–ú
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter3.html?eval=true&input=1&code=%D0%9C%C5%AC%C3%AF%2F%2F%C3%AF%C5%A6%D0%9C)``[Try reverse here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter3.html?eval=true&input=1&code=%D0%9C%C5%A6%C3%AF%2F%2F%C3%AF%C5%AC%D0%9C)`
Just 2 builtins separated by a comment.
[Answer]
# Jolf, 9 bytes
Program 1: `exp` of input
```
amoj"jOma
a         print
 moj      e^j
    "jOma  the rest of the line is captured as a string; implicit printing is restricted.
```
Program 2: `ln` of input
```
amOj"joma
a         print
 mOj      ln(j)
    "joma  the rest of the line is captured as a string; implicit printing is restricted.
```
Bonus points for being a case-insensitive palindrome? [Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=YW1vaiJqT21h)
[Answer]
# J, 8 bytes
The natural logarithm is `^.`, and exponential `^`. The problem is, `.` can only modify a valid verb, otherwise, a spelling error will occur. Thus, we can't use the left argument trick in the APL answer, becuase `^.[^` would cause an error when reversed, as `^[.^` creates an invalid verb. So, we must use comments; but `NB.` is so long :( Fortunately, they both end with `.`, so&ldots there's that.
Logarithm:
```
^.NB.BN^
```
Exponential:
```
^NB.BN.^
```
You can enter them for yourself [online](http://tryj.tk/)!
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), 9 bytes
```
i'lA@Ae'i
```
[Try it online!](https://tio.run/##KyrNy0z@/z9TPcfRwTFVPfP/fwA "Runic Enchantments ‚Äì Try It Online")
An ungodly uninteresting program. `@` insures termination of the implied entry point at the left, everything after is unexecuted. I tried really hard to re-use the `'` or `A` instructions, but to no avail, even at larger program sizes. The required explicit entry point for multi-line programs essentially precludes it.
[Answer]
# Java 8, ~~198~~ ~~182~~ 30 bytes
```
d->Math.log(d)//)d(pxe.htaM<-d
```
[Try it online.](https://tio.run/##NY6xEoIwEER7v@LKpCBUVqh/AA2lY3EmEYIhyZCD0XH49hgVm5vb23m7N@CChQ/aDeqepMUYoUbjXjsA40hPN5Qamo8EUH6@Wg2SbYviVb6vXy@PSEhGQgMOjkkVpxqpF9Z3TPGy5IqFhxY9YX0oVKr@UMhJGdrYxRsFY@5nLU3GdecL8l93@4ykR@FnEiE7ZB1zQrI9335Y0xs)
and reversed:
```
d->Math.exp(d)//)d(gol.htaM<-d
```
[Try it online.](https://tio.run/##NY6xEoIwEER7v@LKpCBUVqh/AA2lY3EmEYIhyZCD0XH49hgVm5vb23m7N@CChQ/aDeqepMUYoUbjXjsA40hPN5Qamo8EUH6@Wg2SbYviVb6vXy@PSEhGQgMOjkkVpxqpF/oRmOJlyRXrvBU9YX0oVKr@UMhJGdrYxRsFY@5nLU3GdecL8l93@4ykR@FnEiE7ZB1zQrI9335Y0xs)
Uses the comment trick (`//`) with built-ins for `Math.log` and `Math.exp`.
]