// File: PeterDenton[P]Nu-Pert/src/Figures.cpp
// Function: Figures::Eigenvalue_Precision()
void Eigenvalue_Precision()
{
	double a;
	std::ofstream data[2];
	data[0].open("data/Eigenvalue_Precision_NO.txt");
	data[1].open("data/Eigenvalue_Precision_IO.txt");

	double l10, l20, l30;
	double l12, l22, l32;
	double M1sq, M2sq, M3sq;
	int order;
	for (int i = 0; i < 1; i++) // only NO for now
	{
		set_ordering(i == 0);
		for (double Y = -40; Y <= 40; Y += 0.011)
		{
			a = Y * Y_to_a;

			order = 0;
			l10 = Check::l1(a, order);
			l20 = Check::l2(a, order);
			l30 = Check::l3(a, order);

			order = 2;
			l12 = Check::l1(a, order);
			l22 = Check::l2(a, order);
			l32 = Check::l3(a, order);

			M1sq = Exact::M1sq(a);
			M2sq = Exact::M2sq(a);
			M3sq = Exact::M3sq(a);

			data[i] << Y;
			data[i] << " " << std::abs(1 - l10 / M1sq);
			data[i] << " " << std::abs(1 - l20 / M2sq);
			data[i] << " " << std::abs(1 - l30 / M3sq);
			data[i] << " " << std::abs(1 - l12 / M1sq);
			data[i] << " " << std::abs(1 - l22 / M2sq);
			data[i] << " " << std::abs(1 - l32 / M3sq);
			data[i] << std::endl;
		}
		data[i].close();
	}
}

