import math

def g(x,y,b):
    if x<0 or y<0:
        return 0.0
    else:
        if x > y:
            resultat = (2*x**2-3)/(x-y)
        elif x == y:
            resultat = -3.3
        elif x<y:
            resultat = math.sqrt(y**2-x)/2 + 4*x/17
        if resultat > b:
            resultat = b
        return resultat
