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
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
- 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
Then this program has to implement
Gold star if you use a language without float support.
This is a weird form of code-golf, so the shortest program wins.
?, which used the secant method. \$\endgroup\$