import math def calc(x,y): return math.sqrt(x * x + y * y) xa,ya = map(int,raw_input().split()) xb,yb = map(int,raw_input().split()) if ya > yb: ya,yb,xa,xb = yb,ya,xb,xa high = yb * 1.0 low = ya * 1.0 mid = (high + low) / 2.0 pre = calc(mid - ya,xa) + calc(yb - mid,xb) for i in range(1 << 10): mid = (high + low) / 2.0 #print mid res = calc(mid - ya,xa) + calc(yb - mid,xb) if res <= pre: high = mid pre = res else: low = mid print mid