from math import *

def f(x):
    if x<=0:
        y=-2*x
    if 0<x<1:
        y=sqrt(x)
    if x>=1:
        y=1/x
    return y



