void InvStereoProj(x, y, z, u, v) double *x, *y, *z, u, v;
{
  double s;
  s = u * u + v * v;
  *x = 2 * u / (1 - s);
  *y = 2 * v / (1 - s);
  *z = (1 + s) / (1 - s);
}


x86 assembly (clang, -O0):
<InvStereoProj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xec5(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe9f(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe71(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe64(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvStereoProj>:
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm0,%xmm0
movsd  0xee0(%rip),%xmm2
movapd %xmm2,%xmm4
subsd  %xmm3,%xmm4
divsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
addsd  %xmm1,%xmm1
divsd  %xmm4,%xmm1
movsd  %xmm1,(%rsi)
addsd  %xmm2,%xmm3
divsd  %xmm4,%xmm3
movsd  %xmm3,(%rdx)
ret

LLVM IR (-O0):
define void @InvStereoProj(double* %0, double* %1, double* %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %9
%13 = load double, double* %9
%14 = load double, double* %10
%15 = load double, double* %10
%16 = fmul double %14, %15
%17 = call double @llvm.fmuladd.f64(double %12, double %13, double %16)
store double %17, double* %11
%18 = load double, double* %9
%19 = fmul double 2.000000e+00, %18
%20 = load double, double* %11
%21 = fsub double 1.000000e+00, %20
%22 = fdiv double %19, %21
%23 = load double*, double** %6
store double %22, double* %23
%24 = load double, double* %10
%25 = fmul double 2.000000e+00, %24
%26 = load double, double* %11
%27 = fsub double 1.000000e+00, %26
%28 = fdiv double %25, %27
%29 = load double*, double** %7
store double %28, double* %29
%30 = load double, double* %11
%31 = fadd double 1.000000e+00, %30
%32 = load double, double* %11
%33 = fsub double 1.000000e+00, %32
%34 = fdiv double %31, %33
%35 = load double*, double** %8
store double %34, double* %35
ret void
}

LLVM IR (-O2):
define void @InvStereoProj(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double %3, double %4) {
%6 = fmul double %4, %4
%7 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %6)
%8 = fmul double %3, 2.000000e+00
%9 = fsub double 1.000000e+00, %7
%10 = fdiv double %8, %9
store double %10, double* %0
%11 = fmul double %4, 2.000000e+00
%12 = fdiv double %11, %9
store double %12, double* %1
%13 = fadd double %7, 1.000000e+00
%14 = fdiv double %13, %9
store double %14, double* %2
ret void
}