powered by
Numerically evaluate the inverse of a monotonically increasing continuous function from R to R at specific points.
inverse_with_uniroot_sorted( f, y, range_x = c(0, 10), range_y = c(f(range_x[1]), f(range_x[2])) )
(vector, double) vector of x=f^(-1)(y): the inverted values
(function) the function to be inverted; must be continuous and increasing
(vector, double) the f(x)=y values in which to evaluate the inverse; must be in ascending order
(vector, double) the min and max of the domain of f()
(vector, double) the min and max in the range of f()
inverse_with_uniroot_sorted(f = function(x) { 2 * x }, y = c(0, 0.5))
Run the code above in your browser using DataLab