add brent finding function minimal