1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Copyright (C) 2013 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 3 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/
#include "arb.h"
#include "acb_poly.h"
static void
arb_const_glaisher_eval(arb_t y, slong prec)
{
acb_struct z[2];
acb_t s, a;
slong wp;
acb_init(z + 0);
acb_init(z + 1);
acb_init(s);
acb_init(a);
wp = prec + 20;
/* directly evaluating at s = -1 is slightly faster
than evaluating at s = 2 */
acb_set_si(s, -1);
acb_one(a);
_acb_poly_zeta_cpx_series(z, s, a, 0, 2, wp);
arb_one(y);
arb_div_ui(y, y, 12, wp);
arb_sub(y, y, acb_realref(z + 1), wp);
arb_exp(y, y, wp);
acb_clear(z + 0);
acb_clear(z + 1);
acb_clear(s);
acb_clear(a);
}
ARB_DEF_CACHED_CONSTANT(arb_const_glaisher, arb_const_glaisher_eval)