brute-force search root-finding