# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll def dist(y): res = math.sqrt((ya - y)**2 + xa**2) + math.sqrt((yb- y)**2 + xb**2) return res xa, ya = map(int, raw_input().split()) xb, yb = map(int, raw_input().split()) low, hi = min(ya, yb), max(ya, yb) while hi - low > 1e-11: mid_l = (2*low + hi)/3.0 mid_r = (low + 2*hi)/3.0 d_l = dist(mid_l) d_r = dist(mid_r) if d_l < d_r: hi = mid_r else: low = mid_l print "%.10f" % ((low + hi)/2.0)