In reply to nedicm:
I still don’t know what you mean by aux[i].max. do you just mean
aux.max() - aux.min() <= relative_c;