// Assembly:
subq $0x578, %rsp            # imm = 0x578
leaq 0x170(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq %rax, %rcx
addq $0x400, %rcx            # imm = 0x400
movq %rcx, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x2260
jmp 0x12ad8
movq 0xf8(%rsp), %rcx
movq 0xe8(%rsp), %rax
addq $0x200, %rax            # imm = 0x200
cmpq %rcx, %rax
movq %rax, 0x100(%rsp)
jne 0x12ac1
leaq 0x23b9(%rip), %rsi      # 0x14ebb
leaq 0x170(%rsp), %rdi
movl $0x10, %edx
callq 0x2040
jmp 0x12b16
leaq 0x370(%rsp), %rdi
leaq 0x23b7(%rip), %rsi      # 0x14edc
movl $0x10, %edx
callq 0x2040
jmp 0x12b31
movl $0x0, 0x110(%rsp)
cmpl $0x1, 0x110(%rsp)
jge 0x1311a
movl 0x110(%rsp), %eax
testl %eax, %eax
sete %al
movzbl %al, %edi
callq 0x49d0
jmp 0x12b60
movsd 0x2200(%rip), %xmm0     # 0x14d68
movsd %xmm0, 0x108(%rsp)
movsd 0x21f7(%rip), %xmm0     # 0x14d70
ucomisd 0x108(%rsp), %xmm0
jb 0x130e7
movsd 0x108(%rsp), %xmm0
leaq 0x1748(%rip), %rax      # 0x142e0
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x570(%rsp)
movl $0x0, 0x114(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x27f0
movsd %xmm0, 0xe0(%rsp)
jmp 0x12bd4
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x158(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x2a60
movsd %xmm0, 0xd8(%rsp)
jmp 0x12c06
movsd 0xd8(%rsp), %xmm0
movsd %xmm0, 0x150(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x2cd0
movsd %xmm0, 0xd0(%rsp)
jmp 0x12c38
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x148(%rsp)
movl $0x2, 0x114(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x27f0
movsd %xmm0, 0xc8(%rsp)
jmp 0x12c75
movsd 0xc8(%rsp), %xmm0
movsd %xmm0, 0x140(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x2a60
movsd %xmm0, 0xc0(%rsp)
jmp 0x12ca7
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x138(%rsp)
movsd 0x570(%rsp), %xmm0
movl 0x114(%rsp), %edi
callq 0x2cd0
movsd %xmm0, 0xb8(%rsp)
jmp 0x12cd9
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x130(%rsp)
movsd 0x570(%rsp), %xmm0
callq 0x59d0
movsd %xmm0, 0xb0(%rsp)
jmp 0x12d04
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0x128(%rsp)
movsd 0x570(%rsp), %xmm0
callq 0x5a20
movsd %xmm0, 0xa8(%rsp)
jmp 0x12d2f
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
movsd 0x570(%rsp), %xmm0
callq 0x5a70
movsd %xmm0, 0xa0(%rsp)
jmp 0x12d5a
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x118(%rsp)
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
movsd 0x108(%rsp), %xmm0
callq 0x22c0
jmp 0x12d90
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1deb(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x98(%rsp)
jmp 0x12dba
movsd 0x158(%rsp), %xmm1
movsd 0x128(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1240(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x90(%rsp)
jmp 0x12dec
movsd 0x90(%rsp), %xmm0
movq 0x98(%rsp), %rdi
callq 0x22c0
jmp 0x12e04
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1d77(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x88(%rsp)
jmp 0x12e2e
movsd 0x150(%rsp), %xmm1
movsd 0x120(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x11cc(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x80(%rsp)
jmp 0x12e60
movsd 0x80(%rsp), %xmm0
movq 0x88(%rsp), %rdi
callq 0x22c0
jmp 0x12e78
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1d03(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x78(%rsp)
jmp 0x12e9f
movsd 0x148(%rsp), %xmm1
movsd 0x118(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x115b(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x70(%rsp)
jmp 0x12ece
movsd 0x70(%rsp), %xmm0
movq 0x78(%rsp), %rdi
callq 0x22c0
jmp 0x12ee0
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1c9b(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x68(%rsp)
jmp 0x12f07
movsd 0x140(%rsp), %xmm1
movsd 0x128(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x10f3(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x60(%rsp)
jmp 0x12f36
movsd 0x60(%rsp), %xmm0
movq 0x68(%rsp), %rdi
callq 0x22c0
jmp 0x12f48
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1c33(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x58(%rsp)
jmp 0x12f6f
movsd 0x138(%rsp), %xmm1
movsd 0x120(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x108b(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x50(%rsp)
jmp 0x12f9e
movsd 0x50(%rsp), %xmm0
movq 0x58(%rsp), %rdi
callq 0x22c0
jmp 0x12fb0
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
leaq 0x1bcb(%rip), %rsi      # 0x14b96
callq 0x2160
movq %rax, 0x48(%rsp)
jmp 0x12fd7
movsd 0x130(%rsp), %xmm1
movsd 0x118(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1023(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x40(%rsp)
jmp 0x13006
movsd 0x40(%rsp), %xmm0
movq 0x48(%rsp), %rdi
callq 0x22c0
jmp 0x13018
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
movq 0x5f95(%rip), %rsi      # 0x18fc8
callq 0x2180
jmp 0x1303a
jmp 0x1303c
movsd 0x1d4c(%rip), %xmm0     # 0x14d90
addsd 0x108(%rsp), %xmm0
movsd %xmm0, 0x108(%rsp)
jmp 0x12b71
movq 0xf0(%rsp), %rcx
movq %rax, %rsi
movq 0xe8(%rsp), %rax
movq %rsi, 0x168(%rsp)
movl %edx, 0x164(%rsp)
cmpq %rax, %rcx
movq %rax, 0x38(%rsp)
je 0x130b4
movq 0x38(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, 0x30(%rsp)
callq 0x2220
movq 0xf0(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0x13087
jmp 0x1318e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x168(%rsp)
movl %eax, 0x164(%rsp)
leaq 0x170(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0x400, %rax            # imm = 0x400
movq %rax, 0x28(%rsp)
jmp 0x13164
movslq 0x110(%rsp), %rax
shlq $0x9, %rax
leaq 0x170(%rsp,%rax), %rdi
callq 0x2210
jmp 0x13102
jmp 0x13104
movl 0x110(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x110(%rsp)
jmp 0x12b3c
leaq 0x170(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x400, %rax            # imm = 0x400
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, 0x8(%rsp)
callq 0x2220
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x13132
addq $0x578, %rsp            # imm = 0x578
retq
movq 0x28(%rsp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
movq %rdi, (%rsp)
callq 0x2220
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x13164
jmp 0x1318e
movq 0x168(%rsp), %rdi
callq 0x2290
nopl (%rax,%rax)