// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Verify.cpp
// Function: Verify::Precision_Scan(double (*)(int, int, double, double, double, int), int, double)
void Precision_Scan(double (*P_To_Verify)(int, int, double, double, double, int), int order, double Precision)
{
	double YerhoE_max = 40;
	double a_max = Y_to_a * YerhoE_max;
	double LE_max = 2500;
	int N_Steps = 10;
	std::ofstream out_file("data/Precision_Scan.txt", std::fstream::app);

	std::string flavor_names[3] = {"e ", "mu", "tau"};
	int N_Total, N_Passed;
	double P_Tilde, P_Exact;

	for (int alpha = 0; alpha <= 1; alpha++)
	{
		for (int beta = 0; beta <= alpha; beta++)
		{
			N_Total = 0;
			N_Passed = 0;
			Progress_Bar Pbar;
			for (double a = -a_max; a <= a_max; a += 2 * a_max / N_Steps)
			{
				for (double LE = -LE_max; LE <= LE_max; LE += 2 * LE_max / N_Steps)
				{
					for (double delta = 0; delta <= 2 * M_PI; delta += 2 * M_PI / N_Steps)
					{
						for (int ord = 0; ord <= 1; ord++)
						{
							set_ordering(ord == 0);
							P_Tilde = P_To_Verify(alpha, beta, a, LE, delta, order);
							P_Exact = Exact::Palphabeta(alpha, beta, a, LE, delta);
							N_Total++;
							if (is_accurate(P_Tilde, P_Exact, Precision))
								N_Passed++;
						} // ord
					} // delta
				} // LE
				Pbar.update(-a_max, a_max, a, true);
			} // a
			out_file << flavor_names[alpha] << " -> " << flavor_names[beta] << ": ";
			out_file << std::setprecision(3) << std::setw(5) << (double)N_Passed / N_Total;
			out_file << " passed, ord = " << order << ", prec = " << Precision << std::endl;
		} // beta
	} // alpha
	out_file << std::setfill('=') << std::setw(60) << "=" << std::setfill(' ') << std::endl;
	out_file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x958, %rsp            # imm = 0x958
movapd %xmm0, 0x50(%rsp)
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1ef8(%rip), %rsi      # 0xce38
leaq 0xe0(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x21a0
leaq 0x1ef9(%rip), %rsi      # 0xce50
leaq 0x80(%rsp), %r15
leaq 0x2e0(%rsp), %rdx
movq %r15, %rdi
callq 0x20a0
leaq 0xa0(%rsp), %r12
leaq 0x1ed5(%rip), %rsi      # 0xce53
leaq 0x3(%rsp), %rdx
movq %r12, %rdi
callq 0x20a0
leaq 0xc0(%rsp), %r12
leaq 0x1ebc(%rip), %rsi      # 0xce56
leaq 0x2(%rsp), %rdx
movq %r12, %rdi
callq 0x20a0
leaq 0x1382(%rip), %rax      # 0xc330
movsd (%rax), %xmm0
mulsd 0x1e46(%rip), %xmm0     # 0xce00
movapd 0x105e(%rip), %xmm1     # 0xc020
xorpd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movapd %xmm0, 0x40(%rsp)
addsd %xmm0, %xmm0
divsd 0x1c1a(%rip), %xmm0     # 0xcbf8
movapd %xmm0, 0x60(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0xb28c
movq %r15, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0x80, %rax
movq %rax, 0x28(%rsp)
xorl %r13d, %r13d
cmpq 0x20(%rsp), %r13
je 0xb27f
leaq 0x2e0(%rsp), %rdi
callq 0x9cdc
xorl %r12d, %r12d
movapd 0x30(%rsp), %xmm1
movl $0x0, 0x4(%rsp)
movapd 0x40(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xb199
movsd %xmm1, 0x8(%rsp)
addl $0xf2, 0x4(%rsp)
movsd 0x1da8(%rip), %xmm1     # 0xce08
movsd 0x1da8(%rip), %xmm0     # 0xce10
ucomisd %xmm1, %xmm0
jb 0xb166
movsd %xmm1, 0x10(%rsp)
xorpd %xmm1, %xmm1
movsd 0x1d94(%rip), %xmm0     # 0xce18
ucomisd %xmm1, %xmm0
jb 0xb153
pushq $0x2
popq %rax
movl %eax, %ebp
movsd %xmm1, 0x18(%rsp)
subl $0x1, %ebp
jb 0xb146
xorl %edi, %edi
cmpl $0x2, %eax
sete %dil
callq 0x37e3
movl %r15d, %edi
movl %r13d, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movl %ebx, %edx
callq *%r14
movapd %xmm0, 0x70(%rsp)
movl %r15d, %edi
movl %r13d, %esi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x4e50
movapd 0x70(%rsp), %xmm3
movapd %xmm3, %xmm1
divsd %xmm0, %xmm1
movsd 0xf12(%rip), %xmm2      # 0xc018
subsd %xmm1, %xmm2
movapd 0x13ae(%rip), %xmm1     # 0xc4c0
andpd %xmm1, %xmm2
subsd %xmm0, %xmm3
andpd %xmm1, %xmm3
movapd 0x50(%rsp), %xmm0
cmpltpd %xmm0, %xmm3
cmpltpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movd %xmm2, %eax
subl %eax, %r12d
movl %ebp, %eax
movsd 0x18(%rsp), %xmm1
jmp 0xb099
addsd 0x1cd2(%rip), %xmm1     # 0xce20
jmp 0xb07c
movsd 0x10(%rsp), %xmm1
addsd 0x1377(%rip), %xmm1     # 0xc4d8
jmp 0xb060
leaq 0x2e0(%rsp), %rdi
movapd 0x30(%rsp), %xmm0
movapd 0x40(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
pushq $0x1
popq %rsi
callq 0xa0c2
movsd 0x8(%rsp), %xmm1
addsd 0x60(%rsp), %xmm1
jmp 0xb03a
leaq 0xe0(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x2150
movq %rax, %rdi
leaq 0x1ca5(%rip), %rsi      # 0xce5a
callq 0x2190
movq %r13, %rcx
shlq $0x5, %rcx
leaq (%rsp,%rcx), %rsi
addq $0x80, %rsi
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
leaq 0x1a3c(%rip), %rsi      # 0xcc1a
callq 0x2190
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0xe8(%rsp,%rcx)
movq -0x18(%rax), %rax
cvtsi2sd %r12d, %xmm0
movq $0x5, 0xf0(%rsp,%rax)
cvtsi2sdl 0x4(%rsp), %xmm1
divsd %xmm1, %xmm0
leaq 0xe0(%rsp), %rdi
callq 0x2240
leaq 0xe0(%rsp), %rdi
leaq 0x1c29(%rip), %rsi      # 0xce5f
callq 0x2190
movq %rax, %rdi
movl %ebx, %esi
callq 0x2260
movq %rax, %rdi
leaq 0x1c20(%rip), %rsi      # 0xce6f
callq 0x2190
movq %rax, %rdi
movapd 0x50(%rsp), %xmm0
callq 0x2240
movq %rax, %rdi
callq 0x20d0
leaq 0x2e0(%rsp), %rdi
callq 0x9f04
incq %r13
jmp 0xb011
incq %r15
incq 0x20(%rsp)
jmp 0xafef
leaq 0xe0(%rsp), %rdi
pushq $0x3d
popq %rsi
callq 0x2220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x3c, 0x10(%rax,%rcx)
leaq 0x1974(%rip), %rsi      # 0xcc27
movq %rax, %rdi
callq 0x2190
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x2220
movq %rax, %rdi
callq 0x20d0
leaq 0xe0(%rsp), %rdi
callq 0x21f0
pushq $0x40
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x80, %rdi
callq 0x20c0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xb2de
leaq 0xe0(%rsp), %rdi
callq 0x2200
addq $0x958, %rsp            # imm = 0x958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb336
jmp 0xb31b
movq %rax, %rbx
addq $-0x20, %r12
movq %r12, %rdi
callq 0x20c0
cmpq %r15, %r12
jne 0xb31e
jmp 0xb36d
movq %rax, %rbx
jmp 0xb36d
movq %rax, %rbx
jmp 0xb34f
jmp 0xb33f
jmp 0xb33f
movq %rax, %rbx
leaq 0x2e0(%rsp), %rdi
callq 0x9f04
pushq $0x40
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x80, %rdi
callq 0x20c0
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0xb353
leaq 0xe0(%rsp), %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x2280