The function f(x) seems to have two different behaviors. For values of x in the range [-128, 0], the function returns a complex number. For values of x in the range (0, 128], the function returns a real number.
