Algorithm 1: Inflection-point search