double calc_density(double ts) {
  double rhow, t, rhostps;
  t = ts;
  rhow = 999.842594 + .06793952 * t - .009095290 * t * t +
         .0001001685 * t * t * t - .000001120083 * t * t * t * t +
         .000000006536332 * t * t * t * t * t;
  rhostps = rhow - 1000.;
  return (rhostps);
}


x86 assembly (clang, -O0):
<calc_density>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xf08(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xf04(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe88(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe45(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe0a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_density>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xec4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0xeac(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_density(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
store double %6, double* %4
%7 = load double, double* %4
%8 = call double @llvm.fmuladd.f64(double 0x3FB1647C00818526, double %7, double 0x408F3EBDA1EC4E72)
%9 = load double, double* %4
%10 = fmul double 9.095290e-03, %9
%11 = load double, double* %4
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %8)
%14 = load double, double* %4
%15 = fmul double 0x3F1A4231B9F290BD, %14
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = load double, double* %4
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %13)
%20 = load double, double* %4
%21 = fmul double 0x3EB2CAB84856C8D1, %20
%22 = load double, double* %4
%23 = fmul double %21, %22
%24 = load double, double* %4
%25 = fmul double %23, %24
%26 = load double, double* %4
%27 = fneg double %25
%28 = call double @llvm.fmuladd.f64(double %27, double %26, double %19)
%29 = load double, double* %4
%30 = fmul double 0x3E3C12C5E5C0CC50, %29
%31 = load double, double* %4
%32 = fmul double %30, %31
%33 = load double, double* %4
%34 = fmul double %32, %33
%35 = load double, double* %4
%36 = fmul double %34, %35
%37 = load double, double* %4
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double %28)
store double %38, double* %3
%39 = load double, double* %3
%40 = fsub double %39, 1.000000e+03
store double %40, double* %5
%41 = load double, double* %5
ret double %41
}

LLVM IR (-O2):
define double @calc_density(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FB1647C00818526, double 0x408F3EBDA1EC4E72)
%3 = fmul double %0, -9.095290e-03
%4 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %2)
%5 = fmul double %0, 0x3F1A4231B9F290BD
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %4)
%8 = fmul double %0, 0xBEB2CAB84856C8D1
%9 = fmul double %8, %0
%10 = fmul double %9, %0
%11 = tail call double @llvm.fmuladd.f64(double %10, double %0, double %7)
%12 = fmul double %0, 0x3E3C12C5E5C0CC50
%13 = fmul double %12, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = tail call double @llvm.fmuladd.f64(double %15, double %0, double %11)
%17 = fadd double %16, -1.000000e+03
ret double %17
}