2016-04-26 17:20:05 +02:00
|
|
|
/*
|
2014-06-13 22:08:25 +02:00
|
|
|
Copyright (C) 2013 Fredrik Johansson
|
|
|
|
|
2016-04-26 17:20:05 +02:00
|
|
|
This file is part of Arb.
|
|
|
|
|
|
|
|
Arb is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License (LGPL) as published
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version. See <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2014-06-13 22:08:25 +02:00
|
|
|
|
|
|
|
#include "acb_poly.h"
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2015-11-05 17:51:23 +00:00
|
|
|
slong iter;
|
2014-06-13 22:08:25 +02:00
|
|
|
flint_rand_t state;
|
|
|
|
|
2015-11-06 16:17:27 +00:00
|
|
|
flint_printf("zeta_em_tail_bsplit....");
|
2014-06-13 22:08:25 +02:00
|
|
|
fflush(stdout);
|
|
|
|
|
|
|
|
flint_randinit(state);
|
|
|
|
|
2016-04-10 17:24:58 +02:00
|
|
|
for (iter = 0; iter < 1000 * arb_test_multiplier(); iter++)
|
2014-06-13 22:08:25 +02:00
|
|
|
{
|
|
|
|
acb_t Na, s;
|
|
|
|
acb_ptr z1, z2, Nasx;
|
2015-11-05 17:51:23 +00:00
|
|
|
slong i, M, len, prec;
|
2014-06-13 22:08:25 +02:00
|
|
|
|
|
|
|
prec = 2 + n_randint(state, 400);
|
|
|
|
len = 1 + n_randint(state, 30);
|
|
|
|
M = n_randint(state, 40);
|
|
|
|
|
|
|
|
acb_init(Na);
|
|
|
|
acb_init(s);
|
|
|
|
|
|
|
|
Nasx = _acb_vec_init(len);
|
|
|
|
z1 = _acb_vec_init(len);
|
|
|
|
z2 = _acb_vec_init(len);
|
|
|
|
|
|
|
|
acb_randtest(Na, state, prec, 4);
|
|
|
|
acb_randtest(s, state, prec, 4);
|
|
|
|
|
|
|
|
_acb_poly_acb_invpow_cpx(Nasx, Na, s, len, prec);
|
|
|
|
|
|
|
|
_acb_poly_zeta_em_tail_naive(z1, s, Na, Nasx, M, len, prec);
|
|
|
|
_acb_poly_zeta_em_tail_bsplit(z2, s, Na, Nasx, M, len, prec);
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
if (!acb_overlaps(z1 + i, z2 + i))
|
|
|
|
{
|
2015-11-06 16:17:27 +00:00
|
|
|
flint_printf("FAIL: overlap\n\n");
|
|
|
|
flint_printf("iter = %wd\n", iter);
|
|
|
|
flint_printf("prec = %wd, len = %wd, M = %wd\n", prec, len, M);
|
|
|
|
flint_printf("s = "); acb_printd(s, prec / 3.33); flint_printf("\n\n");
|
|
|
|
flint_printf("Na = "); acb_printd(Na, prec / 3.33); flint_printf("\n\n");
|
|
|
|
flint_printf("z1 = "); acb_printd(z1 + i, prec / 3.33); flint_printf("\n\n");
|
|
|
|
flint_printf("z2 = "); acb_printd(z2 + i, prec / 3.33); flint_printf("\n\n");
|
2014-06-13 22:08:25 +02:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
acb_clear(Na);
|
|
|
|
acb_clear(s);
|
|
|
|
_acb_vec_clear(z1, len);
|
|
|
|
_acb_vec_clear(z2, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
flint_randclear(state);
|
|
|
|
flint_cleanup();
|
2015-11-06 16:17:27 +00:00
|
|
|
flint_printf("PASS\n");
|
2014-06-13 22:08:25 +02:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|