// File: /workspace/github_cpp_makefile_star2_O1/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 $0x978, %rsp            # imm = 0x978
movapd %xmm0, 0x70(%rsp)
movl %esi, 0x14(%rsp)
movq %rdi, %r14
leaq 0x1926(%rip), %rsi      # 0xee80
leaq 0x100(%rsp), %rdi
movl $0x1, %edx
callq 0x21b0
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1919(%rip), %rsi      # 0xee98
leaq 0x1914(%rip), %rdx      # 0xee9a
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
callq 0xd468
leaq 0xc0(%rsp), %r15
leaq 0xd0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x18ea(%rip), %rsi      # 0xee9b
leaq 0x18e5(%rip), %rdx      # 0xee9d
movq %r15, %rdi
callq 0xd468
leaq 0xe0(%rsp), %r15
leaq 0xf0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18c2(%rip), %rsi      # 0xee9e
leaq 0x18be(%rip), %rdx      # 0xeea1
movq %r15, %rdi
callq 0xd468
leaq 0xd3e(%rip), %rax       # 0xe330
movsd (%rax), %xmm0
mulsd 0x185a(%rip), %xmm0     # 0xee58
movapd 0xa1a(%rip), %xmm1      # 0xe020
xorpd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movapd %xmm0, 0x30(%rsp)
addsd %xmm0, %xmm0
divsd 0x1606(%rip), %xmm0     # 0xec28
movapd %xmm0, 0x80(%rsp)
movl $0x1, %ebx
xorl %r15d, %r15d
movq %r15, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xa0, %rax
movq %rax, 0x50(%rsp)
xorl %ebp, %ebp
leaq 0x300(%rsp), %r13
movq %rbx, 0x48(%rsp)
movq %r13, %rdi
callq 0xbde4
xorpd %xmm2, %xmm2
movapd 0x30(%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
ucomisd %xmm2, %xmm0
xorpd %xmm0, %xmm0
jae 0xd7c5
movsd %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x100(%rsp), %rdi
callq 0x21c0
movq %rax, %r13
movl $0x4, %edx
movq %rax, %rdi
leaq 0x17f0(%rip), %rsi      # 0xeea2
callq 0x21c0
movq %rbp, %rax
shlq $0x5, %rax
movq 0xa0(%rsp,%rax), %rsi
movq 0xa8(%rsp,%rax), %rdx
movq %r13, %rdi
callq 0x21c0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1565(%rip), %rsi      # 0xec4a
callq 0x21c0
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0x108(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x5, 0x110(%rsp,%rax)
movsd 0x8(%rsp), %xmm0
divsd 0x20(%rsp), %xmm0
leaq 0x100(%rsp), %rdi
callq 0x2260
movl $0xf, %edx
leaq 0x100(%rsp), %rdi
leaq 0x1768(%rip), %rsi      # 0xeea7
callq 0x21c0
leaq 0x100(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x2280
movq %rax, %r13
movl $0x9, %edx
movq %rax, %rdi
leaq 0x1750(%rip), %rsi      # 0xeeb7
callq 0x21c0
movq %r13, %rdi
movapd 0x70(%rsp), %xmm0
callq 0x2260
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x300(%rsp), %r13
movq %r13, %rdi
callq 0xc044
incq %rbp
cmpq %rbx, %rbp
jne 0xd657
jmp 0xd94c
xorl %eax, %eax
movaps 0x60(%rsp), %xmm0
xorl %r13d, %r13d
movsd %xmm0, 0x18(%rsp)
addl $0xf2, %eax
movl %eax, 0x2c(%rsp)
movl $0xfffff63c, %eax       # imm = 0xFFFFF63C
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x1, %ebx
xorl %edi, %edi
cmpl $0x1, %ebx
sete %dil
callq 0x3a3b
movl %r15d, %edi
movl %ebp, %esi
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movl 0x14(%rsp), %edx
callq *%r14
movapd %xmm0, 0x90(%rsp)
movl %r15d, %edi
movl %ebp, %esi
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
callq 0x5467
movapd 0x90(%rsp), %xmm3
movapd %xmm3, %xmm1
divsd %xmm0, %xmm1
movsd 0x7aa(%rip), %xmm2      # 0xe018
subsd %xmm1, %xmm2
movapd 0xc46(%rip), %xmm1      # 0xe4c0
andpd %xmm1, %xmm2
subsd %xmm0, %xmm3
andpd %xmm1, %xmm3
movapd 0x70(%rsp), %xmm0
cmpltpd %xmm0, %xmm3
cmpltpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movd %xmm2, %eax
subl %eax, %r13d
decl %ebx
je 0xd804
movsd 0x8(%rsp), %xmm1
addsd 0x15a9(%rip), %xmm1     # 0xee60
movsd 0x15a9(%rip), %xmm0     # 0xee68
movsd %xmm1, 0x8(%rsp)
ucomisd %xmm1, %xmm0
jae 0xd7ff
movq 0x58(%rsp), %rcx
leal 0x1f4(%rcx), %eax
cmpl $0x7d0, %ecx            # imm = 0x7D0
jle 0xd7e3
leaq 0x300(%rsp), %rdi
movapd 0x60(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movl $0x1, %esi
callq 0xc26a
movsd 0x18(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl 0x2c(%rsp), %eax
jae 0xd7cf
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x48(%rsp), %rbx
jmp 0xd681
leaq 0x1(%r15), %rax
incq %rbx
testq %r15, %r15
movq %rax, %r15
je 0xd633
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rbx
addq $0x100, %rbx            # imm = 0x100
cmpb $0x0, 0xe1(%rbx)
jne 0xd999
movq %rbx, %rdi
movl $0x20, %esi
callq 0x21a0
movb %al, 0xe0(%rbx)
movb $0x1, 0xe1(%rbx)
movb $0x3d, 0xe0(%rbx)
leaq 0x100(%rsp), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x3c, 0x110(%rsp,%rax)
leaq 0x1295(%rip), %rsi      # 0xec57
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %r14
addq $0x100, %r14            # imm = 0x100
cmpb $0x0, 0xe1(%r14)
jne 0xda0c
movq %r14, %rdi
movl $0x20, %esi
callq 0x21a0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
leaq 0x100(%rsp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x100(%rsp), %rdi
callq 0x2210
leaq 0xf0(%rsp), %rbx
xorl %r14d, %r14d
movq 0xe0(%rsp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0xda73
callq 0x2180
addq $-0x20, %r14
cmpq $-0x60, %r14
jne 0xda5d
movq 0x5544(%rip), %rax      # 0x12fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x108(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x100(%rsp,%rcx)
callq 0x2150
leaq 0x1f8(%rsp), %rdi
callq 0x20a0
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdb07
jmp 0xdacb
movq %rax, %rbx
jmp 0xdad6
movq %rax, %rbx
movq %r13, %r15
cmpq %r15, %r13
je 0xdb40
addq $-0x10, %r15
leaq 0xa0(%rsp), %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xdaf5
callq 0x2180
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0xdae7
jmp 0xdb40
movq %rax, %rbx
jmp 0xdb20
jmp 0xdb10
jmp 0xdb10
movq %rax, %rbx
leaq 0x300(%rsp), %rdi
callq 0xc044
movq $-0x60, %r14
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0xdb36
callq 0x2180
addq $-0x20, %r12
addq $0x20, %r14
jne 0xdb27
movq 0x5481(%rip), %rax      # 0x12fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x108(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x100(%rsp,%rcx)
callq 0x2150
leaq 0x1f8(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22a0