root-finding algorithm algorithms