// File: PeterDenton[P]Nu-Pert/src/Mixed.cpp
// Function: Mixed::sdeltam(double, double, int)
double sdeltam(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)) * sin(delta) * s23 * c23) / 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 0x3674(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x10(%rsp)
leaq 0x38fa(%rip), %rax      # 0x122a0
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x364a(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd 0x8(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
leaq 0x38ef(%rip), %rax      # 0x122c8
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x3615(%rip), %xmm0     # 0x12008
mulsd 0x78(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
leaq 0x87ca(%rip), %rax      # 0x171d0
mulsd (%rax), %xmm0
leaq 0x87a7(%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 0x35b4(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x30(%rsp)
leaq 0x3862(%rip), %rax      # 0x122c8
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x358a(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd 0x28(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
leaq 0x3807(%rip), %rax      # 0x122a0
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x3555(%rip), %xmm0     # 0x12008
mulsd 0x78(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
leaq 0x870a(%rip), %rax      # 0x171d0
mulsd (%rax), %xmm0
leaq 0x86e7(%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 0x34dd(%rip), %xmm1     # 0x12008
callq 0x22a0
movsd %xmm0, 0x48(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x34c4(%rip), %xmm1     # 0x12008
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x48(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x88(%rsp), %xmm0
callq 0x2060
movaps %xmm0, %xmm1
movsd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
leaq 0x863a(%rip), %rax      # 0x171b8
mulsd (%rax), %xmm0
leaq 0x8647(%rip), %rax      # 0x171d0
mulsd (%rax), %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
nopl (%rax)