Skip to content Skip to sidebar Skip to footer

Calculate Inverse Of A Function--library

Is there any library available to have inverse of a function? To be more specific, given a function y=f(x) and domain, is there any library which can output x=f(y)? Sadly I cannot

Solution 1:

I am a bit late, but for future readers of the post, I just published a python package that does this precisely. https://pypi.python.org/pypi/pynverse There is a detailed description of how to use it and how it does it in the description!

Solution 2:

As has already been mentioned, not all functions are invertible. In some cases imposing additional constraints helps: think about the inverse of sin(x).

Once you are sure your function has a unique inverse, solve the equation f(x) = y. The solution gives you the inverse, y(x).

In python, look for nonlinear solvers from scipy.optimize.

Post a Comment for "Calculate Inverse Of A Function--library"