Cut part from function

I try implement cutting some ease function.

I have one ease function ease(x) where x (0,1) and result (0,1).

I can not understand what the function will be above ease function. The function must repeat the form of the original function in the specified range (from, to), while its parameter must also be in the range 0-1 and the result (y0, y1) must also be in the range 0-1.

enter image description here

I try something like:

d = to - from efrom = easing(from) eto = easing(to) ed = eto - efrom  f = (easing(from + X * d) - efrom) / ed  

but something is wrong