add equal algorithm: robust version (N3607)