Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse functions definition #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -38,6 +38,7 @@ For simplicity, many of the code examples here operate on floating point values
- [piecewise function](#piecewise-function)
- [common functions](#common-functions)
- [function notation `↦` `→`](#function-notation)
- [inverse functions](#inverse-functions)
- [prime `′`](#prime)
- [floor & ceiling `⌊` `⌉`](#floor--ceiling)
- [arrows](#arrows)
Expand Down Expand Up @@ -722,6 +723,26 @@ Some tools like [flowtype](http://flowtype.org/) attempt to bring static typing

Other languages, like Java, allow for true method overloading based on the static types of a function's input/output. This is closer to mathematics: two functions are not the same if they use a different *domain*.

### inverse function

In mathematics, we have the formal concept of inverse function saying that for a function *f(x)*, it's inverse function, denoted as
![function2](http://latex.codecogs.com/svg.latex?f%5E%7B-1%7D%28x%29), where for each *x* belonging to the range of *f*, *f<sup>-1</sup>(x)* is defined to be the unique value of *y* in the domain of *f* satisfying *x = f(y)*

<!-- f^{-1}(x) -->

Or, in s simplified way,

![function2](http://latex.codecogs.com/svg.latex?y%3Df%5E%7B-1%7D%28x%29) is equivalent to
![function2](http://latex.codecogs.com/svg.latex?x%20%3D%20f%28y%29).
<!-- y=f^{-1}(x) -->
<!-- x = f(y) -->

Inverse functions are not restricted to polynomials, the concept also can be applied to transcendental functions (logarithms and trigonometric functions, for example).

The algorithm to find an inverse function basically consists in changing substituting *x* with *y* and the opposite, *y* with *x*.

The implementation, however, may vary. You usually do not see a single *function inverse*. Instead libraries tend to separate it by case, once the input varies a lot. Examples, we have a separate set for trigonometric inverse functions on [math.js](http://mathjs.org/) - *tan()* and *atan()*, *sin()* and *asin()*, etc.

## prime

The prime symbol (`′`) is often used in variable names to describe things which are similar, without giving it a different name altogether. It can describe the "next value" after some transformation.
Expand Down