void poly_create_3(float *poly, float *y) {
  poly[2] = (y[0] - 2 * y[1] + y[2]) / 2;
  poly[1] = -1.5 * y[0] + 2 * y[1] - 0.5 * y[2];
  poly[0] = y[0];
}


x86 assembly (clang, -O0):
<poly_create_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
addss  %xmm1,%xmm1
subss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
movss  0xeda(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0xeb5(%rip),%xmm0
mulss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe77(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly_create_3>:
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
addss  %xmm1,%xmm1
subss  %xmm1,%xmm0
addss  0x8(%rsi),%xmm0
mulss  0xee2(%rip),%xmm0
movss  %xmm0,0x8(%rdi)
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
addss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xec8(%rip),%xmm0
movss  0x8(%rsi),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xebf(%rip),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,0x4(%rdi)
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @poly_create_3(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 1
%10 = load float, float* %9
%11 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %10, float %7)
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = fadd float %11, %14
%16 = fdiv float %15, 2.000000e+00
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 2
store float %16, float* %18
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
%26 = fmul float 2.000000e+00, %25
%27 = fpext float %26 to double
%28 = call double @llvm.fmuladd.f64(double -1.500000e+00, double %22, double %27)
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 2
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %32, double %28)
%34 = fptrunc double %33 to float
%35 = load float*, float** %3
%36 = getelementptr inbounds float, float* %35, i64 1
store float %34, float* %36
%37 = load float*, float** %4
%38 = getelementptr inbounds float, float* %37, i64 0
%39 = load float, float* %38
%40 = load float*, float** %3
%41 = getelementptr inbounds float, float* %40, i64 0
store float %39, float* %41
ret void
}

LLVM IR (-O2):
define void @poly_create_3(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float -2.000000e+00, float %3)
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = fmul float %9, 5.000000e-01
%11 = getelementptr inbounds float, float* %0, i64 2
store float %10, float* %11
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = load float, float* %4
%15 = fmul float %14, 2.000000e+00
%16 = fpext float %15 to double
%17 = tail call double @llvm.fmuladd.f64(double %13, double -1.500000e+00, double %16)
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = tail call double @llvm.fmuladd.f64(double %19, double -5.000000e-01, double %17)
%21 = fptrunc double %20 to float
%22 = getelementptr inbounds float, float* %0, i64 1
store float %21, float* %22
%23 = load float, float* %1
store float %23, float* %0
ret void
}