My goal is to display a non-decreasing stepwise curve F. For each x-axis point, computing the corresponding F(x) is fairly computational, hence discretizing the x-axis and computing every corresponding F(x) point may take a lot of time.
My idea is to compute the curve by dichotomy. Starting with 0 and the end-point of the x-axis (say 100). If F(0)=F(100), then F is constant. Else F is not constant and I compute F(50). If F(50) = F(0), then F is constant on [0,50] and I compute F(75) and so on. Else if F(50) = F(100), then F is constant on [50,100] and I compute F(25) and so on. Else I compute F(25) and F(75) and so on.
Is there any python librairy which would be useful to implement such an algorithm?