// File: PeterDenton[P]Nu-Pert/src/Figures.cpp
// Function: Figures::Pmu2e_Precision()
void Pmu2e_Precision()
{
	std::ofstream data("data/Pmu2e_Precision.txt");
	set_ordering(true);

	int exp_num = 0; // DUNE
	double delta = 3 * M_PI / 2;
	int alpha = 1; // nu_mu
	int beta = 0; // nu_e
	double Emin = 0.1;
	double Emax = 10;
	double Einc = 1.001;

	double Yrho, L, LE, a;
	double P_exact, P_GF0, P_GF1, P_Check2, P_Mixed, P_Mixed2;
	set_experimental_parameters(exp_num, &Yrho, &L);

	data << L << " ";
	data << delta << " ";
	data << std::endl;

	Progress_Bar Pbar;
	for (double E = Emin; E <= Emax; E *= Einc)
	{
		LE = L / E;
		a = Yrho * E * Y_to_a;

		P_exact = Exact::Palphabeta(alpha, beta, a, LE, delta);
		P_GF0 = GF::Palphabeta(alpha, beta, a, LE, delta, 0);
		P_GF1 = GF::Palphabeta(alpha, beta, a, LE, delta, 1);
		P_Check2 = Check::Palphabeta(alpha, beta, a, LE, delta, 2);
		P_Mixed = Mixed::Palphabeta(alpha, beta, a, LE, delta, 0);
		P_Mixed2 = Mixed::Palphabeta(alpha, beta, a, LE, delta, 2);

		data << E << " ";
		data << P_exact << " ";
		data << std::abs(1 - P_GF0 / P_exact) << " ";
		data << std::abs(1 - P_GF1 / P_exact) << " ";
		data << std::abs(1 - P_Check2 / P_exact) << " ";
		data << std::abs(1 - P_Mixed / P_exact) << " ";
		data << std::abs(1 - P_Mixed2 / P_exact) << " ";
		data << std::endl;

		Pbar.update(Emin, Emax, E, false);
	} // E
	data.close();
}

