The function has unexpected behavior within the range of -1 to 1. In this range, the output is consistently 2. Outside this range, the function seems to return 0 or 1 depending on the input.

