The function f(x) takes a single numerical input x and returns twice the value of x for positive inputs, and halves the value of x for negative inputs.

