I am attempting to create a function, f(y) that can reverse my existing function, f(x).
x_min = 150 x_max = 750 y_min = 10000 y_max = 80000 for x between x_min and x_max, y = f(x) { top = log(y_max) bottom = log(y_min) scale = (top - bottom) / (x_max - x_min) return E ^ (y_min + (scale * (x - x_min))) } for y between y_min and y_max, x = f(y) { ??? }
For the time being, I am using a simple "searching" function that calls f(x) multiple times for different values of y until it finds the answer. I would like to be able to directly calculate f(y).