searching for the root of equation