// Assembly:
subq $0x9a8, %rsp            # imm = 0x9A8
leaq 0x3048(%rip), %rsi      # 0x14e66
leaq 0x7a8(%rsp), %rdi
movl $0x10, %edx
callq 0x21a0
movl $0x1, %edi
callq 0x49d0
jmp 0x11e3c
movl $0x0, 0x798(%rsp)
movabsq $0x4012d97c7f3321d2, %rax # imm = 0x4012D97C7F3321D2
movq %rax, 0x790(%rsp)
movl $0x1, 0x78c(%rsp)
movl $0x0, 0x788(%rsp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0x780(%rsp)
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x778(%rsp)
movabsq $0x3ff004189374bc6a, %rax # imm = 0x3FF004189374BC6A
movq %rax, 0x770(%rsp)
movl 0x798(%rsp), %edi
leaq 0x768(%rsp), %rsi
leaq 0x760(%rsp), %rdx
callq 0x6fa0
jmp 0x11ec3
movsd 0x760(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x98(%rsp)
jmp 0x11ee3
movq 0x98(%rsp), %rdi
leaq 0x2ca4(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x11ef9
movsd 0x790(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x90(%rsp)
jmp 0x11f19
movq 0x90(%rsp), %rdi
leaq 0x2c6e(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x11f2f
movq 0x7092(%rip), %rsi      # 0x18fc8
leaq 0x7a8(%rsp), %rdi
callq 0x2180
jmp 0x11f45
leaq 0xa8(%rsp), %rdi
callq 0xf550
jmp 0x11f54
movsd 0x780(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xa0(%rsp), %xmm1
movsd 0x778(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x12453
movsd 0x760(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x758(%rsp)
movsd 0x768(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
mulsd %xmm1, %xmm0
leaq 0x2322(%rip), %rax      # 0x142e0
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x750(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
callq 0x6c10
movsd %xmm0, 0x88(%rsp)
jmp 0x12008
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x748(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
xorl %edx, %edx
callq 0x8c80
movsd %xmm0, 0x80(%rsp)
jmp 0x12055
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x740(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
movl $0x1, %edx
callq 0x8c80
movsd %xmm0, 0x78(%rsp)
jmp 0x120a2
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x738(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
movl $0x2, %edx
callq 0x4180
movsd %xmm0, 0x70(%rsp)
jmp 0x120ec
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x730(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
xorl %edx, %edx
callq 0xf130
movsd %xmm0, 0x68(%rsp)
jmp 0x12133
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x728(%rsp)
movl 0x78c(%rsp), %edi
movl 0x788(%rsp), %esi
movsd 0x750(%rsp), %xmm0
movsd 0x758(%rsp), %xmm1
movsd 0x790(%rsp), %xmm2
movl $0x2, %edx
callq 0xf130
movsd %xmm0, 0x60(%rsp)
jmp 0x1217d
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x720(%rsp)
movsd 0xa0(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x58(%rsp)
jmp 0x121a9
movq 0x58(%rsp), %rdi
leaq 0x29e1(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x121bc
movsd 0x748(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x50(%rsp)
jmp 0x121d9
movq 0x50(%rsp), %rdi
leaq 0x29b1(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x121ec
movsd 0x740(%rsp), %xmm1
movsd 0x748(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1e0e(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x48(%rsp)
jmp 0x1221b
movsd 0x48(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x40(%rsp)
jmp 0x12235
movq 0x40(%rsp), %rdi
leaq 0x2955(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x12248
movsd 0x738(%rsp), %xmm1
movsd 0x748(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1db2(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x38(%rsp)
jmp 0x12277
movsd 0x38(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x30(%rsp)
jmp 0x12291
movq 0x30(%rsp), %rdi
leaq 0x28f9(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x122a4
movsd 0x730(%rsp), %xmm1
movsd 0x748(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1d56(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x28(%rsp)
jmp 0x122d3
movsd 0x28(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x20(%rsp)
jmp 0x122ed
movq 0x20(%rsp), %rdi
leaq 0x289d(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x12300
movsd 0x728(%rsp), %xmm1
movsd 0x748(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1cfa(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x18(%rsp)
jmp 0x1232f
movsd 0x18(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, 0x10(%rsp)
jmp 0x12349
movq 0x10(%rsp), %rdi
leaq 0x2841(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x1235c
movsd 0x720(%rsp), %xmm1
movsd 0x748(%rsp), %xmm0
divsd %xmm0, %xmm1
movsd 0x1c9e(%rip), %xmm0     # 0x14018
subsd %xmm1, %xmm0
callq 0x7470
movsd %xmm0, 0x8(%rsp)
jmp 0x1238b
movsd 0x8(%rsp), %xmm0
leaq 0x7a8(%rsp), %rdi
callq 0x22c0
movq %rax, (%rsp)
jmp 0x123a4
movq (%rsp), %rdi
leaq 0x27e7(%rip), %rsi      # 0x14b96
callq 0x2160
jmp 0x123b6
movq 0x6c0b(%rip), %rsi      # 0x18fc8
leaq 0x7a8(%rsp), %rdi
callq 0x2180
jmp 0x123cc
movsd 0x780(%rsp), %xmm0
movsd 0x778(%rsp), %xmm1
movsd 0xa0(%rsp), %xmm2
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
callq 0xfaf0
jmp 0x123f8
jmp 0x123fa
movsd 0x770(%rsp), %xmm0
mulsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
jmp 0x11f66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a0(%rsp)
movl %eax, 0x79c(%rsp)
jmp 0x12484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7a0(%rsp)
movl %eax, 0x79c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xf850
jmp 0x12484
leaq 0x7a8(%rsp), %rdi
callq 0x2210
jmp 0x12462
leaq 0xa8(%rsp), %rdi
callq 0xf850
leaq 0x7a8(%rsp), %rdi
callq 0x2220
addq $0x9a8, %rsp            # imm = 0x9A8
retq
leaq 0x7a8(%rsp), %rdi
callq 0x2220
movq 0x7a0(%rsp), %rdi
callq 0x2290
nop