I have a non-decreasing function f such that f is always in [0,1] with f(0)=0 and we know y such that f(y)=1.
I need the most optimal algorithm that finds a set x1,…,xm in [0,y] such that f(xk) is in [(k-1)/(m+1),k/(m+1)].
This should work for any m selected as a hyperparameter, for background this is being used to find percentiles on a very complex CDF.
I thought about using a bisection method for each xi but there must be a more efficient way that incorporates all the information.
Bonus : the function computes such that run{f,(x1,…,xn)} is O(n+1) i.e as n gets large it is asymptotically 2 x faster per element executed than just executing with 1 element. If this can be incorporated then great!