// File: /workspace/github_cpp_makefile_star2_O3/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 $0x968, %rsp            # imm = 0x968
movapd %xmm0, 0x60(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, %r15
leaq 0x1ca2(%rip), %rsi      # 0xee80
leaq 0xf0(%rsp), %rdi
movl $0x1, %edx
callq 0x21b0
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c95(%rip), %rsi      # 0xee98
leaq 0x1c90(%rip), %rdx      # 0xee9a
leaq 0x90(%rsp), %rbp
movq %rbp, %rdi
callq 0xd0e4
leaq 0xb0(%rsp), %r12
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c66(%rip), %rsi      # 0xee9b
leaq 0x1c61(%rip), %rdx      # 0xee9d
movq %r12, %rdi
callq 0xd0e4
leaq 0xd0(%rsp), %r12
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c3f(%rip), %rsi      # 0xee9e
leaq 0x1c3b(%rip), %rdx      # 0xeea1
movq %r12, %rdi
callq 0xd0e4
leaq 0x10bb(%rip), %rax      # 0xe330
movsd (%rax), %xmm0
mulsd 0x1bd7(%rip), %xmm0     # 0xee58
movapd 0xd97(%rip), %xmm1      # 0xe020
xorpd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movapd %xmm0, 0x30(%rsp)
addsd %xmm0, %xmm0
divsd 0x1983(%rip), %xmm0     # 0xec28
movapd %xmm0, 0x70(%rsp)
movl $0x1, %eax
movq %rax, 0x28(%rsp)
xorl %ebx, %ebx
movb $0x1, %al
movl %eax, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x2f0(%rsp), %r12
movq %rbp, 0x40(%rsp)
movq %r12, %rdi
callq 0xba60
xorpd %xmm2, %xmm2
movapd 0x30(%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, (%rsp)
ucomisd %xmm2, %xmm0
xorpd %xmm0, %xmm0
jae 0xd437
movsd %xmm0, 0x18(%rsp)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
leaq 0xf0(%rsp), %rdi
callq 0x21c0
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1b7f(%rip), %rsi      # 0xeea2
callq 0x21c0
movq %r13, %rax
shlq $0x5, %rax
movq 0x90(%rsp,%rax), %rsi
movq 0x98(%rsp,%rax), %rdx
movq %r12, %rdi
callq 0x21c0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x18f4(%rip), %rsi      # 0xec4a
callq 0x21c0
movq 0xf0(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0xf8(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x5, 0x100(%rsp,%rax)
movsd (%rsp), %xmm0
divsd 0x18(%rsp), %xmm0
leaq 0xf0(%rsp), %rdi
callq 0x2260
movl $0xf, %edx
leaq 0xf0(%rsp), %rdi
leaq 0x1af8(%rip), %rsi      # 0xeea7
callq 0x21c0
leaq 0xf0(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x2280
movq %rax, %r12
movl $0x9, %edx
movq %rax, %rdi
leaq 0x1ae0(%rip), %rsi      # 0xeeb7
callq 0x21c0
movq %r12, %rdi
movapd 0x60(%rsp), %xmm0
callq 0x2260
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x2f0(%rsp), %r12
movq %r12, %rdi
callq 0xbcc0
incq %r13
cmpq 0x28(%rsp), %r13
jne 0xd2cd
jmp 0xd5b8
xorl %eax, %eax
movaps 0x50(%rsp), %xmm0
xorl %r12d, %r12d
movsd %xmm0, 0x10(%rsp)
addl $0xf2, %eax
movl %eax, 0x24(%rsp)
movl $0xfffff63c, %eax       # imm = 0xFFFFF63C
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movb $0x1, %bpl
movzbl %bpl, %edi
andl $0x1, %edi
callq 0x3a0f
movl %ebx, %edi
movl %r13d, %esi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd (%rsp), %xmm2
movl 0xc(%rsp), %edx
callq *%r15
movapd %xmm0, 0x80(%rsp)
movl %ebx, %edi
movl %r13d, %esi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd (%rsp), %xmm2
callq 0x543b
movapd 0x80(%rsp), %xmm3
movapd %xmm3, %xmm1
divsd %xmm0, %xmm1
movsd 0xb3f(%rip), %xmm2      # 0xe018
subsd %xmm1, %xmm2
movapd 0xfdb(%rip), %xmm1      # 0xe4c0
andpd %xmm1, %xmm2
subsd %xmm0, %xmm3
andpd %xmm1, %xmm3
movapd 0x60(%rsp), %xmm0
cmpltpd %xmm0, %xmm3
cmpltpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movd %xmm2, %eax
subl %eax, %r12d
testb $0x1, %bpl
movl $0x0, %ebp
jne 0xd473
movsd (%rsp), %xmm1
addsd 0x1938(%rip), %xmm1     # 0xee60
movsd 0x1938(%rip), %xmm0     # 0xee68
movsd %xmm1, (%rsp)
ucomisd %xmm1, %xmm0
jae 0xd470
movq 0x48(%rsp), %rcx
leal 0x1f4(%rcx), %eax
cmpl $0x7d0, %ecx            # imm = 0x7D0
jle 0xd455
leaq 0x2f0(%rsp), %rdi
movapd 0x50(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movl $0x1, %esi
callq 0xbee6
movsd 0x10(%rsp), %xmm0
addsd 0x70(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl 0x24(%rsp), %eax
jae 0xd441
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd %xmm0, (%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x40(%rsp), %rbp
jmp 0xd2f6
incq 0x28(%rsp)
movl $0x1, %ebx
leaq 0xb0(%rsp), %rbp
testb $0x1, 0x8(%rsp)
movl $0x0, 0x8(%rsp)
jne 0xd2bd
movq 0xf0(%rsp), %rax
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %rbx
addq $0xf0, %rbx
cmpb $0x0, 0xe1(%rbx)
jne 0xd619
movq %rbx, %rdi
movl $0x20, %esi
callq 0x21a0
movb $0x1, 0xe1(%rbx)
movq 0xf0(%rsp), %rax
movb $0x3d, 0xe0(%rbx)
movq -0x18(%rax), %rax
movq $0x3c, 0x100(%rsp,%rax)
leaq 0x1620(%rip), %rsi      # 0xec57
leaq 0xf0(%rsp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0xf0(%rsp), %rax
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %r15
addq $0xf0, %r15
cmpb $0x0, 0xe1(%r15)
jne 0xd68a
movq %r15, %rdi
movl $0x20, %esi
callq 0x21a0
movb $0x1, 0xe1(%r15)
movq 0xf0(%rsp), %rax
movb $0x20, 0xe0(%r15)
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
leaq 0xf0(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0xf0(%rsp), %rdi
callq 0x2210
leaq 0xe0(%rsp), %rbx
xorl %r14d, %r14d
movq 0xd0(%rsp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0xd6e9
callq 0x2180
addq $-0x20, %r14
cmpq $-0x60, %r14
jne 0xd6d3
movq 0x58ce(%rip), %rax      # 0x12fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x1e8(%rsp), %rbx
movq %rcx, -0xf8(%rbx)
movq -0x18(%rcx), %rcx
movq %rax, 0xf0(%rsp,%rcx)
leaq 0xf8(%rsp), %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x20a0
addq $0x968, %rsp            # imm = 0x968
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd778
jmp 0xd747
movq %rbp, %r14
movq %rax, %rbx
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0xd760
callq 0x2180
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %r14, %r12
movq %rax, %r12
jne 0xd751
jmp 0xd7b0
movq %rax, %rbx
jmp 0xd7b0
movq %rax, %rbx
jmp 0xd791
jmp 0xd781
jmp 0xd781
movq %rax, %rbx
leaq 0x2f0(%rsp), %rdi
callq 0xbcc0
movq $-0x60, %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0xd7a6
callq 0x2180
addq $-0x20, %r14
addq $0x20, %r15
jne 0xd798
movq 0x5811(%rip), %rax      # 0x12fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0xf8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0xf0(%rsp,%rcx)
callq 0x2150
leaq 0x1e8(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22a0