#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 *, float);
int /*<<< orphan*/ scanf(char *, float *, ...);
float sqrt(float);
int main() {
  float t, x, e, y, d;
  scanf("%f", &t);
  while (t--) {
    scanf("%f%f", &x, &y);
    e = sqrt(((x * x) - (y * y)) / (x * x));
    d = 2 * x * e;
    printf("%.3f\n", d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea2(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1181 <main+0x51>
jp     1181 <main+0x51>
jmp    1205 <main+0xd5>
lea    0xe80(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xe24(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0xea4(%rip),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1174 <main+0x44>
jnp    1209 <main+0xd9>
lea    0xe89(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x14(%rsp),%r12
lea    0xe7d(%rip),%rbx
jmp    11cc <main+0x9c>
xchg   %ax,%ax
call   1050 <sqrt@plt>
movss  0x10(%rsp),%xmm1
addss  %xmm1,%xmm1
mulss  %xmm0,%xmm1
mov    %rbx,%rdi
movaps %xmm1,%xmm0
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
addss  0xe3e(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
jne    11cc <main+0x9c>
jnp    1209 <main+0xd9>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
mulss  %xmm2,%xmm2
mulss  %xmm1,%xmm1
movaps %xmm1,%xmm0
subss  %xmm2,%xmm0
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1190 <main+0x60>
sqrtss %xmm0,%xmm0
jmp    1195 <main+0x65>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
br label %8
8: ; preds = %12, %0
%9 = load float, float* %2
%10 = fadd float %9, -1.000000e+00
store float %10, float* %2
%11 = fcmp une float %9, 0.000000e+00
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %3, float* %5)
%14 = load float, float* %3
%15 = load float, float* %3
%16 = load float, float* %5
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = fneg float %18
%20 = call float @llvm.fmuladd.f32(float %14, float %15, float %19)
%21 = load float, float* %3
%22 = load float, float* %3
%23 = fmul float %21, %22
%24 = fdiv float %20, %23
%25 = call float @sqrt(float %24)
store float %25, float* %4
%26 = load float, float* %3
%27 = fmul float 2.000000e+00, %26
%28 = load float, float* %4
%29 = fmul float %27, %28
store float %29, float* %6
%30 = load float, float* %6
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %30)
br label %8
32: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = fadd float %8, -1.000000e+00
store float %9, float* %1
%10 = fcmp une float %8, 0.000000e+00
br i1 %10, label %11, label %28
11: ; preds = %0, %11
%12 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fneg float %14
%16 = fmul float %14, %15
%17 = call float @llvm.fmuladd.f32(float %13, float %13, float %16)
%18 = fmul float %13, %13
%19 = fdiv float %17, %18
%20 = call float @sqrt(float %19)
%21 = load float, float* %2
%22 = fmul float %21, 2.000000e+00
%23 = fmul float %20, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float %23)
%25 = load float, float* %1
%26 = fadd float %25, -1.000000e+00
store float %26, float* %1
%27 = fcmp une float %25, 0.000000e+00
br i1 %27, label %11, label %28
28: ; preds = %11, %0
ret i32 0
}