mirror of
https://github.com/vale981/arb
synced 2025-03-06 01:41:39 -05:00
strengthen test code for acb_dirichlet_chi
This commit is contained in:
parent
89b67ce6db
commit
0c383ca3b5
1 changed files with 33 additions and 0 deletions
|
@ -39,6 +39,7 @@ int main()
|
|||
acb_t zn1, zn2, zn1n2, zn1zn2;
|
||||
acb_dirichlet_group_t G;
|
||||
ulong q, m, n1, n2, iter2;
|
||||
int res;
|
||||
|
||||
q = 1 + n_randint(state, 1000);
|
||||
|
||||
|
@ -48,6 +49,7 @@ int main()
|
|||
acb_init(zn1n2);
|
||||
acb_init(zn1zn2);
|
||||
|
||||
/* check chi(n1) chi(n2) = chi(n1 n2) */
|
||||
for (iter2 = 0; iter2 < 10; iter2++)
|
||||
{
|
||||
do {
|
||||
|
@ -77,6 +79,37 @@ int main()
|
|||
}
|
||||
}
|
||||
|
||||
if (iter % 10 == 0)
|
||||
{
|
||||
/* check orthogonality */
|
||||
acb_zero(zn1);
|
||||
n1 = n_randint(state, 1000);
|
||||
for (m = 1; m <= q; m++)
|
||||
{
|
||||
if (n_gcd(q, m) == 1)
|
||||
{
|
||||
acb_dirichlet_chi(zn2, G, m, n1, 53);
|
||||
acb_add(zn1, zn1, zn2, 53);
|
||||
}
|
||||
}
|
||||
|
||||
if (n1 % q == 1 % q)
|
||||
res = arb_contains_si(acb_realref(zn1), n_euler_phi(q)) &&
|
||||
arb_contains_zero(acb_imagref(zn1));
|
||||
else
|
||||
res = acb_contains_zero(zn1);
|
||||
|
||||
if (!res)
|
||||
{
|
||||
flint_printf("FAIL: orthogonality\n\n");
|
||||
flint_printf("q = %wu\n\n", q);
|
||||
flint_printf("phi = %wu\n\n", n_euler_phi(q));
|
||||
flint_printf("n1 = %wu\n\n", n1);
|
||||
flint_printf("zn1 = "); acb_printd(zn1, 15); flint_printf("\n\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
acb_dirichlet_group_clear(G);
|
||||
acb_clear(zn1);
|
||||
acb_clear(zn2);
|
||||
|
|
Loading…
Add table
Reference in a new issue