hardy_z: use reflection formula for zeta in upper half plane

This commit is contained in:
Fredrik Johansson 2016-12-02 11:18:49 +01:00
parent 5b0b786f9c
commit 253aeba284
2 changed files with 13 additions and 1 deletions

View file

@ -24,6 +24,16 @@ acb_dirichlet_hardy_z(acb_ptr res, const acb_t t,
if (len <= 0) if (len <= 0)
return; return;
/* use reflection formula -- todo for other characters */
if ((G == NULL || G->q == 1) && arf_sgn(arb_midref(acb_imagref(t))) > 0)
{
acb_neg(res, t);
acb_dirichlet_hardy_z(res, res, G, chi, len, prec);
for (k = 1; k < len; k += 2)
acb_neg(res + k, res + k);
return;
}
v = _acb_vec_init(len); v = _acb_vec_init(len);
w = _acb_vec_init(len); w = _acb_vec_init(len);

View file

@ -21,7 +21,7 @@ int main()
flint_randinit(state); flint_randinit(state);
for (iter = 0; iter < 100 * arb_test_multiplier(); iter++) for (iter = 0; iter < 200 * arb_test_multiplier(); iter++)
{ {
slong m, n1, n2, bits1, bits2, bits3; slong m, n1, n2, bits1, bits2, bits3;
acb_poly_t S, A, B, C; acb_poly_t S, A, B, C;
@ -56,6 +56,8 @@ int main()
acb_dirichlet_hardy_z_series(A, S, G, chi, n1, bits2); acb_dirichlet_hardy_z_series(A, S, G, chi, n1, bits2);
acb_poly_set(B, S); /* aliasing */ acb_poly_set(B, S); /* aliasing */
if (q == 1 && n_randint(state, 2))
acb_poly_neg(B, B);
acb_dirichlet_hardy_z_series(B, B, G, chi, n2, bits3); acb_dirichlet_hardy_z_series(B, B, G, chi, n2, bits3);
acb_poly_set(C, A); acb_poly_set(C, A);