# -*- coding: utf-8 -*- """ No.306 さいたま2008 https://yukicoder.me/problems/no/306 """ import sys from sys import stdin input = stdin.readline def calc_dist(ax, ay, bx, by, py): ap = (ax**2 + (ay - py)**2)**0.5 bp = (bx**2 + (by - py)**2)**0.5 return ap + bp def solve(ax, ay, bx, by): uy = max(ay, by) ly = min(ay, by) if uy == ly: return ly for _ in range(100): py1 = (ly*2 + uy) / 3 mid1_score = calc_dist(ax, ay, bx, by, py1) py2 = (ly + uy*2) / 3 mid2_score = calc_dist(ax, ay, bx, by, py2) if mid2_score > mid1_score: uy = py2 else: ly = py1 return (uy + ly) / 2 def main(args): ax, ay = map(float, input().split()) bx, by = map(float, input().split()) ans = solve(ax, ay, bx, by) print('{:8f}'.format(ans)) if __name__ == '__main__': main(sys.argv[1:])