/* Copyright (C) 2010 Fredrik Johansson This file is part of FLINT. FLINT 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 . */ #include #include #include "flint.h" #include "arith.h" #include "ulong_extras.h" void check_value(slong n, char *ans) { fmpz_t x, y; fmpz_init(x); fmpz_init(y); fmpz_set_si(y, n); arith_ramanujan_tau(x, y); fmpz_set_str(y, ans, 10); if (!fmpz_equal(x,y)) { flint_printf("FAIL:\n"); flint_printf("tau(%wd) gave ", n); fmpz_print(x); flint_printf(", expected %s\n", ans); abort(); } fmpz_clear(x); fmpz_clear(y); } void consistency_check(slong n) { fmpz_poly_t p; fmpz_t x, y; slong k; fmpz_poly_init(p); fmpz_init(x); fmpz_init(y); arith_ramanujan_tau_series(p, n); if (p->length != n && !(n == 1 && p->length == 0)) { flint_printf("FAIL:\n"); flint_printf("wrong length of polynomial %wd\n", n); abort(); } for (k=0; k