From 7ae268345404a76836a4d084646f70201d6d1e2a Mon Sep 17 00:00:00 2001 From: p15-git-acc <37548430+p15-git-acc@users.noreply.github.com> Date: Tue, 19 Feb 2019 05:37:40 -0600 Subject: [PATCH] make corrections to zeta_zeros --- acb_dirichlet.h | 2 +- acb_dirichlet/hardy_z_zero.c | 17 +---------------- acb_dirichlet/isolate_hardy_z_zero.c | 2 ++ acb_dirichlet/zeta_zero.c | 5 ++--- acb_dirichlet/zeta_zeros.c | 4 ++++ 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/acb_dirichlet.h b/acb_dirichlet.h index 19852903..288cdabb 100644 --- a/acb_dirichlet.h +++ b/acb_dirichlet.h @@ -177,7 +177,7 @@ void _acb_dirichlet_refine_hardy_z_zero(arb_t res, const arf_t a, const arf_t b, void acb_dirichlet_hardy_z_zero(arb_t res, const fmpz_t n, slong prec); void acb_dirichlet_hardy_z_zeros(arb_ptr res, const fmpz_t n, slong len, slong prec); void acb_dirichlet_zeta_zero(acb_t res, const fmpz_t n, slong prec); -void acb_dirichlet_zeta_zeros(acb_t res, const fmpz_t n, slong len, slong prec); +void acb_dirichlet_zeta_zeros(acb_ptr res, const fmpz_t n, slong len, slong prec); void _acb_dirichlet_exact_zeta_nzeros(fmpz_t res, const arf_t t); void acb_dirichlet_zeta_nzeros(arb_t res, const arb_t t, slong prec); void acb_dirichlet_backlund_s(arb_t res, const arb_t t, slong prec); diff --git a/acb_dirichlet/hardy_z_zero.c b/acb_dirichlet/hardy_z_zero.c index 2e5cf4f0..4eaf2896 100644 --- a/acb_dirichlet/hardy_z_zero.c +++ b/acb_dirichlet/hardy_z_zero.c @@ -174,20 +174,5 @@ _acb_dirichlet_refine_hardy_z_zero(arb_t res, void acb_dirichlet_hardy_z_zero(arb_t res, const fmpz_t n, slong prec) { - arf_t a, b; - - if (fmpz_cmp_si(n, 1) < 0) - { - flint_printf("n must be positive\n"); - flint_abort(); - } - - arf_init(a); - arf_init(b); - - acb_dirichlet_isolate_hardy_z_zero(a, b, n); - _acb_dirichlet_refine_hardy_z_zero(res, a, b, prec); - - arf_clear(a); - arf_clear(b); + acb_dirichlet_hardy_z_zeros(res, n, 1, prec); } diff --git a/acb_dirichlet/isolate_hardy_z_zero.c b/acb_dirichlet/isolate_hardy_z_zero.c index bc886a70..d0cee1a3 100644 --- a/acb_dirichlet/isolate_hardy_z_zero.c +++ b/acb_dirichlet/isolate_hardy_z_zero.c @@ -1268,6 +1268,8 @@ acb_dirichlet_hardy_z_zeros(arb_ptr res, const fmpz_t n, slong len, slong prec) flint_printf("n must be positive\n"); flint_abort(); } + if (len <= 0) + return; fmpz_init(k); c = 0; while (c < len) diff --git a/acb_dirichlet/zeta_zero.c b/acb_dirichlet/zeta_zero.c index 887f4781..f1839bb6 100644 --- a/acb_dirichlet/zeta_zero.c +++ b/acb_dirichlet/zeta_zero.c @@ -20,14 +20,13 @@ acb_dirichlet_zeta_zero(acb_t res, const fmpz_t n, slong prec) switch (fmpz_sgn(n)) { case -1: - acb_set_d(res, 0.5); fmpz_neg(k, n); - acb_dirichlet_hardy_z_zero(acb_imagref(res), k, prec); + acb_dirichlet_zeta_zeros(res, k, 1, prec); acb_conj(res, res); break; case 1: acb_set_d(res, 0.5); - acb_dirichlet_hardy_z_zero(acb_imagref(res), n, prec); + acb_dirichlet_zeta_zeros(res, n, 1, prec); break; default: acb_indeterminate(res); diff --git a/acb_dirichlet/zeta_zeros.c b/acb_dirichlet/zeta_zeros.c index d39f554c..833132fe 100644 --- a/acb_dirichlet/zeta_zeros.c +++ b/acb_dirichlet/zeta_zeros.c @@ -19,6 +19,10 @@ acb_dirichlet_zeta_zeros(acb_ptr res, const fmpz_t n, slong len, slong prec) { acb_indeterminate(res); } + else if (len <= 0) + { + return; + } else { slong i;