#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
double sqrt(double);
int main() {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  double s = (a + b + c + d) / 2.0;
  printf("%.6f\n", sqrt((s - a) * (s - b) * (s - c) * (s - d)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe8d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
lea    (%rcx,%rax,1),%edx
mov    0xc(%rsp),%esi
add    %esi,%edx
mov    0x8(%rsp),%edi
add    %edi,%edx
cvtsi2sd %edx,%xmm0
mulsd  0xe89(%rip),%xmm0
cvtsi2sd %eax,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11c8 <main+0x98>
sqrtsd %xmm0,%xmm0
jmp    11cd <main+0x9d>
call   1050 <sqrt@plt>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [6 x i8] c"%.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 2.000000e+00
store double %16, double* %6
%17 = load double, double* %6
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = fsub double %17, %19
%21 = load double, double* %6
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = fsub double %21, %23
%25 = fmul double %20, %24
%26 = load double, double* %6
%27 = load i32, i32* %4
%28 = sitofp i32 %27 to double
%29 = fsub double %26, %28
%30 = fmul double %25, %29
%31 = load double, double* %6
%32 = load i32, i32* %5
%33 = sitofp i32 %32 to double
%34 = fsub double %31, %33
%35 = fmul double %30, %34
%36 = call double @sqrt(double %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [6 x i8] c"%.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, %10
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 5.000000e-01
%19 = sitofp i32 %10 to double
%20 = fsub double %18, %19
%21 = sitofp i32 %11 to double
%22 = fsub double %18, %21
%23 = fmul double %20, %22
%24 = sitofp i32 %13 to double
%25 = fsub double %18, %24
%26 = fmul double %25, %23
%27 = sitofp i32 %15 to double
%28 = fsub double %18, %27
%29 = fmul double %28, %26
%30 = call double @sqrt(double %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %30)
ret i32 0
}