// File: PeterDenton[P]Nu-Pert/src/Mixed.cpp
// Function: Mixed::cdeltam(double, double, int)
double cdeltam(double D, double delta, int order)
{
	// tmp
	double Et = E(D, order);
	double Ft = F(D, order);
	// denominator
	double densq1 = pow(Et, 2) * s23sq + pow(Ft, 2) * c23sq + 2 * Et * Ft * c23 * s23 * cos(delta);
	double densq2 = pow(Et, 2) * c23sq + pow(Ft, 2) * s23sq - 2 * Et * Ft * c23 * s23 * cos(delta);
	// numerator c23sq -> c23 typo corrected
	return ((pow(Et, 2) - pow(Ft, 2)) * cos(delta) * s23 * c23 + Et * Ft * (c23sq - s23sq)) / sqrt(densq1 * densq2);
}

// Assembly:
subq $0x98, %rsp
movsd %xmm0, 0x90(%rsp)
movsd %xmm1, 0x88(%rsp)
movl %edi, 0x84(%rsp)
movsd 0x90(%rsp), %xmm0
movl 0x84(%rsp), %edi
callq 0xe070
movsd %xmm0, 0x78(%rsp)
movsd 0x90(%rsp), %xmm0
movl 0x84(%rsp), %edi
callq 0xe140
movsd %xmm0, 0x70(%rsp)
movsd 0x78(%rsp), %xmm0
movsd 0x3934(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x10(%rsp)
leaq 0x3bba(%rip), %rax      # 0x122a0
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x390a(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd 0x8(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
leaq 0x3baf(%rip), %rax      # 0x122c8
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x38d5(%rip), %xmm0     # 0x12008
mulsd 0x78(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
leaq 0x8a8a(%rip), %rax      # 0x171d0
mulsd (%rax), %xmm0
leaq 0x8a67(%rip), %rax      # 0x171b8
mulsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x88(%rsp), %xmm0
callq 0x22d0
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x20(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x78(%rsp), %xmm0
movsd 0x3874(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x30(%rsp)
leaq 0x3b22(%rip), %rax      # 0x122c8
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x384a(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd 0x28(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
leaq 0x3ac7(%rip), %rax      # 0x122a0
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x3815(%rip), %xmm0     # 0x12008
mulsd 0x78(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
leaq 0x89ca(%rip), %rax      # 0x171d0
mulsd (%rax), %xmm0
leaq 0x89a7(%rip), %rax      # 0x171b8
mulsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x88(%rsp), %xmm0
callq 0x22d0
movsd 0x38(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x40(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x78(%rsp), %xmm0
movsd 0x379d(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x48(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x3784(%rip), %xmm1     # 0x12008
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x48(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x88(%rsp), %xmm0
callq 0x22d0
movaps %xmm0, %xmm1
movsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
leaq 0x88fa(%rip), %rax      # 0x171b8
mulsd (%rax), %xmm0
leaq 0x8907(%rip), %rax      # 0x171d0
movsd (%rax), %xmm2
movsd 0x78(%rsp), %xmm1
mulsd 0x70(%rsp), %xmm1
leaq 0x39e8(%rip), %rax      # 0x122c8
movsd (%rax), %xmm3
leaq 0x39b5(%rip), %rax      # 0x122a0
subsd (%rax), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x68(%rsp), %xmm0
mulsd 0x60(%rsp), %xmm0
callq 0x20f0
movaps %xmm0, %xmm1
movsd 0x58(%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x98, %rsp
retq
nopw (%rax,%rax)