int main() {
  volatile double _p64, q64, r64;
  volatile float _p32, q32, r32;
  long i;
  unsigned long elapsed;
  _p64 = 3.1415926535897932384626433832795;
  _p32 = 3.1415926535897932384626433832795;
  elapsed = msec();
  for (i = 1; i <= 1000; i++) {
    q64 = 9.0;
    q64 = q64 * _p64 / 180.0;
    r64 = (asin(acos(atan(tan(cos(sin(q64)))))));
    r64 = r64 * 180.0 / _p64;
  }
  elapsed = msec() - elapsed;
  printf("9degree 64bit test result= %1.15f  time= %lu usecs\r\n", r64,
         elapsed);
  elapsed = msec();
  for (i = 1; i <= 1000; i++) {
    q32 = 9.0;
    q32 = q32 * _p32 / 180.0;
    r32 = (asin(acos(atan(tan(cos(sin(q32)))))));
    r32 = r32 * 180.0 / _p32;
  }
  elapsed = msec() - elapsed;
  printf("9degree 32bit test result= %1.6f  time= %lu usecs\r\n", r32, elapsed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xe5c(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    $0x0,%al
call   10a0 <msec@plt>
cltq
mov    %rax,-0x40(%rbp)
movq   $0x1,-0x38(%rbp)
cmpq   $0x3e8,-0x38(%rbp)
jg     1250 <main+0xd0>
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe21(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
call   1090 <cos@plt>
call   1080 <tan@plt>
call   1060 <atan@plt>
call   1040 <acos@plt>
call   1070 <asin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xde3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11be <main+0x3e>
mov    $0x0,%al
call   10a0 <msec@plt>
cltq
sub    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x40(%rbp),%rsi
lea    0xdaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   10a0 <msec@plt>
cltq
mov    %rax,-0x40(%rbp)
movq   $0x1,-0x38(%rbp)
cmpq   $0x3e8,-0x38(%rbp)
jg     133b <main+0x1bb>
movss  0xd61(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd4e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <sin@plt>
call   1090 <cos@plt>
call   1080 <tan@plt>
call   1060 <atan@plt>
call   1040 <acos@plt>
call   1070 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd00(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    128d <main+0x10d>
mov    $0x0,%al
call   10a0 <msec@plt>
cltq
sub    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rsi
lea    0xcf5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movabs $0x400921fb54442d18,%rax
21 09 40
mov    %rax,0x28(%rsp)
movl   $0x40490fdb,0x14(%rsp)
40
xor    %eax,%eax
call   10a0 <msec@plt>
mov    %eax,%r14d
mov    $0x3e8,%ebp
movabs $0x4022000000000000,%rbx
movsd  0xe40(%rip),%xmm1
mov    %rbx,0x20(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x20(%rsp),%xmm0
call   1050 <sin@plt>
call   1090 <cos@plt>
call   1080 <tan@plt>
call   1060 <atan@plt>
call   1040 <acos@plt>
call   1070 <asin@plt>
movsd  0xdf9(%rip),%xmm1
movsd  %xmm0,0x18(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  %xmm1,%xmm0
divsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
add    $0xffffffffffffffff,%rbp
jne    11c0 <main+0x40>
movslq %r14d,%rbx
xor    %eax,%eax
call   10a0 <msec@plt>
movslq %eax,%rsi
sub    %rbx,%rsi
movsd  0x18(%rsp),%xmm0
lea    0xdc6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
call   10a0 <msec@plt>
mov    %eax,%ebp
mov    $0x3e8,%ebx
nopl   0x0(%rax,%rax,1)
movl   $0x41100000,0x10(%rsp)
41
movss  0x10(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
divss  0xd8c(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <sin@plt>
call   1090 <cos@plt>
call   1080 <tan@plt>
call   1060 <atan@plt>
call   1040 <acos@plt>
call   1070 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd3a(%rip),%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
add    $0xffffffffffffffff,%rbx
jne    1260 <main+0xe0>
movslq %ebp,%rbx
xor    %eax,%eax
call   10a0 <msec@plt>
movslq %eax,%rsi
sub    %rbx,%rsi
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd38(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"9degree 64bit test result= %1.15f time= %lu usecs\0D\0A\00"
@.str.1 = [52 x i8] c"9degree 32bit test result= %1.6f time= %lu usecs\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %1
store volatile double 0x400921FB54442D18, double* %2
store volatile float 0x400921FB60000000, float* %5
%10 = call i32 (...) @msec()
%11 = sext i32 %10 to i64
store i64 %11, i64* %9
store i64 1, i64* %8
br label %12
12: ; preds = %31, %0
%13 = load i64, i64* %8
%14 = icmp sle i64 %13, 1000
br i1 %14, label %15, label %34
15: ; preds = %12
store volatile double 9.000000e+00, double* %3
%16 = load volatile double, double* %3
%17 = load volatile double, double* %2
%18 = fmul double %16, %17
%19 = fdiv double %18, 1.800000e+02
store volatile double %19, double* %3
%20 = load volatile double, double* %3
%21 = call double @sin(double %20)
%22 = call double @cos(double %21)
%23 = call double @tan(double %22)
%24 = call double @atan(double %23)
%25 = call double @acos(double %24)
%26 = call double @asin(double %25)
store volatile double %26, double* %4
%27 = load volatile double, double* %4
%28 = fmul double %27, 1.800000e+02
%29 = load volatile double, double* %2
%30 = fdiv double %28, %29
store volatile double %30, double* %4
br label %31
31: ; preds = %15
%32 = load i64, i64* %8
%33 = add nsw i64 %32, 1
store i64 %33, i64* %8
br label %12
34: ; preds = %12
%35 = call i32 (...) @msec()
%36 = sext i32 %35 to i64
%37 = load i64, i64* %9
%38 = sub i64 %36, %37
store i64 %38, i64* %9
%39 = load volatile double, double* %4
%40 = load i64, i64* %9
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), double %39, i64 %40)
%42 = call i32 (...) @msec()
%43 = sext i32 %42 to i64
store i64 %43, i64* %9
store i64 1, i64* %8
br label %44
44: ; preds = %70, %34
%45 = load i64, i64* %8
%46 = icmp sle i64 %45, 1000
br i1 %46, label %47, label %73
47: ; preds = %44
store volatile float 9.000000e+00, float* %6
%48 = load volatile float, float* %6
%49 = load volatile float, float* %5
%50 = fmul float %48, %49
%51 = fpext float %50 to double
%52 = fdiv double %51, 1.800000e+02
%53 = fptrunc double %52 to float
store volatile float %53, float* %6
%54 = load volatile float, float* %6
%55 = fpext float %54 to double
%56 = call double @sin(double %55)
%57 = call double @cos(double %56)
%58 = call double @tan(double %57)
%59 = call double @atan(double %58)
%60 = call double @acos(double %59)
%61 = call double @asin(double %60)
%62 = fptrunc double %61 to float
store volatile float %62, float* %7
%63 = load volatile float, float* %7
%64 = fpext float %63 to double
%65 = fmul double %64, 1.800000e+02
%66 = load volatile float, float* %5
%67 = fpext float %66 to double
%68 = fdiv double %65, %67
%69 = fptrunc double %68 to float
store volatile float %69, float* %7
br label %70
70: ; preds = %47
%71 = load i64, i64* %8
%72 = add nsw i64 %71, 1
store i64 %72, i64* %8
br label %44
73: ; preds = %44
%74 = call i32 (...) @msec()
%75 = sext i32 %74 to i64
%76 = load i64, i64* %9
%77 = sub i64 %75, %76
store i64 %77, i64* %9
%78 = load volatile float, float* %7
%79 = fpext float %78 to double
%80 = load i64, i64* %9
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), double %79, i64 %80)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"9degree 64bit test result= %1.15f time= %lu usecs\0D\0A\00"
@.str.1 = [52 x i8] c"9degree 32bit test result= %1.6f time= %lu usecs\0D\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = bitcast double* %1 to i8*
%8 = bitcast double* %2 to i8*
%9 = bitcast double* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
store volatile double 0x400921FB54442D18, double* %1
store volatile float 0x400921FB60000000, float* %4
%13 = tail call i32 (...) @msec()
br label %14
14: ; preds = %0, %14
%15 = phi i64 [ 1, %0 ], [ %31, %14 ]
store volatile double 9.000000e+00, double* %2
%16 = load volatile double, double* %2
%17 = load volatile double, double* %1
%18 = fmul double %16, %17
%19 = fdiv double %18, 1.800000e+02
store volatile double %19, double* %2
%20 = load volatile double, double* %2
%21 = tail call double @sin(double %20)
%22 = tail call double @cos(double %21)
%23 = tail call double @tan(double %22)
%24 = tail call double @atan(double %23)
%25 = tail call double @acos(double %24)
%26 = tail call double @asin(double %25)
store volatile double %26, double* %3
%27 = load volatile double, double* %3
%28 = fmul double %27, 1.800000e+02
%29 = load volatile double, double* %1
%30 = fdiv double %28, %29
store volatile double %30, double* %3
%31 = add nuw nsw i64 %15, 1
%32 = icmp eq i64 %31, 1001
br i1 %32, label %33, label %14
33: ; preds = %14
%34 = sext i32 %13 to i64
%35 = tail call i32 (...) @msec()
%36 = sext i32 %35 to i64
%37 = sub nsw i64 %36, %34
%38 = load volatile double, double* %3
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), double %38, i64 %37)
%40 = tail call i32 (...) @msec()
br label %41
41: ; preds = %33, %41
%42 = phi i64 [ 1, %33 ], [ %63, %41 ]
store volatile float 9.000000e+00, float* %5
%43 = load volatile float, float* %5
%44 = load volatile float, float* %4
%45 = fmul float %43, %44
%46 = fdiv float %45, 1.800000e+02
store volatile float %46, float* %5
%47 = load volatile float, float* %5
%48 = fpext float %47 to double
%49 = tail call double @sin(double %48)
%50 = tail call double @cos(double %49)
%51 = tail call double @tan(double %50)
%52 = tail call double @atan(double %51)
%53 = tail call double @acos(double %52)
%54 = tail call double @asin(double %53)
%55 = fptrunc double %54 to float
store volatile float %55, float* %6
%56 = load volatile float, float* %6
%57 = fpext float %56 to double
%58 = fmul double %57, 1.800000e+02
%59 = load volatile float, float* %4
%60 = fpext float %59 to double
%61 = fdiv double %58, %60
%62 = fptrunc double %61 to float
store volatile float %62, float* %6
%63 = add nuw nsw i64 %42, 1
%64 = icmp eq i64 %63, 1001
br i1 %64, label %65, label %41
65: ; preds = %41
%66 = sext i32 %40 to i64
%67 = tail call i32 (...) @msec()
%68 = sext i32 %67 to i64
%69 = sub nsw i64 %68, %66
%70 = load volatile float, float* %6
%71 = fpext float %70 to double
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), double %71, i64 %69)
ret i32 0
}