mirror of
https://github.com/vale981/arb
synced 2025-03-07 02:11:38 -05:00
98 lines
3.1 KiB
C
98 lines
3.1 KiB
C
/*=============================================================================
|
|
|
|
This file is part of ARB.
|
|
|
|
ARB is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
ARB is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with ARB; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
=============================================================================*/
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2015 Fredrik Johansson
|
|
|
|
******************************************************************************/
|
|
|
|
#include "acb_hypgeom.h"
|
|
|
|
int main()
|
|
{
|
|
slong iter;
|
|
flint_rand_t state;
|
|
|
|
flint_printf("hermite_h....");
|
|
fflush(stdout);
|
|
|
|
flint_randinit(state);
|
|
|
|
for (iter = 0; iter < 1000; iter++)
|
|
{
|
|
acb_t n, n1, n2, z, res1, res2, res3, s;
|
|
slong prec1, prec2, prec3;
|
|
|
|
acb_init(n);
|
|
acb_init(n1);
|
|
acb_init(n2);
|
|
acb_init(z);
|
|
acb_init(res1);
|
|
acb_init(res2);
|
|
acb_init(res3);
|
|
acb_init(s);
|
|
|
|
prec1 = 2 + n_randint(state, 300);
|
|
prec2 = 2 + n_randint(state, 300);
|
|
prec3 = 2 + n_randint(state, 300);
|
|
|
|
acb_randtest_param(n, state, 1 + n_randint(state, 400), 10);
|
|
acb_sub_ui(n1, n, 1, prec1);
|
|
acb_sub_ui(n2, n, 2, prec1);
|
|
acb_randtest_param(z, state, 1 + n_randint(state, 400), 10);
|
|
acb_randtest_param(res1, state, 1 + n_randint(state, 400), 10);
|
|
|
|
acb_hypgeom_hermite_h(res1, n, z, prec1);
|
|
acb_hypgeom_hermite_h(res2, n1, z, prec2);
|
|
acb_hypgeom_hermite_h(res3, n2, z, prec3);
|
|
|
|
acb_mul(s, res2, z, prec1);
|
|
acb_submul(s, res3, n1, prec1);
|
|
acb_mul_2exp_si(s, s, 1);
|
|
|
|
if (!acb_overlaps(res1, s))
|
|
{
|
|
flint_printf("FAIL: consistency\n\n");
|
|
flint_printf("iter = %wd\n\n", iter);
|
|
flint_printf("n = "); acb_printd(n, 30); flint_printf("\n\n");
|
|
flint_printf("z = "); acb_printd(z, 30); flint_printf("\n\n");
|
|
flint_printf("res1 = "); acb_printd(res1, 30); flint_printf("\n\n");
|
|
flint_printf("res2 = "); acb_printd(res2, 30); flint_printf("\n\n");
|
|
flint_printf("res3 = "); acb_printd(res3, 30); flint_printf("\n\n");
|
|
flint_printf("s = "); acb_printd(s, 30); flint_printf("\n\n");
|
|
abort();
|
|
}
|
|
|
|
acb_clear(n);
|
|
acb_clear(n1);
|
|
acb_clear(n2);
|
|
acb_clear(z);
|
|
acb_clear(res1);
|
|
acb_clear(res2);
|
|
acb_clear(res3);
|
|
acb_clear(s);
|
|
}
|
|
|
|
flint_randclear(state);
|
|
flint_cleanup();
|
|
flint_printf("PASS\n");
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|